microsoft / ApplicationInsights-node.js

Microsoft Application Insights SDK for Node.js
MIT License
320 stars 138 forks source link

No way to set the telemetry context without a Request #1156

Closed chriskuech closed 3 weeks ago

chriskuech commented 1 year ago

I can't find a way to set the operationId for a background worker process, or generally any scenario that does not have a Request associated with it. The closest appears to be startOperation, but there does not seem to be any construct for creating the SpanContext. I also can't find any mapping between OpenTelemetry concepts and App Insights concepts if I were to use the SpanContext.

How can I create a telemetry operation as a child of a given operationId?

JacksonWeber commented 1 month ago

@chriskuech The entire SDK is now built on top of OpenTelemetry. However, if you're familiar with OpenTelemetry concepts and don't require the 2.X SDK's API, the best package to use is Azure Monitor OpenTelemetry. Please let me know if you have any further questions.

chriskuech commented 3 weeks ago

Thanks @JacksonWeber . I'm no longer using the package to confirm, so feel free to close if this is done