From 056183d09c0eb8f16df3e44723813b9468589238 Mon Sep 17 00:00:00 2001 From: Isabella Siu Date: Wed, 27 Aug 2025 17:53:17 -0400 Subject: [PATCH] Add tracking for when auth type is changed --- src/components/ConnectionConfig.tsx | 2 ++ src/components/tracking.ts | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 src/components/tracking.ts diff --git a/src/components/ConnectionConfig.tsx b/src/components/ConnectionConfig.tsx index 8ea4616..4803374 100644 --- a/src/components/ConnectionConfig.tsx +++ b/src/components/ConnectionConfig.tsx @@ -12,6 +12,7 @@ import { AwsAuthType, ConnectionConfigProps } from '../types'; import { awsAuthProviderOptions } from '../providers'; import { assumeRoleInstructionsStyle } from './ConnectionConfig.styles'; import { ConfigSection, ConfigSubSection } from '@grafana/plugin-ui'; +import { trackAwsSdkConfigAuthSelected } from './tracking'; export const DEFAULT_LABEL_WIDTH = 28; const DS_TYPES_THAT_SUPPORT_TEMP_CREDS = ['cloudwatch', 'grafana-athena-datasource']; @@ -85,6 +86,7 @@ export const ConnectionConfig: FC = (props: ConnectionCon defaultValue={options.jsonData.authType} onChange={(option) => { onUpdateDatasourceJsonDataOptionSelect(props, 'authType')(option); + trackAwsSdkConfigAuthSelected({ authType: option.value, datasourceType: options.type }); }} menuShouldPortal={true} /> diff --git a/src/components/tracking.ts b/src/components/tracking.ts new file mode 100644 index 0000000..7d3bd49 --- /dev/null +++ b/src/components/tracking.ts @@ -0,0 +1,6 @@ +import { reportInteraction } from '@grafana/runtime'; +import { AwsAuthType } from '../types'; + +export const trackAwsSdkConfigAuthSelected = (props: { authType?: AwsAuthType; datasourceType?: string }) => { + reportInteraction('aws-sdk-config-auth-selected', props); +};