Skip to content

Commit 17a5892

Browse files
jj22eemxiamxia
andauthored
LLO Handler - Full implementation and tests (#203)
*Issue #, if available:* JS equivalent of: - aws-observability/aws-otel-python-instrumentation#394 - aws-observability/aws-otel-python-instrumentation#406 *Description of changes:* By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Min Xia <[email protected]>
1 parent 00192f9 commit 17a5892

15 files changed

+2648
-34
lines changed

aws-distro-opentelemetry-node-autoinstrumentation/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@
100100
"@opentelemetry/api": "1.9.0",
101101
"@opentelemetry/auto-configuration-propagators": "0.3.2",
102102
"@opentelemetry/auto-instrumentations-node": "0.56.0",
103+
"@opentelemetry/api-events": "0.57.1",
104+
"@opentelemetry/sdk-events": "0.57.1",
105+
"@opentelemetry/sdk-logs": "0.57.1",
103106
"@opentelemetry/core": "1.30.1",
104107
"@opentelemetry/exporter-metrics-otlp-grpc": "0.57.1",
105108
"@opentelemetry/exporter-metrics-otlp-http": "0.57.1",

aws-distro-opentelemetry-node-autoinstrumentation/src/aws-metric-attributes-span-exporter.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
MetricAttributeGenerator,
1414
SERVICE_METRIC,
1515
} from './metric-attribute-generator';
16+
import { Mutable } from './utils';
1617

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

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

0 commit comments

Comments
 (0)