Skip to content

Commit 84e9c3c

Browse files
committed
remove unused file
1 parent 5470bf5 commit 84e9c3c

File tree

4 files changed

+31
-26
lines changed

4 files changed

+31
-26
lines changed

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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ 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';
4546
// Patch until the OpenTelemetry SDK is updated to ship this attribute
46-
import { SemanticResourceAttributes as AdditionalSemanticResourceAttributes } from '../../src/detectors/SemanticResourceAttributes';
4747
import { readFileSync } from 'fs';
4848
import * as os from 'os';
4949
import { join } from 'path';
@@ -93,7 +93,7 @@ const assertEcsResource = (
9393
validations.containerArn
9494
);
9595
assert.strictEqual(
96-
resource.attributes[AdditionalSemanticResourceAttributes.CLOUD_RESOURCE_ID],
96+
resource.attributes[ATTR_CLOUD_RESOURCE_ID],
9797
validations.containerArn
9898
);
9999
assert.strictEqual(

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import {
4343
CLOUD_PROVIDER_VALUE_AWS,
4444
} from '../../src/semconv';
4545
// 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';

0 commit comments

Comments
 (0)