Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
"@opentelemetry/api": "1.9.0",
"@opentelemetry/auto-configuration-propagators": "0.3.2",
"@opentelemetry/auto-instrumentations-node": "0.56.0",
"@opentelemetry/api-events": "0.57.1",
"@opentelemetry/sdk-events": "0.57.1",
"@opentelemetry/sdk-logs": "0.57.1",
"@opentelemetry/core": "1.30.1",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.57.1",
"@opentelemetry/exporter-metrics-otlp-http": "0.57.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
MetricAttributeGenerator,
SERVICE_METRIC,
} from './metric-attribute-generator';
import { Mutable } from './utils';

/**
* This exporter will update a span with metric attributes before exporting. It depends on a
Expand Down Expand Up @@ -125,9 +126,6 @@ export class AwsMetricAttributesSpanExporter implements SpanExporter {
}

// Bypass `readonly` restriction of ReadableSpan's attributes.
// Workaround provided from official TypeScript docs:
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#improved-control-over-mapped-type-modifiers
type Mutable<T> = { -readonly [P in keyof T]: T[P] };
const mutableSpan: Mutable<ReadableSpan> = span;
mutableSpan.attributes = updateAttributes;

Expand Down
Loading