UNPKG

@sentry/core

Version:
22 lines (21 loc) • 613 B
// src/spanKind.ts /** * Map of otel span kind numbers to span kind names. */ const SPAN_KIND_NUMBER_TO_NAME = { [0]: void 0, [1]: "server", [2]: "client", [3]: "producer", [4]: "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