Skip to content

Commit a44f51e

Browse files
authored
AppSignals Functionality - add Application Signals Configuration into ADOT (#12)
*Issue #, if available:* *Description of changes:* Implement the following files in TypeScript ``` register.ts aws-opentelemetry-configurator.ts ``` - [Java Comparison](https://github.com/aws-observability/aws-otel-java-instrumentation/tree/main/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers) ([`AwsAgentPropertiesCustomizerProvider`](https://github.com/aws-observability/aws-otel-java-instrumentation/blob/main/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsAgentPropertiesCustomizerProvider.java) and [`AwsApplicationSignalsCustomizerProvider`](https://github.com/aws-observability/aws-otel-java-instrumentation/blob/main/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsApplicationSignalsCustomizerProvider.java)) - [Python Comparison](https://github.com/aws-observability/aws-otel-python-instrumentation/tree/main/aws-opentelemetry-distro/src/amazon/opentelemetry/distro) ([`aws_opentelemetry_distro`](https://github.com/aws-observability/aws-otel-python-instrumentation/blob/main/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_distro.py) and [`aws_opentelemetry_configurator`](https://github.com/aws-observability/aws-otel-python-instrumentation/blob/main/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_configurator.py)) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent c1398e1 commit a44f51e

File tree

9 files changed

+890
-17
lines changed

9 files changed

+890
-17
lines changed

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"prewatch": "npm run precompile",
3131
"prepublishOnly": "npm run compile",
3232
"tdd": "yarn test -- --watch-extensions ts --watch",
33-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.ts'",
33+
"test": "nyc ts-mocha --timeout 10000 -p tsconfig.json 'test/**/*.ts'",
3434
"watch": "tsc -w"
3535
},
3636
"bugs": {
@@ -46,15 +46,28 @@
4646
"sinon": "15.2.0",
4747
"ts-mocha": "10.0.0",
4848
"typescript": "4.4.4",
49-
"expect": "29.2.0"
49+
"expect": "29.2.0",
50+
"nock": "13.2.1"
5051
},
5152
"dependencies": {
5253
"@opentelemetry/api": "1.9.0",
5354
"@opentelemetry/auto-instrumentations-node": "0.48.0",
55+
"@opentelemetry/auto-configuration-propagators": "0.2.0",
5456
"@opentelemetry/exporter-metrics-otlp-grpc": "0.52.1",
5557
"@opentelemetry/exporter-metrics-otlp-http": "0.52.1",
58+
"@opentelemetry/instrumentation": "0.52.1",
5659
"@opentelemetry/id-generator-aws-xray": "1.2.2",
57-
"@opentelemetry/propagator-aws-xray": "1.25.1"
60+
"@opentelemetry/propagator-aws-xray": "1.25.1",
61+
"@opentelemetry/core": "1.25.1",
62+
"@opentelemetry/sdk-trace-base": "1.25.1",
63+
"@opentelemetry/semantic-conventions": "1.25.1",
64+
"@opentelemetry/resources": "1.25.1",
65+
"@opentelemetry/resource-detector-aws": "1.5.2",
66+
"@opentelemetry/exporter-trace-otlp-proto": "0.52.1",
67+
"@opentelemetry/exporter-zipkin": "1.25.1",
68+
"@opentelemetry/sdk-metrics": "1.25.1",
69+
"@opentelemetry/sdk-node": "0.52.1",
70+
"@opentelemetry/instrumentation-aws-sdk": "0.43.1"
5871
},
5972
"overrides": {
6073
"@opentelemetry/auto-instrumentations-node": {

aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts

Lines changed: 426 additions & 7 deletions
Large diffs are not rendered by default.

aws-distro-opentelemetry-node-autoinstrumentation/src/aws-span-processing-util.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ export class AwsSpanProcessingUtil {
115115
return false;
116116
}
117117

118+
// TODO:
119+
// Telemetry improvements:
120+
// - return false for dns instrumentation client spans
121+
// (suppress metrics for spans with name: `dns.lookup`)
122+
// - return false for mongoose instrumentation client spans in
123+
// favor of lower level mongodb instrumentation client spans
124+
// (suppress metrics for spans attribute 'db.system': 'mongoose')
125+
118126
return (
119127
SpanKind.CLIENT === span.kind ||
120128
SpanKind.PRODUCER === span.kind ||

aws-distro-opentelemetry-node-autoinstrumentation/src/register.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3+
// Modifications Copyright The OpenTelemetry Authors. Licensed under the Apache License 2.0 License.
34

45
import { DiagConsoleLogger, diag } from '@opentelemetry/api';
56
import * as opentelemetry from '@opentelemetry/sdk-node';
@@ -23,13 +24,21 @@ Also sets default OTEL_PROPAGATORS to ensure good compatibility with X-Ray and A
2324
This file may also be used to apply patches to upstream instrumentation - usually these are stopgap measures until we can contribute
2425
long-term changes to upstream.
2526
*/
26-
27-
if (!process.env.OTEL_EXPORTER_OTLP_PROTOCOL) {
28-
process.env.OTEL_EXPORTER_OTLP_PROTOCOL = 'http/protobuf';
29-
}
30-
if (!process.env.OTEL_PROPAGATORS) {
31-
process.env.OTEL_PROPAGATORS = 'xray,tracecontext,b3,b3multi';
27+
export function setAwsDefaultEnvironmentVariables(): void {
28+
if (!process.env.OTEL_EXPORTER_OTLP_PROTOCOL) {
29+
process.env.OTEL_EXPORTER_OTLP_PROTOCOL = 'http/protobuf';
30+
}
31+
if (!process.env.OTEL_PROPAGATORS) {
32+
process.env.OTEL_PROPAGATORS = 'xray,tracecontext,b3,b3multi';
33+
}
34+
// Disable `@opentelemetry/instrumentation-fs` instrumentation by default
35+
// This auto-instrumentation for the `fs` module would otherwise generate many low-value spans.
36+
// https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1344#issuecomment-1618993178
37+
if (!process.env.OTEL_NODE_DISABLED_INSTRUMENTATIONS) {
38+
process.env.OTEL_NODE_DISABLED_INSTRUMENTATIONS = 'fs';
39+
}
3240
}
41+
setAwsDefaultEnvironmentVariables();
3342

3443
const configurator: AwsOpentelemetryConfigurator = new AwsOpentelemetryConfigurator();
3544
const configuration: Partial<opentelemetry.NodeSDKConfiguration> = configurator.configure();
@@ -43,6 +52,8 @@ const sdk: opentelemetry.NodeSDK = new opentelemetry.NodeSDK(configuration);
4352
try {
4453
sdk.start();
4554
diag.info('AWS Distro of OpenTelemetry automatic instrumentation started successfully');
55+
diag.debug(`Environment variable OTEL_PROPAGATORS is set to '${process.env.OTEL_PROPAGATORS}'`);
56+
diag.debug(`Environment variable OTEL_EXPORTER_OTLP_PROTOCOL is set to '${process.env.OTEL_EXPORTER_OTLP_PROTOCOL}'`);
4657
} catch (error) {
4758
diag.error(
4859
'Error initializing AWS Distro of OpenTelemetry SDK. Your application is not instrumented and will not produce telemetry',
@@ -56,3 +67,5 @@ process.on('SIGTERM', () => {
5667
.then(() => diag.debug('AWS Distro of OpenTelemetry SDK terminated'))
5768
.catch(error => diag.error('Error terminating AWS Distro of OpenTelemetry SDK', error));
5869
});
70+
71+
// END The OpenTelemetry Authors code
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { Span, TraceFlags, Tracer } from '@opentelemetry/api';
5+
import { OTLPMetricExporter as OTLPGrpcOTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-grpc';
6+
import { OTLPMetricExporter as OTLPHttpOTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-http';
7+
import { Resource } from '@opentelemetry/resources';
8+
import { PushMetricExporter } from '@opentelemetry/sdk-metrics';
9+
import { ReadableSpan, SpanProcessor } from '@opentelemetry/sdk-trace-base';
10+
import {
11+
AlwaysOnSampler,
12+
NodeTracerProvider,
13+
ParentBasedSampler,
14+
Sampler,
15+
SpanExporter,
16+
} from '@opentelemetry/sdk-trace-node';
17+
import * as assert from 'assert';
18+
import expect from 'expect';
19+
import * as sinon from 'sinon';
20+
import { AlwaysRecordSampler } from '../src/always-record-sampler';
21+
import { AttributePropagatingSpanProcessor } from '../src/attribute-propagating-span-processor';
22+
import { AwsMetricAttributesSpanExporter } from '../src/aws-metric-attributes-span-exporter';
23+
import {
24+
ApplicationSignalsExporterProvider,
25+
AwsOpentelemetryConfigurator,
26+
AwsSpanProcessorProvider,
27+
customBuildSamplerFromEnv,
28+
} from '../src/aws-opentelemetry-configurator';
29+
import { AwsSpanMetricsProcessor } from '../src/aws-span-metrics-processor';
30+
import { setAwsDefaultEnvironmentVariables } from '../src/register';
31+
32+
// Tests AwsOpenTelemetryConfigurator after running Environment Variable setup in register.ts
33+
describe('AwsOpenTelemetryConfiguratorTest', () => {
34+
let awsOtelConfigurator: AwsOpentelemetryConfigurator;
35+
36+
// setUpClass
37+
before(() => {
38+
// Run environment setup in register.ts, then validate expected env values.
39+
setAwsDefaultEnvironmentVariables();
40+
validateConfiguratorEnviron();
41+
42+
// Overwrite exporter configs to keep tests clean, set sampler configs for tests
43+
process.env.OTEL_TRACES_EXPORTER = 'none';
44+
process.env.OTEL_METRICS_EXPORTER = 'none';
45+
process.env.OTEL_LOGS_EXPORTER = 'none';
46+
process.env.OTEL_TRACES_SAMPLER = 'traceidratio';
47+
process.env.OTEL_TRACES_SAMPLER_ARG = '0.01';
48+
49+
// Create configurator
50+
awsOtelConfigurator = new AwsOpentelemetryConfigurator();
51+
});
52+
53+
// The probability of this passing once without correct IDs is low, 20 times is inconceivable.
54+
it('ProvideGenerateXrayIdsTest', () => {
55+
const tracerProvider: NodeTracerProvider = new NodeTracerProvider(awsOtelConfigurator.configure());
56+
tracerProvider.addSpanProcessor(
57+
AttributePropagatingSpanProcessor.create((span: ReadableSpan) => '', 'spanNameKey', ['testKey1', 'testKey2'])
58+
);
59+
for (let _: number = 0; _ < 20; _++) {
60+
const tracer: Tracer = tracerProvider.getTracer('test');
61+
const startTimeSec: number = Math.floor(new Date().getTime() / 1000.0);
62+
const span: Span = tracer.startSpan('test');
63+
const traceId: string = span.spanContext().traceId;
64+
const traceId4ByteHex: string = traceId.substring(0, 8);
65+
const traceId4ByteNumber: number = Number(`0x${traceId4ByteHex}`);
66+
expect(traceId4ByteNumber).toBeGreaterThanOrEqual(startTimeSec);
67+
}
68+
});
69+
70+
// Sanity check that the trace ID ratio sampler works fine with the x-ray generator.
71+
it('TraceIdRatioSamplerTest', () => {
72+
process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED = 'True';
73+
const tracerProvider: NodeTracerProvider = new NodeTracerProvider(awsOtelConfigurator.configure());
74+
delete process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED;
75+
76+
tracerProvider.addSpanProcessor(
77+
AttributePropagatingSpanProcessor.create((span: ReadableSpan) => '', 'spanNameKey', ['testKey1', 'testKey2'])
78+
);
79+
for (let _: number = 0; _ < 20; _++) {
80+
const numSpans: number = 100000;
81+
let numSampled: number = 0;
82+
const tracer: Tracer = tracerProvider.getTracer('test');
83+
for (let __: number = 0; __ < numSpans; __++) {
84+
const span: Span = tracer.startSpan('test');
85+
if (span.spanContext().traceFlags & TraceFlags.SAMPLED) {
86+
numSampled += 1;
87+
}
88+
span.end();
89+
}
90+
// Configured for 1%, confirm there are at most 5% to account for randomness and reduce test flakiness.
91+
expect(0.05).toBeGreaterThan(numSampled / numSpans);
92+
}
93+
});
94+
95+
it('ImportDefaultSamplerWhenEnvVarIsNotSetTest', () => {
96+
delete process.env.OTEL_TRACES_SAMPLER;
97+
const defaultSampler: Sampler = customBuildSamplerFromEnv(Resource.empty());
98+
99+
expect(defaultSampler).not.toBeUndefined();
100+
expect(defaultSampler.toString()).toEqual(new ParentBasedSampler({ root: new AlwaysOnSampler() }).toString());
101+
});
102+
103+
it('IsApplicationSignalsEnabledTest', () => {
104+
process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED = 'True';
105+
expect(AwsOpentelemetryConfigurator.isApplicationSignalsEnabled()).toBeTruthy();
106+
delete process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED;
107+
108+
process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED = 'False';
109+
expect(AwsOpentelemetryConfigurator.isApplicationSignalsEnabled()).toBeFalsy();
110+
delete process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED;
111+
expect(AwsOpentelemetryConfigurator.isApplicationSignalsEnabled()).toBeFalsy();
112+
});
113+
114+
it('CustomizeSamplerTest', () => {
115+
const mockSampler: Sampler = sinon.createStubInstance(AlwaysOnSampler);
116+
let customizedSampler: Sampler = AwsOpentelemetryConfigurator.customizeSampler(mockSampler);
117+
expect(mockSampler).toEqual(customizedSampler);
118+
119+
process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED = 'True';
120+
customizedSampler = AwsOpentelemetryConfigurator.customizeSampler(mockSampler);
121+
expect(mockSampler).not.toEqual(customizedSampler);
122+
expect(customizedSampler).toBeInstanceOf(AlwaysRecordSampler);
123+
expect(mockSampler).toEqual((customizedSampler as any).rootSampler);
124+
delete process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED;
125+
});
126+
127+
it('CustomizeExporterTest', () => {
128+
const mockExporter: SpanExporter = sinon.createStubInstance(AwsMetricAttributesSpanExporter);
129+
let customizedExporter: SpanExporter = AwsSpanProcessorProvider.customizeSpanExporter(
130+
mockExporter,
131+
Resource.empty()
132+
);
133+
expect(mockExporter).toEqual(customizedExporter);
134+
135+
process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED = 'True';
136+
customizedExporter = AwsSpanProcessorProvider.customizeSpanExporter(mockExporter, Resource.empty());
137+
expect(mockExporter).not.toEqual(customizedExporter);
138+
expect(customizedExporter).toBeInstanceOf(AwsMetricAttributesSpanExporter);
139+
expect(mockExporter).toEqual((customizedExporter as any).delegate);
140+
delete process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED;
141+
});
142+
143+
it('CustomizeSpanProcessorsTest', () => {
144+
delete process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED;
145+
const spanProcessors: SpanProcessor[] = [];
146+
AwsOpentelemetryConfigurator.customizeSpanProcessors(spanProcessors, Resource.empty());
147+
expect(spanProcessors.length).toEqual(0);
148+
149+
process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED = 'True';
150+
AwsOpentelemetryConfigurator.customizeSpanProcessors(spanProcessors, Resource.empty());
151+
expect(spanProcessors.length).toEqual(2);
152+
const firstProcessor: SpanProcessor = spanProcessors[0];
153+
expect(firstProcessor).toBeInstanceOf(AttributePropagatingSpanProcessor);
154+
const secondProcessor: SpanProcessor = spanProcessors[1];
155+
expect(secondProcessor).toBeInstanceOf(AwsSpanMetricsProcessor);
156+
delete process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED;
157+
158+
try {
159+
process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED = 'True';
160+
process.env.OTEL_METRIC_EXPORT_INTERVAL = undefined;
161+
AwsOpentelemetryConfigurator.customizeSpanProcessors(spanProcessors, Resource.empty());
162+
process.env.OTEL_METRIC_EXPORT_INTERVAL = '123abc';
163+
AwsOpentelemetryConfigurator.customizeSpanProcessors(spanProcessors, Resource.empty());
164+
process.env.OTEL_METRIC_EXPORT_INTERVAL = '!@#$%^&*()';
165+
AwsOpentelemetryConfigurator.customizeSpanProcessors(spanProcessors, Resource.empty());
166+
process.env.OTEL_METRIC_EXPORT_INTERVAL = '123';
167+
AwsOpentelemetryConfigurator.customizeSpanProcessors(spanProcessors, Resource.empty());
168+
} catch (e: any) {
169+
assert.fail(`AwsOpentelemetryConfigurator.customizeSpanProcessors() has incorrectly thrown error: ${e}`);
170+
} finally {
171+
delete process.env.OTEL_AWS_APPLICATION_SIGNALS_ENABLED;
172+
}
173+
});
174+
175+
it('ApplicationSignalsExporterProviderTest', () => {
176+
// Check default protocol - HTTP, as specified by aws-distro-opentelemetry-node-autoinstrumentation's register.ts.
177+
let exporter: PushMetricExporter = ApplicationSignalsExporterProvider.Instance.createExporter();
178+
expect(exporter).toBeInstanceOf(OTLPHttpOTLPMetricExporter);
179+
expect('http://localhost:4316/v1/metrics').toEqual((exporter as any)._otlpExporter.url);
180+
181+
// Overwrite protocol to gRPC.
182+
process.env.OTEL_EXPORTER_OTLP_PROTOCOL = 'grpc';
183+
exporter = ApplicationSignalsExporterProvider.Instance.createExporter();
184+
expect(exporter).toBeInstanceOf(OTLPGrpcOTLPMetricExporter);
185+
expect('localhost:4315').toEqual((exporter as any)._otlpExporter.url);
186+
187+
// Overwrite protocol back to HTTP.
188+
process.env.OTEL_EXPORTER_OTLP_PROTOCOL = 'http/protobuf';
189+
exporter = ApplicationSignalsExporterProvider.Instance.createExporter();
190+
expect(exporter).toBeInstanceOf(OTLPHttpOTLPMetricExporter);
191+
expect('http://localhost:4316/v1/metrics').toEqual((exporter as any)._otlpExporter.url);
192+
});
193+
194+
function validateConfiguratorEnviron() {
195+
// Set by register.ts
196+
expect('http/protobuf').toEqual(process.env.OTEL_EXPORTER_OTLP_PROTOCOL);
197+
expect('xray,tracecontext,b3,b3multi').toEqual(process.env.OTEL_PROPAGATORS);
198+
199+
// Not set
200+
expect(undefined).toEqual(process.env.OTEL_TRACES_SAMPLER);
201+
expect(undefined).toEqual(process.env.OTEL_TRACES_SAMPLER_ARG);
202+
expect(undefined).toEqual(process.env.OTEL_TRACES_EXPORTER);
203+
expect(undefined).toEqual(process.env.OTEL_METRICS_EXPORTER);
204+
}
205+
});
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
// Modifications Copyright The OpenTelemetry Authors. Licensed under the Apache License 2.0 License.
4+
5+
import * as assert from 'assert';
6+
import { spawnSync, SpawnSyncReturns } from 'child_process';
7+
8+
// The OpenTelemetry Authors code
9+
// Extend register.test.ts functionality to also test exported span with Application Signals enabled
10+
describe('Register', function () {
11+
it('can load auto instrumentation from command line', () => {
12+
const proc: SpawnSyncReturns<Buffer> = spawnSync(
13+
process.execPath,
14+
['--require', '../build/src/register.js', './third-party/otel/test-app/app.js'],
15+
{
16+
cwd: __dirname,
17+
timeout: 10000,
18+
killSignal: 'SIGKILL', // SIGTERM is not sufficient to terminate some hangs
19+
env: Object.assign({}, process.env, {
20+
OTEL_NODE_RESOURCE_DETECTORS: 'none',
21+
OTEL_TRACES_EXPORTER: 'console',
22+
// nx (used by lerna run) defaults `FORCE_COLOR=true`, which in
23+
// node v18.17.0, v20.3.0 and later results in ANSI color escapes
24+
// in the ConsoleSpanExporter output that is checked below.
25+
FORCE_COLOR: '0',
26+
27+
OTEL_LOG_LEVEL: 'ALL',
28+
OTEL_TRACES_SAMPLER: 'always_on',
29+
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: 'http://localhost:4316/v1/traces',
30+
OTEL_RESOURCE_ATTRIBUTES: 'service.name=test-adot-sdk-ec2-service-name',
31+
OTEL_AWS_APPLICATION_SIGNALS_ENABLED: 'true',
32+
OTEL_NODE_DISABLED_INSTRUMENTATIONS: 'fs',
33+
}),
34+
}
35+
);
36+
assert.ifError(proc.error);
37+
assert.equal(proc.status, 0, `proc.status (${proc.status})`);
38+
assert.equal(proc.signal, null, `proc.signal (${proc.signal})`);
39+
40+
assert.ok(proc.stdout.includes('AWS Distro of OpenTelemetry automatic instrumentation started successfully'));
41+
assert.ok(proc.stdout.includes("Environment variable OTEL_EXPORTER_OTLP_PROTOCOL is set to 'http/protobuf'"));
42+
assert.ok(proc.stdout.includes("Environment variable OTEL_PROPAGATORS is set to 'xray,tracecontext,b3,b3multi'"));
43+
44+
// Check a span has been generated for the GET request done in app.js
45+
assert.ok(proc.stdout.includes("name: 'GET'"), 'console span output in stdout - validate Span Name');
46+
assert.ok(
47+
proc.stdout.includes("'service.name': 'test-adot-sdk-ec2-service-name'"),
48+
'console span output in stdout - validate service.name'
49+
);
50+
51+
// eslint-disable-next-line @typescript-eslint/typedef
52+
const packageJson = require('./../../package.json');
53+
const DISTRO_VERSION: string = packageJson.version;
54+
assert.ok(
55+
proc.stdout.includes(`'telemetry.auto.version': '${DISTRO_VERSION}-aws'`),
56+
'console span output in stdout - validate telemetry.auto.version'
57+
);
58+
assert.ok(
59+
proc.stdout.includes("'aws.is.local.root': true"),
60+
'console span output in stdout - validate aws.is.local.root'
61+
);
62+
assert.ok(
63+
proc.stdout.includes("'aws.local.operation': 'InternalOperation'"),
64+
'console span output in stdout - validate aws.local.operation'
65+
);
66+
assert.ok(
67+
proc.stdout.includes("'aws.local.service': 'test-adot-sdk-ec2-service-name'"),
68+
'console span output in stdout - validate aws.local.service'
69+
);
70+
assert.ok(
71+
proc.stdout.includes("'aws.remote.service': 'example.com:80'"),
72+
'console span output in stdout - validate aws.remote.service'
73+
);
74+
assert.ok(
75+
proc.stdout.includes("'aws.remote.operation': 'GET /'"),
76+
'console span output in stdout - validate aws.remote.operation'
77+
);
78+
assert.ok(
79+
proc.stdout.includes("'aws.span.kind': 'LOCAL_ROOT'"),
80+
'console span output in stdout - validate aws.span.kind'
81+
);
82+
});
83+
});

0 commit comments

Comments
 (0)