@sentry/core
Version:
Base implementation for all Sentry JavaScript SDKs
22 lines (21 loc) • 613 B
JavaScript
// src/spanKind.ts
/**
* Map of otel span kind numbers to span kind names.
*/
const SPAN_KIND_NUMBER_TO_NAME = {
[]: void 0,
[]: "server",
[]: "client",
[]: "producer",
[]: "consumer"
};
/**
* Resolve the string name of a span kind value (e.g. `1` → `'SERVER'`), mirroring the reverse
* mapping of OpenTelemetry's `SpanKind` enum. Used for the `otel.kind` span attribute, so SDK
* code doesn't need to import `@opentelemetry/api` just for that reverse lookup.
*/
function spanKindToName(kind) {
return SPAN_KIND_NUMBER_TO_NAME[kind];
}
export { spanKindToName };
//# sourceMappingURL=spanKind.js.map