cap-js / telemetry

CDS plugin providing observability features, incl. automatic OpenTelemetry instrumentation.
https://cap.cloud.sap/docs
Apache License 2.0
8 stars 6 forks source link

Custom Spans and nesting #226

Open tsteckenborn opened 3 weeks ago

tsteckenborn commented 3 weeks ago

Hello everyone,

What's the current strategy and behaviour around doing your own spans within your coding?

trace
.getActiveSpan()!
.spanContext(),

Doesn't seem to work anymore with the latest updates, yet you can get e.g. the context via:

context
.active()
// @ts-expect-error
.getValue(cds?.context?._otelKey)
.spanContext(),

In case we use this data to create custom spans having the cap span as a parent, are further spans by the plugin taking the currently active span, or the span set by the plugin?