Skip to content

Commit f3bdacf

Browse files
committed
fix(detector-aws): remove semconv incubating import
1 parent 4cf7e6f commit f3bdacf

File tree

7 files changed

+79
-6
lines changed

7 files changed

+79
-6
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* Following OpenTelemetry semantic conventions best practices, we copy the incubating
19+
* semantic conventions into our codebase rather than importing them directly.
20+
* This prevents breaking changes in minor versions and reduces disk usage from multiple versions.
21+
* @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
22+
*/
23+
24+
// AWS attributes
25+
export const ATTR_AWS_ECS_CLUSTER_ARN = 'aws.ecs.cluster.arn';
26+
export const ATTR_AWS_ECS_CONTAINER_ARN = 'aws.ecs.container.arn';
27+
export const ATTR_AWS_ECS_LAUNCHTYPE = 'aws.ecs.launchtype';
28+
export const ATTR_AWS_ECS_TASK_ARN = 'aws.ecs.task.arn';
29+
export const ATTR_AWS_ECS_TASK_FAMILY = 'aws.ecs.task.family';
30+
export const ATTR_AWS_ECS_TASK_REVISION = 'aws.ecs.task.revision';
31+
export const ATTR_AWS_LOG_GROUP_ARNS = 'aws.log.group.arns';
32+
export const ATTR_AWS_LOG_GROUP_NAMES = 'aws.log.group.names';
33+
export const ATTR_AWS_LOG_STREAM_ARNS = 'aws.log.stream.arns';
34+
export const ATTR_AWS_LOG_STREAM_NAMES = 'aws.log.stream.names';
35+
36+
// Cloud attributes
37+
export const ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id';
38+
export const ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability.zone';
39+
export const ATTR_CLOUD_PLATFORM = 'cloud.platform';
40+
export const ATTR_CLOUD_PROVIDER = 'cloud.provider';
41+
export const ATTR_CLOUD_REGION = 'cloud.region';
42+
43+
// Container attributes
44+
export const ATTR_CONTAINER_ID = 'container.id';
45+
export const ATTR_CONTAINER_NAME = 'container.name';
46+
47+
// FaaS attributes
48+
export const ATTR_FAAS_NAME = 'faas.name';
49+
export const ATTR_FAAS_VERSION = 'faas.version';
50+
51+
// Host attributes
52+
export const ATTR_HOST_ID = 'host.id';
53+
export const ATTR_HOST_NAME = 'host.name';
54+
export const ATTR_HOST_TYPE = 'host.type';
55+
56+
// Kubernetes attributes
57+
export const ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name';
58+
59+
// Service attributes
60+
export const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id';
61+
export const ATTR_SERVICE_NAME = 'service.name';
62+
export const ATTR_SERVICE_NAMESPACE = 'service.namespace';
63+
export const ATTR_SERVICE_VERSION = 'service.version';
64+
65+
// Cloud provider/platform values
66+
export const CLOUD_PROVIDER_VALUE_AWS = 'aws';
67+
export const CLOUD_PLATFORM_VALUE_AWS_EC2 = 'aws_ec2';
68+
export const CLOUD_PLATFORM_VALUE_AWS_ECS = 'aws_ecs';
69+
export const CLOUD_PLATFORM_VALUE_AWS_EKS = 'aws_eks';
70+
export const CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK =
71+
'aws_elastic_beanstalk';
72+
export const CLOUD_PLATFORM_VALUE_AWS_LAMBDA = 'aws_lambda';

detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsBeanstalkDetectorSync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
ATTR_SERVICE_INSTANCE_ID,
3434
CLOUD_PROVIDER_VALUE_AWS,
3535
CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK,
36-
} from '@opentelemetry/semantic-conventions/incubating';
36+
} from '../../lib/semconv';
3737
import * as fs from 'fs';
3838
import * as util from 'util';
3939

detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEc2DetectorSync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
ATTR_HOST_NAME,
3535
CLOUD_PROVIDER_VALUE_AWS,
3636
CLOUD_PLATFORM_VALUE_AWS_EC2,
37-
} from '@opentelemetry/semantic-conventions/incubating';
37+
} from '../../lib/semconv';
3838
import * as http from 'http';
3939

4040
/**

detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetectorSync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {
4242
ATTR_AWS_LOG_STREAM_ARNS,
4343
CLOUD_PROVIDER_VALUE_AWS,
4444
CLOUD_PLATFORM_VALUE_AWS_ECS,
45-
} from '@opentelemetry/semantic-conventions/incubating';
45+
} from '../../lib/semconv';
4646
// Patch until the OpenTelemetry SDK is updated to ship this attribute
4747
import { SemanticResourceAttributes as AdditionalSemanticResourceAttributes } from './SemanticResourceAttributes';
4848
import * as http from 'http';

detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
ATTR_CONTAINER_ID,
3131
CLOUD_PROVIDER_VALUE_AWS,
3232
CLOUD_PLATFORM_VALUE_AWS_EKS,
33-
} from '@opentelemetry/semantic-conventions/incubating';
33+
} from '../../lib/semconv';
3434
import * as https from 'https';
3535
import * as fs from 'fs';
3636
import * as util from 'util';

detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsLambdaDetectorSync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
ATTR_FAAS_NAME,
3030
CLOUD_PROVIDER_VALUE_AWS,
3131
CLOUD_PLATFORM_VALUE_AWS_LAMBDA,
32-
} from '@opentelemetry/semantic-conventions/incubating';
32+
} from '../../lib/semconv';
3333

3434
/**
3535
* The AwsLambdaDetector can be used to detect if a process is running in AWS Lambda

detectors/node/opentelemetry-resource-detector-aws/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
},
77
"include": [
88
"src/**/*.ts",
9-
"test/**/*.ts"
9+
"test/**/*.ts",
10+
"lib/**/*.ts"
1011
]
1112
}

0 commit comments

Comments
 (0)