Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 30ec6fb

Browse files
author
Mark Wolff
authored
fix: send stringified _MS_Links (#42)
1 parent 51307b2 commit 30ec6fb

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

examples/basic-tracer-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"dependencies": {
3333
"@azure/monitor-opentelemetry-exporter": "^1.0.0-preview.2",
34-
"@opentelemetry/api": "^0.8.1",
34+
"@opentelemetry/api": "^0.9.0",
3535
"@opentelemetry/tracing": "^0.9.0"
3636
},
3737
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme"

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
"publish": "lerna run publish"
1313
},
1414
"devDependencies": {
15-
"@opentelemetry/api": "^0.8.3",
15+
"@opentelemetry/api": "^0.9.0",
1616
"@opentelemetry/tracing": "^0.9.0",
1717
"@types/mocha": "^7.0.2",
18-
"@types/node": "^14.0.13",
18+
"@types/node": "^14.0.14",
1919
"@typescript-eslint/eslint-plugin": "^2.34.0",
20-
"c8": "^7.1.2",
20+
"c8": "^7.2.0",
2121
"eslint": "^6.8.0",
2222
"eslint-config-airbnb-typescript": "^7.2.0",
2323
"eslint-config-prettier": "^6.10.1",
2424
"eslint-plugin-import": "^2.21.2",
2525
"eslint-plugin-node": "^11.1.0",
26-
"eslint-plugin-prettier": "^3.1.2",
26+
"eslint-plugin-prettier": "^3.1.4",
2727
"lerna": "^3.22.1",
2828
"mocha": "^7.2.0",
2929
"nock": "^12.0.3",

packages/azure-opentelemetry-exporter/src/utils/spanUtils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ function createPropertiesFromSpan(span: ReadableSpan): Properties {
6161
id: link.context.spanId,
6262
}));
6363

64-
properties[MS_LINKS] = links;
64+
if (links.length > 0) {
65+
properties[MS_LINKS] = JSON.stringify(links);
66+
}
67+
6568
return properties;
6669
}
6770

packages/azure-opentelemetry-exporter/test/utils/spanUtils.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ describe('spanUtils.ts', () => {
8181
'extra.attribute': 'foo',
8282
[grpc.GRPC_ERROR_MESSAGE]: 'some error message',
8383
[grpc.GRPC_ERROR_NAME]: 'some error name',
84-
[ai.MS_LINKS]: [],
8584
};
8685

8786
const expectedBaseData: Partial<RequestData> = {
@@ -135,7 +134,6 @@ describe('spanUtils.ts', () => {
135134
'extra.attribute': 'foo',
136135
[grpc.GRPC_ERROR_MESSAGE]: 'some error message',
137136
[grpc.GRPC_ERROR_NAME]: 'some error name',
138-
[ai.MS_LINKS]: [],
139137
};
140138

141139
const expectedBaseData: Partial<RemoteDependencyData> = {
@@ -186,7 +184,6 @@ describe('spanUtils.ts', () => {
186184
};
187185
const expectedProperties: Properties = {
188186
'extra.attribute': 'foo',
189-
[ai.MS_LINKS]: [],
190187
};
191188

192189
const expectedBaseData: Partial<RequestData> = {
@@ -234,7 +231,6 @@ describe('spanUtils.ts', () => {
234231
};
235232
const expectedProperties: Properties = {
236233
'extra.attribute': 'foo',
237-
[ai.MS_LINKS]: [],
238234
};
239235

240236
const expectedBaseData: Partial<RemoteDependencyData> = {
@@ -289,7 +285,6 @@ describe('spanUtils.ts', () => {
289285
};
290286
const expectedProperties: Properties = {
291287
'extra.attribute': 'foo',
292-
[ai.MS_LINKS]: [],
293288
};
294289

295290
const expectedBaseData: RequestData = {
@@ -339,7 +334,6 @@ describe('spanUtils.ts', () => {
339334
};
340335
const expectedProperties: Properties = {
341336
'extra.attribute': 'foo',
342-
[ai.MS_LINKS]: [],
343337
};
344338

345339
const expectedBaseData: RemoteDependencyData = {

0 commit comments

Comments
 (0)