Sets the metadata in the given OpenTelemetry context. If OI tracer is used in spans created during this active context, the metadata will be added to the span as an attribute.
The context to set the metadata on.
The metadata to set on the context.
The context
context.with( setMetadata(context.active(), { key: "value", numeric: 1 }), () => { // Spans created here will have metadata attribute }); Copy
context.with( setMetadata(context.active(), { key: "value", numeric: 1 }), () => { // Spans created here will have metadata attribute });
Sets the metadata in the given OpenTelemetry context. If OI tracer is used in spans created during this active context, the metadata will be added to the span as an attribute.