Skip to content

Commit 143ccfb

Browse files
committed
remove unused file
1 parent 5470bf5 commit 143ccfb

File tree

5 files changed

+46
-43
lines changed

5 files changed

+46
-43
lines changed

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

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,27 @@ import {
2323
ResourceAttributes,
2424
} from '@opentelemetry/resources';
2525
import {
26-
ATTR_CLOUD_PROVIDER,
27-
ATTR_CLOUD_PLATFORM,
28-
ATTR_CONTAINER_ID,
29-
ATTR_CONTAINER_NAME,
30-
ATTR_AWS_ECS_CONTAINER_ARN,
3126
ATTR_AWS_ECS_CLUSTER_ARN,
27+
ATTR_AWS_ECS_CONTAINER_ARN,
3228
ATTR_AWS_ECS_LAUNCHTYPE,
3329
ATTR_AWS_ECS_TASK_ARN,
3430
ATTR_AWS_ECS_TASK_FAMILY,
3531
ATTR_AWS_ECS_TASK_REVISION,
36-
ATTR_CLOUD_ACCOUNT_ID,
37-
ATTR_CLOUD_REGION,
38-
ATTR_CLOUD_AVAILABILITY_ZONE,
39-
ATTR_AWS_LOG_GROUP_NAMES,
4032
ATTR_AWS_LOG_GROUP_ARNS,
41-
ATTR_AWS_LOG_STREAM_NAMES,
33+
ATTR_AWS_LOG_GROUP_NAMES,
4234
ATTR_AWS_LOG_STREAM_ARNS,
43-
CLOUD_PROVIDER_VALUE_AWS,
35+
ATTR_AWS_LOG_STREAM_NAMES,
36+
ATTR_CLOUD_ACCOUNT_ID,
37+
ATTR_CLOUD_AVAILABILITY_ZONE,
38+
ATTR_CLOUD_PLATFORM,
39+
ATTR_CLOUD_PROVIDER,
40+
ATTR_CLOUD_REGION,
41+
ATTR_CLOUD_RESOURCE_ID,
42+
ATTR_CONTAINER_ID,
43+
ATTR_CONTAINER_NAME,
4444
CLOUD_PLATFORM_VALUE_AWS_ECS,
45+
CLOUD_PROVIDER_VALUE_AWS,
4546
} from '../semconv';
46-
// Patch until the OpenTelemetry SDK is updated to ship this attribute
47-
import { SemanticResourceAttributes as AdditionalSemanticResourceAttributes } from './SemanticResourceAttributes';
4847
import * as http from 'http';
4948
import * as util from 'util';
5049
import * as fs from 'fs';
@@ -185,7 +184,7 @@ export class AwsEcsDetectorSync implements DetectorSync {
185184

186185
[ATTR_CLOUD_ACCOUNT_ID]: accountId,
187186
[ATTR_CLOUD_REGION]: region,
188-
[AdditionalSemanticResourceAttributes.CLOUD_RESOURCE_ID]: containerArn,
187+
[ATTR_CLOUD_RESOURCE_ID]: containerArn,
189188
};
190189

191190
// The availability zone is not available in all Fargate runtimes

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

Lines changed: 0 additions & 23 deletions
This file was deleted.

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,35 @@ export const ATTR_CLOUD_PROVIDER = 'cloud.provider';
165165
*/
166166
export const ATTR_CLOUD_REGION = 'cloud.region';
167167

168+
/**
169+
* Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP)
170+
*
171+
* @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function
172+
* @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID
173+
* @example /subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>
174+
*
175+
* @note On some cloud providers, it may not be possible to determine the full ID at startup,
176+
* so it may be necessary to set `cloud.resource_id` as a span attribute instead.
177+
*
178+
* The exact value to use for `cloud.resource_id` depends on the cloud provider.
179+
* The following well-known definitions **MUST** be used if you set this attribute and they apply:
180+
*
181+
* - **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
182+
* Take care not to use the "invoked ARN" directly but replace any
183+
* [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
184+
* with the resolved function version, as the same runtime instance may be invocable with
185+
* multiple different aliases.
186+
* - **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
187+
* - **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function,
188+
* *not* the function app, having the form
189+
* `/subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`.
190+
* This means that a span attribute **MUST** be used, as an Azure function app can host multiple functions that would usually share
191+
* a TracerProvider.
192+
*
193+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
194+
*/
195+
export const ATTR_CLOUD_RESOURCE_ID = 'cloud.resource_id';
196+
168197
/**
169198
* Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated.
170199
*

detectors/node/opentelemetry-resource-detector-aws/test/detectors/AwsEcsDetector.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ import {
3939
ATTR_CLOUD_PLATFORM,
4040
ATTR_CLOUD_PROVIDER,
4141
ATTR_CLOUD_REGION,
42+
ATTR_CLOUD_RESOURCE_ID,
4243
CLOUD_PLATFORM_VALUE_AWS_ECS,
4344
CLOUD_PROVIDER_VALUE_AWS,
4445
} from '../../src/semconv';
45-
// Patch until the OpenTelemetry SDK is updated to ship this attribute
46-
import { SemanticResourceAttributes as AdditionalSemanticResourceAttributes } from '../../src/detectors/SemanticResourceAttributes';
4746
import { readFileSync } from 'fs';
4847
import * as os from 'os';
4948
import { join } from 'path';
@@ -93,7 +92,7 @@ const assertEcsResource = (
9392
validations.containerArn
9493
);
9594
assert.strictEqual(
96-
resource.attributes[AdditionalSemanticResourceAttributes.CLOUD_RESOURCE_ID],
95+
resource.attributes[ATTR_CLOUD_RESOURCE_ID],
9796
validations.containerArn
9897
);
9998
assert.strictEqual(

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ import {
3939
ATTR_CLOUD_PLATFORM,
4040
ATTR_CLOUD_PROVIDER,
4141
ATTR_CLOUD_REGION,
42+
ATTR_CLOUD_RESOURCE_ID,
4243
CLOUD_PLATFORM_VALUE_AWS_ECS,
4344
CLOUD_PROVIDER_VALUE_AWS,
4445
} from '../../src/semconv';
45-
// Patch until the OpenTelemetry SDK is updated to ship this attribute
46-
import { SemanticResourceAttributes as AdditionalSemanticResourceAttributes } from '../../src/detectors/SemanticResourceAttributes';
4746
import { readFileSync } from 'fs';
4847
import * as os from 'os';
4948
import { join } from 'path';
@@ -93,7 +92,7 @@ const assertEcsResource = (
9392
validations.containerArn
9493
);
9594
assert.strictEqual(
96-
resource.attributes[AdditionalSemanticResourceAttributes.CLOUD_RESOURCE_ID],
95+
resource.attributes[ATTR_CLOUD_RESOURCE_ID],
9796
validations.containerArn
9897
);
9998
assert.strictEqual(

0 commit comments

Comments
 (0)