Skip to content

Commit b2bbfa1

Browse files
just-borisgeorgylobko
authored andcommitted
chore: Update metrics reporting (#3236)
1 parent 1147b33 commit b2bbfa1

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/alert/__tests__/runtime-content.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ describe('asynchronous rendering', () => {
305305
const message = `"${method}" called after component unmounted`;
306306
expect(consoleWarnSpy).toBeCalledWith('[AwsUi]', '[alert-content-replacer]', message);
307307
expect(sendPanoramaMetricSpy).toBeCalledWith({
308-
eventName: 'awsui-runtime-api-warning',
308+
eventContext: 'awsui-runtime-api-warning',
309309
eventDetail: {
310310
component: 'alert-content-replacer',
311311
version: expect.any(String),
@@ -374,7 +374,7 @@ test('can only register a single provider', () => {
374374
)
375375
);
376376
expect(sendPanoramaMetricSpy).toHaveBeenCalledWith({
377-
eventName: 'awsui-runtime-api-warning',
377+
eventContext: 'awsui-runtime-api-warning',
378378
eventDetail: {
379379
component: 'alert-flash-content',
380380
version: expect.any(String),

src/flashbar/__tests__/runtime-content.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ describe('asynchronous rendering', () => {
300300
const message = `"${method}" called after component unmounted`;
301301
expect(consoleWarnSpy).toBeCalledWith('[AwsUi]', '[flash-content-replacer]', message);
302302
expect(sendPanoramaMetricSpy).toBeCalledWith({
303-
eventName: 'awsui-runtime-api-warning',
303+
eventContext: 'awsui-runtime-api-warning',
304304
eventDetail: {
305305
component: 'flash-content-replacer',
306306
version: expect.any(String),

src/internal/plugins/__tests__/api.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('usage metrics', () => {
8282
expect(sendPanoramaMetricSpy).toHaveBeenCalledTimes(1);
8383
expect(sendPanoramaMetricSpy).toHaveBeenCalledWith(
8484
expect.objectContaining({
85-
eventName: 'awsui-runtime-api-loaded',
85+
eventContext: 'awsui-runtime-api-loaded',
8686
})
8787
);
8888

src/internal/plugins/controllers/__tests__/drawers.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('console warnings', () => {
116116
expect.stringMatching(/multiple app layout instances detected/)
117117
);
118118
expect(sendPanoramaMetricSpy).toHaveBeenCalledWith({
119-
eventName: 'awsui-runtime-api-warning',
119+
eventContext: 'awsui-runtime-api-warning',
120120
eventDetail: {
121121
component: 'app-layout-drawers',
122122
version: expect.any(String),
@@ -136,7 +136,7 @@ describe('console warnings', () => {
136136
expect.stringMatching(/drawer with id "drawerA" is already registered/)
137137
);
138138
expect(sendPanoramaMetricSpy).toHaveBeenCalledWith({
139-
eventName: 'awsui-runtime-api-warning',
139+
eventContext: 'awsui-runtime-api-warning',
140140
eventDetail: {
141141
component: 'app-layout-drawers',
142142
version: expect.any(String),

src/internal/plugins/helpers/metrics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { PACKAGE_VERSION } from '../../environment';
44
import { metrics } from '../../metrics';
55

66
export function reportRuntimeApiLoadMetric() {
7-
metrics.sendPanoramaMetric({ eventName: 'awsui-runtime-api-loaded', eventDetail: { version: PACKAGE_VERSION } });
7+
metrics.sendPanoramaMetric({ eventContext: 'awsui-runtime-api-loaded', eventDetail: { version: PACKAGE_VERSION } });
88
}
99

1010
export function reportRuntimeApiWarning(component: string, message: string) {
1111
console.warn('[AwsUi]', `[${component}]`, message);
1212
metrics.sendPanoramaMetric({
13-
eventName: 'awsui-runtime-api-warning',
13+
eventContext: 'awsui-runtime-api-warning',
1414
eventDetail: { version: PACKAGE_VERSION, component, message },
1515
});
1616
}

0 commit comments

Comments
 (0)