Skip to content

Commit

Permalink
Updating to latest Azure SDK and OpenTelemetry dependencies (#790)
Browse files Browse the repository at this point in the history
* Updating to latest Azure SDK and OpenTelemetry dependencies

* diagnostic-channel-publishers need to be updated as well, will update package.lock.json once is published

* Trigger build

* lock
  • Loading branch information
hectorhdzg committed Jul 12, 2021
1 parent 02a83fd commit 6f496c6
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 61 deletions.
7 changes: 3 additions & 4 deletions AutoCollection/AsyncHooksScopeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class OpenTelemetryScopeManagerWrapper {
if (key === this._activeSymbol) {
return context;
}

return false;
},
setValue: () => { }
Expand Down Expand Up @@ -55,10 +54,10 @@ export class OpenTelemetryScopeManagerWrapper {
}

private static _spanToContext(span: Span, parentSpanId?: string, name?: string): CorrelationContext {
const _parentId = parentSpanId ? `|${span.context().traceId}.${parentSpanId}.` : span.context().traceId;
const _parentId = parentSpanId ? `|${span.spanContext().traceId}.${parentSpanId}.` : span.spanContext().traceId;
const context: SpanContext = {
...span.context(),
traceFlags: span.context().traceFlags
...span.spanContext(),
traceFlags: span.spanContext().traceFlags
};
const correlationContext = CorrelationContextManager.spanToContextObject(context, _parentId, name)
return correlationContext;
Expand Down
2 changes: 1 addition & 1 deletion AutoCollection/diagnostic-channel/SpanParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function filterSpanAttributes(attributes: SpanAttributes) {
}

export function spanToTelemetryContract(span: Span): (Contracts.DependencyTelemetry & Contracts.RequestTelemetry) & Contracts.Identified {
const id = `|${span.context().traceId}.${span.context().spanId}.`;
const id = `|${span.spanContext().traceId}.${span.spanContext().spanId}.`;
const duration = Math.round(span["_duration"][0] * 1e3 + span["_duration"][1] / 1e6);
let peerAddress = span.attributes["peer.address"] ? span.attributes["peer.address"].toString() : "";
let component = span.attributes["component"] ? span.attributes["component"].toString() : "";
Expand Down
2 changes: 1 addition & 1 deletion AutoCollection/diagnostic-channel/azure-coretracing.sub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let clients: TelemetryClient[] = [];
export const subscriber = (event: IStandardEvent<Span>) => {
const span = event.data;
const telemetry = SpanParser.spanToTelemetryContract(span);
const spanContext = span.context();
const spanContext = span.spanContext();
const traceparent = new Traceparent();
traceparent.traceId = spanContext.traceId;
traceparent.spanId = spanContext.spanId;
Expand Down
91 changes: 40 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
"typescript": "4.1.2"
},
"dependencies": {
"@azure/core-http": "^1.2.5",
"@opentelemetry/api": "^0.18.1",
"@opentelemetry/tracing": "^0.19.0",
"@azure/core-http": "^2.0.0",
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/tracing": "^0.23.0",
"cls-hooked": "^4.2.2",
"continuation-local-storage": "^3.2.1",
"diagnostic-channel": "1.0.0",
"diagnostic-channel-publishers": "1.0.0"
"diagnostic-channel-publishers": "1.0.1"
}
}

0 comments on commit 6f496c6

Please sign in to comment.