OptionalnameThe operation/page name for this trace context.
// Old (deprecated)
let name = context.telemetryTrace.name;
// New (recommended) - using the standard SKU (AISKU)
let traceCtx = appInsights.getTraceCtx();
let pageName = traceCtx.pageName;
traceCtx.pageName = "my-page";
// Or when using the core directly
let traceCtx = appInsights.core.getTraceCtx();
OptionalparentIDThe parent span ID. A 16 lowercase hex character string.
// Old (deprecated)
let parentId = context.telemetryTrace.parentID;
// New (recommended) - using the standard SKU (AISKU)
let traceCtx = appInsights.getTraceCtx();
let spanId = traceCtx.spanId;
traceCtx.spanId = "0000000000000001";
// Or when using the core directly
let traceCtx = appInsights.core.getTraceCtx();
OptionaltraceAn integer representation of the W3C TraceContext trace-flags.
// Old (deprecated)
let flags = context.telemetryTrace.traceFlags;
// New (recommended) - using the standard SKU (AISKU)
let traceCtx = appInsights.getTraceCtx();
let flags = traceCtx.traceFlags;
traceCtx.traceFlags = 1; // sampled
// Or when using the core directly
let traceCtx = appInsights.core.getTraceCtx();
OptionaltraceIDThe trace ID for this telemetry context. A 32 lowercase hex character string.
// Old (deprecated)
let traceId = context.telemetryTrace.traceID;
// New (recommended) - using the standard SKU (AISKU)
let traceCtx = appInsights.getTraceCtx();
let traceId = traceCtx.traceId;
traceCtx.traceId = "00000000000000000000000000000001";
// Or when using the core directly
let traceCtx = appInsights.core.getTraceCtx();
Interface for telemetry trace context.
Deprecated
Use ITraceHost.getTraceCtx | appInsights.getTraceCtx() or ITraceHost.getTraceCtx | appInsights.core.getTraceCtx() instead to get / set the current trace context. This returns an IDistributedTraceContext which supports distributed tracing and allows the core to manage the trace context.
To replace the entire trace context, use ITraceHost.setTraceCtx | appInsights.core.setTraceCtx().
See