Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ if (!SAMPLE_SESSION) {
console.debug('Analytics session is not being sampled, telemetry events will be ignored');
}

const analyticsEnabled = !TELEMETRY_DISABLED && SAMPLE_SESSION;
if (!window.SERVER_FLAGS.releaseVersion) {
// eslint-disable-next-line no-console
console.debug('No release version set, telemetry events will be ignored');
}

const analyticsEnabled =
!TELEMETRY_DISABLED && SAMPLE_SESSION && !!window.SERVER_FLAGS.releaseVersion;

// Initialize Segment Analytics as soon as possible, outside of React useEffect.
// This ensures that analytics.load method is invoked before any other methods.
Expand Down
4 changes: 1 addition & 3 deletions frontend/packages/console-shared/src/hooks/useTelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ export const getClusterProperties = () => {
) {
clusterProperties.clusterType = 'DEVSANDBOX';
}
// Prefer to report the OCP version (releaseVersion) if available.
clusterProperties.consoleVersion =
window.SERVER_FLAGS.releaseVersion || window.SERVER_FLAGS.consoleVersion;
clusterProperties.consoleVersion = window.SERVER_FLAGS.releaseVersion;
clusterProperties.organizationId = window.SERVER_FLAGS.telemetry?.ORGANIZATION_ID;
clusterProperties.accountMail = window.SERVER_FLAGS.telemetry?.ACCOUNT_MAIL;
return clusterProperties;
Expand Down