Skip to content

Commit b72bf85

Browse files
committed
Update types and tests
1 parent 7a6736a commit b72bf85

File tree

3 files changed

+58
-48
lines changed

3 files changed

+58
-48
lines changed

dev-packages/node-integration-tests/suites/tracing/metric-summaries/test.ts

Lines changed: 56 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,72 @@ import { createRunner } from '../../../utils/runner';
33
const EXPECTED_TRANSACTION = {
44
transaction: 'Test Transaction',
55
_metrics_summary: {
6-
'c:root-counter@none': {
7-
min: 1,
8-
max: 1,
9-
count: 2,
10-
sum: 2,
11-
tags: {
12-
release: '1.0',
13-
transaction: 'Test Transaction',
6+
'c:root-counter@none': [
7+
{
8+
min: 1,
9+
max: 1,
10+
count: 2,
11+
sum: 2,
12+
tags: {
13+
release: '1.0',
14+
transaction: 'Test Transaction',
15+
},
1416
},
15-
},
17+
],
1618
},
1719
spans: expect.arrayContaining([
1820
expect.objectContaining({
1921
description: 'Some other span',
2022
op: 'transaction',
2123
_metrics_summary: {
22-
'c:root-counter@none': {
23-
min: 1,
24-
max: 2,
25-
count: 3,
26-
sum: 4,
27-
tags: {
28-
release: '1.0',
29-
transaction: 'Test Transaction',
30-
},
31-
},
32-
's:root-set@none': {
33-
min: 0,
34-
max: 1,
35-
count: 3,
36-
sum: 2,
37-
tags: {
38-
release: '1.0',
39-
transaction: 'Test Transaction',
24+
'c:root-counter@none': [
25+
{
26+
min: 1,
27+
max: 2,
28+
count: 3,
29+
sum: 4,
30+
tags: {
31+
release: '1.0',
32+
transaction: 'Test Transaction',
33+
},
4034
},
41-
},
42-
'g:root-gauge@none': {
43-
min: 20,
44-
max: 42,
45-
count: 2,
46-
sum: 62,
47-
tags: {
48-
release: '1.0',
49-
transaction: 'Test Transaction',
35+
],
36+
's:root-set@none': [
37+
{
38+
min: 0,
39+
max: 1,
40+
count: 3,
41+
sum: 2,
42+
tags: {
43+
release: '1.0',
44+
transaction: 'Test Transaction',
45+
},
46+
}
47+
],
48+
'g:root-gauge@none': [
49+
{
50+
min: 20,
51+
max: 42,
52+
count: 2,
53+
sum: 62,
54+
tags: {
55+
release: '1.0',
56+
transaction: 'Test Transaction',
57+
},
5058
},
51-
},
52-
'd:root-distribution@none': {
53-
min: 20,
54-
max: 42,
55-
count: 2,
56-
sum: 62,
57-
tags: {
58-
release: '1.0',
59-
transaction: 'Test Transaction',
59+
]
60+
'd:root-distribution@none': [
61+
{
62+
min: 20,
63+
max: 42,
64+
count: 2,
65+
sum: 62,
66+
tags: {
67+
release: '1.0',
68+
transaction: 'Test Transaction',
69+
},
6070
},
61-
},
71+
],
6272
},
6373
}),
6474
]),

packages/types/src/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export interface ErrorEvent extends Event {
7272
}
7373
export interface TransactionEvent extends Event {
7474
type: 'transaction';
75-
_metrics_summary?: Record<string, MetricSummary>;
75+
_metrics_summary?: Record<string, Array<MetricSummary>>;
7676
}
7777

7878
/** JSDoc */

packages/types/src/span.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export interface SpanJSON {
5555
timestamp?: number;
5656
trace_id: string;
5757
origin?: SpanOrigin;
58-
_metrics_summary?: Record<string, MetricSummary>;
58+
_metrics_summary?: Record<string, Array<MetricSummary>>;
5959
}
6060

6161
// These are aligned with OpenTelemetry trace flags

0 commit comments

Comments
 (0)