fix: send stringified _MS_Links (#42)
This commit is contained in:
Родитель
51307b2b00
Коммит
30ec6fbd5d
|
@ -31,7 +31,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/monitor-opentelemetry-exporter": "^1.0.0-preview.2",
|
"@azure/monitor-opentelemetry-exporter": "^1.0.0-preview.2",
|
||||||
"@opentelemetry/api": "^0.8.1",
|
"@opentelemetry/api": "^0.9.0",
|
||||||
"@opentelemetry/tracing": "^0.9.0"
|
"@opentelemetry/tracing": "^0.9.0"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme"
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js#readme"
|
||||||
|
|
|
@ -12,18 +12,18 @@
|
||||||
"publish": "lerna run publish"
|
"publish": "lerna run publish"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@opentelemetry/api": "^0.8.3",
|
"@opentelemetry/api": "^0.9.0",
|
||||||
"@opentelemetry/tracing": "^0.9.0",
|
"@opentelemetry/tracing": "^0.9.0",
|
||||||
"@types/mocha": "^7.0.2",
|
"@types/mocha": "^7.0.2",
|
||||||
"@types/node": "^14.0.13",
|
"@types/node": "^14.0.14",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.34.0",
|
"@typescript-eslint/eslint-plugin": "^2.34.0",
|
||||||
"c8": "^7.1.2",
|
"c8": "^7.2.0",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^6.8.0",
|
||||||
"eslint-config-airbnb-typescript": "^7.2.0",
|
"eslint-config-airbnb-typescript": "^7.2.0",
|
||||||
"eslint-config-prettier": "^6.10.1",
|
"eslint-config-prettier": "^6.10.1",
|
||||||
"eslint-plugin-import": "^2.21.2",
|
"eslint-plugin-import": "^2.21.2",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-prettier": "^3.1.2",
|
"eslint-plugin-prettier": "^3.1.4",
|
||||||
"lerna": "^3.22.1",
|
"lerna": "^3.22.1",
|
||||||
"mocha": "^7.2.0",
|
"mocha": "^7.2.0",
|
||||||
"nock": "^12.0.3",
|
"nock": "^12.0.3",
|
||||||
|
|
|
@ -61,7 +61,10 @@ function createPropertiesFromSpan(span: ReadableSpan): Properties {
|
||||||
id: link.context.spanId,
|
id: link.context.spanId,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
properties[MS_LINKS] = links;
|
if (links.length > 0) {
|
||||||
|
properties[MS_LINKS] = JSON.stringify(links);
|
||||||
|
}
|
||||||
|
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,6 @@ describe('spanUtils.ts', () => {
|
||||||
'extra.attribute': 'foo',
|
'extra.attribute': 'foo',
|
||||||
[grpc.GRPC_ERROR_MESSAGE]: 'some error message',
|
[grpc.GRPC_ERROR_MESSAGE]: 'some error message',
|
||||||
[grpc.GRPC_ERROR_NAME]: 'some error name',
|
[grpc.GRPC_ERROR_NAME]: 'some error name',
|
||||||
[ai.MS_LINKS]: [],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const expectedBaseData: Partial<RequestData> = {
|
const expectedBaseData: Partial<RequestData> = {
|
||||||
|
@ -135,7 +134,6 @@ describe('spanUtils.ts', () => {
|
||||||
'extra.attribute': 'foo',
|
'extra.attribute': 'foo',
|
||||||
[grpc.GRPC_ERROR_MESSAGE]: 'some error message',
|
[grpc.GRPC_ERROR_MESSAGE]: 'some error message',
|
||||||
[grpc.GRPC_ERROR_NAME]: 'some error name',
|
[grpc.GRPC_ERROR_NAME]: 'some error name',
|
||||||
[ai.MS_LINKS]: [],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const expectedBaseData: Partial<RemoteDependencyData> = {
|
const expectedBaseData: Partial<RemoteDependencyData> = {
|
||||||
|
@ -186,7 +184,6 @@ describe('spanUtils.ts', () => {
|
||||||
};
|
};
|
||||||
const expectedProperties: Properties = {
|
const expectedProperties: Properties = {
|
||||||
'extra.attribute': 'foo',
|
'extra.attribute': 'foo',
|
||||||
[ai.MS_LINKS]: [],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const expectedBaseData: Partial<RequestData> = {
|
const expectedBaseData: Partial<RequestData> = {
|
||||||
|
@ -234,7 +231,6 @@ describe('spanUtils.ts', () => {
|
||||||
};
|
};
|
||||||
const expectedProperties: Properties = {
|
const expectedProperties: Properties = {
|
||||||
'extra.attribute': 'foo',
|
'extra.attribute': 'foo',
|
||||||
[ai.MS_LINKS]: [],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const expectedBaseData: Partial<RemoteDependencyData> = {
|
const expectedBaseData: Partial<RemoteDependencyData> = {
|
||||||
|
@ -289,7 +285,6 @@ describe('spanUtils.ts', () => {
|
||||||
};
|
};
|
||||||
const expectedProperties: Properties = {
|
const expectedProperties: Properties = {
|
||||||
'extra.attribute': 'foo',
|
'extra.attribute': 'foo',
|
||||||
[ai.MS_LINKS]: [],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const expectedBaseData: RequestData = {
|
const expectedBaseData: RequestData = {
|
||||||
|
@ -339,7 +334,6 @@ describe('spanUtils.ts', () => {
|
||||||
};
|
};
|
||||||
const expectedProperties: Properties = {
|
const expectedProperties: Properties = {
|
||||||
'extra.attribute': 'foo',
|
'extra.attribute': 'foo',
|
||||||
[ai.MS_LINKS]: [],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const expectedBaseData: RemoteDependencyData = {
|
const expectedBaseData: RemoteDependencyData = {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче