@opentelemetry/resource-detector-aws
Advanced tools
Comparing version
@@ -55,5 +55,3 @@ /* | ||
import { Resource, } from '@opentelemetry/resources'; | ||
import { ATTR_CLOUD_PROVIDER, ATTR_CLOUD_PLATFORM, ATTR_CONTAINER_ID, ATTR_CONTAINER_NAME, ATTR_AWS_ECS_CONTAINER_ARN, ATTR_AWS_ECS_CLUSTER_ARN, ATTR_AWS_ECS_LAUNCHTYPE, ATTR_AWS_ECS_TASK_ARN, ATTR_AWS_ECS_TASK_FAMILY, ATTR_AWS_ECS_TASK_REVISION, ATTR_CLOUD_ACCOUNT_ID, ATTR_CLOUD_REGION, ATTR_CLOUD_AVAILABILITY_ZONE, ATTR_AWS_LOG_GROUP_NAMES, ATTR_AWS_LOG_GROUP_ARNS, ATTR_AWS_LOG_STREAM_NAMES, ATTR_AWS_LOG_STREAM_ARNS, CLOUD_PROVIDER_VALUE_AWS, CLOUD_PLATFORM_VALUE_AWS_ECS, } from '../semconv'; | ||
// Patch until the OpenTelemetry SDK is updated to ship this attribute | ||
import { SemanticResourceAttributes as AdditionalSemanticResourceAttributes } from './SemanticResourceAttributes'; | ||
import { ATTR_AWS_ECS_CLUSTER_ARN, ATTR_AWS_ECS_CONTAINER_ARN, ATTR_AWS_ECS_LAUNCHTYPE, ATTR_AWS_ECS_TASK_ARN, ATTR_AWS_ECS_TASK_FAMILY, ATTR_AWS_ECS_TASK_REVISION, ATTR_AWS_LOG_GROUP_ARNS, ATTR_AWS_LOG_GROUP_NAMES, ATTR_AWS_LOG_STREAM_ARNS, ATTR_AWS_LOG_STREAM_NAMES, ATTR_CLOUD_ACCOUNT_ID, ATTR_CLOUD_AVAILABILITY_ZONE, ATTR_CLOUD_PLATFORM, ATTR_CLOUD_PROVIDER, ATTR_CLOUD_REGION, ATTR_CLOUD_RESOURCE_ID, ATTR_CONTAINER_ID, ATTR_CONTAINER_NAME, CLOUD_PROVIDER_VALUE_AWS, CLOUD_PLATFORM_VALUE_AWS_ECS, } from '../semconv'; | ||
import * as http from 'http'; | ||
@@ -63,3 +61,2 @@ import * as util from 'util'; | ||
import * as os from 'os'; | ||
import { getEnv } from '@opentelemetry/core'; | ||
var HTTP_TIMEOUT_IN_MS = 1000; | ||
@@ -83,3 +80,3 @@ /** | ||
return __awaiter(this, void 0, void 0, function () { | ||
var env, resource, _a, _b, metadataUrl, _c, containerMetadata, taskMetadata, metadatav4Resource, logsResource, _d; | ||
var resource, _a, _b, metadataUrl, _c, containerMetadata, taskMetadata, metadatav4Resource, logsResource, _d; | ||
var _e; | ||
@@ -89,4 +86,4 @@ return __generator(this, function (_f) { | ||
case 0: | ||
env = getEnv(); | ||
if (!env.ECS_CONTAINER_METADATA_URI_V4 && !env.ECS_CONTAINER_METADATA_URI) { | ||
if (!process.env.ECS_CONTAINER_METADATA_URI_V4 && | ||
!process.env.ECS_CONTAINER_METADATA_URI) { | ||
diag.debug('AwsEcsDetector failed: Process is not on ECS'); | ||
@@ -105,3 +102,3 @@ return [2 /*return*/, {}]; | ||
resource = _b.apply(_a, [_f.sent()]); | ||
metadataUrl = getEnv().ECS_CONTAINER_METADATA_URI_V4; | ||
metadataUrl = process.env.ECS_CONTAINER_METADATA_URI_V4; | ||
if (!metadataUrl) return [3 /*break*/, 6]; | ||
@@ -203,3 +200,3 @@ return [4 /*yield*/, Promise.all([ | ||
_a[ATTR_CLOUD_REGION] = region, | ||
_a[AdditionalSemanticResourceAttributes.CLOUD_RESOURCE_ID] = containerArn, | ||
_a[ATTR_CLOUD_RESOURCE_ID] = containerArn, | ||
_a); | ||
@@ -206,0 +203,0 @@ // The availability zone is not available in all Fargate runtimes |
@@ -17,3 +17,3 @@ /* | ||
import { Resource, } from '@opentelemetry/resources'; | ||
import { ATTR_CLOUD_PROVIDER, ATTR_CLOUD_PLATFORM, ATTR_CLOUD_REGION, ATTR_FAAS_VERSION, ATTR_FAAS_NAME, CLOUD_PROVIDER_VALUE_AWS, CLOUD_PLATFORM_VALUE_AWS_LAMBDA, } from '../semconv'; | ||
import { ATTR_AWS_LOG_GROUP_NAMES, ATTR_CLOUD_PLATFORM, ATTR_CLOUD_PROVIDER, ATTR_CLOUD_REGION, ATTR_FAAS_INSTANCE, ATTR_FAAS_NAME, ATTR_FAAS_MAX_MEMORY, ATTR_FAAS_VERSION, CLOUD_PROVIDER_VALUE_AWS, CLOUD_PLATFORM_VALUE_AWS_LAMBDA, } from '../semconv'; | ||
/** | ||
@@ -29,21 +29,30 @@ * The AwsLambdaDetector can be used to detect if a process is running in AWS Lambda | ||
var _a; | ||
var functionName = process.env.AWS_LAMBDA_FUNCTION_NAME; | ||
if (!functionName) { | ||
// Check if running inside AWS Lambda environment | ||
var executionEnv = process.env.AWS_EXECUTION_ENV; | ||
if (!(executionEnv === null || executionEnv === void 0 ? void 0 : executionEnv.startsWith('AWS_Lambda_'))) { | ||
return Resource.empty(); | ||
} | ||
// These environment variables are guaranteed to be present in Lambda environment | ||
// https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime | ||
var region = process.env.AWS_REGION; | ||
var functionName = process.env.AWS_LAMBDA_FUNCTION_NAME; | ||
var functionVersion = process.env.AWS_LAMBDA_FUNCTION_VERSION; | ||
var region = process.env.AWS_REGION; | ||
var memorySize = process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE; | ||
// These environment variables are not available in Lambda SnapStart functions | ||
var logGroupName = process.env.AWS_LAMBDA_LOG_GROUP_NAME; | ||
var logStreamName = process.env.AWS_LAMBDA_LOG_STREAM_NAME; | ||
var attributes = (_a = {}, | ||
_a[ATTR_CLOUD_PROVIDER] = String(CLOUD_PROVIDER_VALUE_AWS), | ||
_a[ATTR_CLOUD_PLATFORM] = String(CLOUD_PLATFORM_VALUE_AWS_LAMBDA), | ||
_a[ATTR_CLOUD_PROVIDER] = CLOUD_PROVIDER_VALUE_AWS, | ||
_a[ATTR_CLOUD_PLATFORM] = CLOUD_PLATFORM_VALUE_AWS_LAMBDA, | ||
_a[ATTR_CLOUD_REGION] = region, | ||
_a[ATTR_FAAS_NAME] = functionName, | ||
_a[ATTR_FAAS_VERSION] = functionVersion, | ||
_a[ATTR_FAAS_MAX_MEMORY] = parseInt(memorySize) * 1024 * 1024, | ||
_a); | ||
if (region) { | ||
attributes[ATTR_CLOUD_REGION] = region; | ||
if (logGroupName) { | ||
attributes[ATTR_AWS_LOG_GROUP_NAMES] = [logGroupName]; | ||
} | ||
if (functionName) { | ||
attributes[ATTR_FAAS_NAME] = functionName; | ||
if (logStreamName) { | ||
attributes[ATTR_FAAS_INSTANCE] = logStreamName; | ||
} | ||
if (functionVersion) { | ||
attributes[ATTR_FAAS_VERSION] = functionVersion; | ||
} | ||
return new Resource(attributes); | ||
@@ -50,0 +59,0 @@ }; |
@@ -132,2 +132,30 @@ /** | ||
/** | ||
* 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) | ||
* | ||
* @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function | ||
* @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID | ||
* @example /subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC> | ||
* | ||
* @note On some cloud providers, it may not be possible to determine the full ID at startup, | ||
* so it may be necessary to set `cloud.resource_id` as a span attribute instead. | ||
* | ||
* The exact value to use for `cloud.resource_id` depends on the cloud provider. | ||
* The following well-known definitions **MUST** be used if you set this attribute and they apply: | ||
* | ||
* - **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). | ||
* Take care not to use the "invoked ARN" directly but replace any | ||
* [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) | ||
* with the resolved function version, as the same runtime instance may be invocable with | ||
* multiple different aliases. | ||
* - **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) | ||
* - **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, | ||
* *not* the function app, having the form | ||
* `/subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`. | ||
* This means that a span attribute **MUST** be used, as an Azure function app can host multiple functions that would usually share | ||
* a TracerProvider. | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
export declare const ATTR_CLOUD_RESOURCE_ID = "cloud.resource_id"; | ||
/** | ||
* 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. | ||
@@ -175,2 +203,22 @@ * | ||
/** | ||
* The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. | ||
* | ||
* @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de | ||
* | ||
* @note * **AWS Lambda:** Use the (full) log stream name. | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
export declare const ATTR_FAAS_INSTANCE = "faas.instance"; | ||
/** | ||
* The amount of memory available to the serverless function converted to Bytes. | ||
* | ||
* @example 134217728 | ||
* | ||
* @note It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
export declare const ATTR_FAAS_MAX_MEMORY = "faas.max_memory"; | ||
/** | ||
* The immutable version of the function being executed. | ||
@@ -177,0 +225,0 @@ * |
@@ -152,2 +152,30 @@ /* | ||
/** | ||
* 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) | ||
* | ||
* @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function | ||
* @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID | ||
* @example /subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC> | ||
* | ||
* @note On some cloud providers, it may not be possible to determine the full ID at startup, | ||
* so it may be necessary to set `cloud.resource_id` as a span attribute instead. | ||
* | ||
* The exact value to use for `cloud.resource_id` depends on the cloud provider. | ||
* The following well-known definitions **MUST** be used if you set this attribute and they apply: | ||
* | ||
* - **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). | ||
* Take care not to use the "invoked ARN" directly but replace any | ||
* [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) | ||
* with the resolved function version, as the same runtime instance may be invocable with | ||
* multiple different aliases. | ||
* - **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) | ||
* - **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, | ||
* *not* the function app, having the form | ||
* `/subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`. | ||
* This means that a span attribute **MUST** be used, as an Azure function app can host multiple functions that would usually share | ||
* a TracerProvider. | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
export var ATTR_CLOUD_RESOURCE_ID = 'cloud.resource_id'; | ||
/** | ||
* 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. | ||
@@ -195,2 +223,22 @@ * | ||
/** | ||
* The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. | ||
* | ||
* @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de | ||
* | ||
* @note * **AWS Lambda:** Use the (full) log stream name. | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
export var ATTR_FAAS_INSTANCE = 'faas.instance'; | ||
/** | ||
* The amount of memory available to the serverless function converted to Bytes. | ||
* | ||
* @example 134217728 | ||
* | ||
* @note It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
export var ATTR_FAAS_MAX_MEMORY = 'faas.max_memory'; | ||
/** | ||
* The immutable version of the function being executed. | ||
@@ -197,0 +245,0 @@ * |
@@ -23,4 +23,2 @@ "use strict"; | ||
const semconv_1 = require("../semconv"); | ||
// Patch until the OpenTelemetry SDK is updated to ship this attribute | ||
const SemanticResourceAttributes_1 = require("./SemanticResourceAttributes"); | ||
const http = require("http"); | ||
@@ -30,3 +28,2 @@ const util = require("util"); | ||
const os = require("os"); | ||
const core_2 = require("@opentelemetry/core"); | ||
const HTTP_TIMEOUT_IN_MS = 1000; | ||
@@ -44,4 +41,4 @@ /** | ||
async _getAttributes() { | ||
const env = (0, core_2.getEnv)(); | ||
if (!env.ECS_CONTAINER_METADATA_URI_V4 && !env.ECS_CONTAINER_METADATA_URI) { | ||
if (!process.env.ECS_CONTAINER_METADATA_URI_V4 && | ||
!process.env.ECS_CONTAINER_METADATA_URI) { | ||
api_1.diag.debug('AwsEcsDetector failed: Process is not on ECS'); | ||
@@ -55,3 +52,3 @@ return {}; | ||
}).merge(await AwsEcsDetectorSync._getContainerIdAndHostnameResource()); | ||
const metadataUrl = (0, core_2.getEnv)().ECS_CONTAINER_METADATA_URI_V4; | ||
const metadataUrl = process.env.ECS_CONTAINER_METADATA_URI_V4; | ||
if (metadataUrl) { | ||
@@ -125,3 +122,3 @@ const [containerMetadata, taskMetadata] = await Promise.all([ | ||
[semconv_1.ATTR_CLOUD_REGION]: region, | ||
[SemanticResourceAttributes_1.SemanticResourceAttributes.CLOUD_RESOURCE_ID]: containerArn, | ||
[semconv_1.ATTR_CLOUD_RESOURCE_ID]: containerArn, | ||
}; | ||
@@ -128,0 +125,0 @@ // The availability zone is not available in all Fargate runtimes |
@@ -28,21 +28,30 @@ "use strict"; | ||
detect(_config) { | ||
const functionName = process.env.AWS_LAMBDA_FUNCTION_NAME; | ||
if (!functionName) { | ||
// Check if running inside AWS Lambda environment | ||
const executionEnv = process.env.AWS_EXECUTION_ENV; | ||
if (!(executionEnv === null || executionEnv === void 0 ? void 0 : executionEnv.startsWith('AWS_Lambda_'))) { | ||
return resources_1.Resource.empty(); | ||
} | ||
// These environment variables are guaranteed to be present in Lambda environment | ||
// https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime | ||
const region = process.env.AWS_REGION; | ||
const functionName = process.env.AWS_LAMBDA_FUNCTION_NAME; | ||
const functionVersion = process.env.AWS_LAMBDA_FUNCTION_VERSION; | ||
const region = process.env.AWS_REGION; | ||
const memorySize = process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE; | ||
// These environment variables are not available in Lambda SnapStart functions | ||
const logGroupName = process.env.AWS_LAMBDA_LOG_GROUP_NAME; | ||
const logStreamName = process.env.AWS_LAMBDA_LOG_STREAM_NAME; | ||
const attributes = { | ||
[semconv_1.ATTR_CLOUD_PROVIDER]: String(semconv_1.CLOUD_PROVIDER_VALUE_AWS), | ||
[semconv_1.ATTR_CLOUD_PLATFORM]: String(semconv_1.CLOUD_PLATFORM_VALUE_AWS_LAMBDA), | ||
[semconv_1.ATTR_CLOUD_PROVIDER]: semconv_1.CLOUD_PROVIDER_VALUE_AWS, | ||
[semconv_1.ATTR_CLOUD_PLATFORM]: semconv_1.CLOUD_PLATFORM_VALUE_AWS_LAMBDA, | ||
[semconv_1.ATTR_CLOUD_REGION]: region, | ||
[semconv_1.ATTR_FAAS_NAME]: functionName, | ||
[semconv_1.ATTR_FAAS_VERSION]: functionVersion, | ||
[semconv_1.ATTR_FAAS_MAX_MEMORY]: parseInt(memorySize) * 1024 * 1024, | ||
}; | ||
if (region) { | ||
attributes[semconv_1.ATTR_CLOUD_REGION] = region; | ||
if (logGroupName) { | ||
attributes[semconv_1.ATTR_AWS_LOG_GROUP_NAMES] = [logGroupName]; | ||
} | ||
if (functionName) { | ||
attributes[semconv_1.ATTR_FAAS_NAME] = functionName; | ||
if (logStreamName) { | ||
attributes[semconv_1.ATTR_FAAS_INSTANCE] = logStreamName; | ||
} | ||
if (functionVersion) { | ||
attributes[semconv_1.ATTR_FAAS_VERSION] = functionVersion; | ||
} | ||
return new resources_1.Resource(attributes); | ||
@@ -49,0 +58,0 @@ } |
@@ -132,2 +132,30 @@ /** | ||
/** | ||
* 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) | ||
* | ||
* @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function | ||
* @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID | ||
* @example /subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC> | ||
* | ||
* @note On some cloud providers, it may not be possible to determine the full ID at startup, | ||
* so it may be necessary to set `cloud.resource_id` as a span attribute instead. | ||
* | ||
* The exact value to use for `cloud.resource_id` depends on the cloud provider. | ||
* The following well-known definitions **MUST** be used if you set this attribute and they apply: | ||
* | ||
* - **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). | ||
* Take care not to use the "invoked ARN" directly but replace any | ||
* [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) | ||
* with the resolved function version, as the same runtime instance may be invocable with | ||
* multiple different aliases. | ||
* - **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) | ||
* - **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, | ||
* *not* the function app, having the form | ||
* `/subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`. | ||
* This means that a span attribute **MUST** be used, as an Azure function app can host multiple functions that would usually share | ||
* a TracerProvider. | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
export declare const ATTR_CLOUD_RESOURCE_ID = "cloud.resource_id"; | ||
/** | ||
* 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. | ||
@@ -175,2 +203,22 @@ * | ||
/** | ||
* The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. | ||
* | ||
* @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de | ||
* | ||
* @note * **AWS Lambda:** Use the (full) log stream name. | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
export declare const ATTR_FAAS_INSTANCE = "faas.instance"; | ||
/** | ||
* The amount of memory available to the serverless function converted to Bytes. | ||
* | ||
* @example 134217728 | ||
* | ||
* @note It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
export declare const ATTR_FAAS_MAX_MEMORY = "faas.max_memory"; | ||
/** | ||
* The immutable version of the function being executed. | ||
@@ -177,0 +225,0 @@ * |
@@ -18,3 +18,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CLOUD_PROVIDER_VALUE_AWS = exports.CLOUD_PLATFORM_VALUE_AWS_LAMBDA = exports.CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK = exports.CLOUD_PLATFORM_VALUE_AWS_EKS = exports.CLOUD_PLATFORM_VALUE_AWS_ECS = exports.CLOUD_PLATFORM_VALUE_AWS_EC2 = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_ID = exports.ATTR_FAAS_VERSION = exports.ATTR_FAAS_NAME = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_PLATFORM = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = exports.ATTR_AWS_LOG_STREAM_NAMES = exports.ATTR_AWS_LOG_STREAM_ARNS = exports.ATTR_AWS_LOG_GROUP_NAMES = exports.ATTR_AWS_LOG_GROUP_ARNS = exports.ATTR_AWS_ECS_TASK_REVISION = exports.ATTR_AWS_ECS_TASK_FAMILY = exports.ATTR_AWS_ECS_TASK_ARN = exports.ATTR_AWS_ECS_LAUNCHTYPE = exports.ATTR_AWS_ECS_CONTAINER_ARN = exports.ATTR_AWS_ECS_CLUSTER_ARN = void 0; | ||
exports.CLOUD_PROVIDER_VALUE_AWS = exports.CLOUD_PLATFORM_VALUE_AWS_LAMBDA = exports.CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK = exports.CLOUD_PLATFORM_VALUE_AWS_EKS = exports.CLOUD_PLATFORM_VALUE_AWS_ECS = exports.CLOUD_PLATFORM_VALUE_AWS_EC2 = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_ID = exports.ATTR_FAAS_VERSION = exports.ATTR_FAAS_MAX_MEMORY = exports.ATTR_FAAS_INSTANCE = exports.ATTR_FAAS_NAME = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_RESOURCE_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_PLATFORM = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = exports.ATTR_AWS_LOG_STREAM_NAMES = exports.ATTR_AWS_LOG_STREAM_ARNS = exports.ATTR_AWS_LOG_GROUP_NAMES = exports.ATTR_AWS_LOG_GROUP_ARNS = exports.ATTR_AWS_ECS_TASK_REVISION = exports.ATTR_AWS_ECS_TASK_FAMILY = exports.ATTR_AWS_ECS_TASK_ARN = exports.ATTR_AWS_ECS_LAUNCHTYPE = exports.ATTR_AWS_ECS_CONTAINER_ARN = exports.ATTR_AWS_ECS_CLUSTER_ARN = void 0; | ||
/* | ||
@@ -156,2 +156,30 @@ * This file contains a copy of unstable semantic convention definitions | ||
/** | ||
* 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) | ||
* | ||
* @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function | ||
* @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID | ||
* @example /subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC> | ||
* | ||
* @note On some cloud providers, it may not be possible to determine the full ID at startup, | ||
* so it may be necessary to set `cloud.resource_id` as a span attribute instead. | ||
* | ||
* The exact value to use for `cloud.resource_id` depends on the cloud provider. | ||
* The following well-known definitions **MUST** be used if you set this attribute and they apply: | ||
* | ||
* - **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). | ||
* Take care not to use the "invoked ARN" directly but replace any | ||
* [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) | ||
* with the resolved function version, as the same runtime instance may be invocable with | ||
* multiple different aliases. | ||
* - **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) | ||
* - **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, | ||
* *not* the function app, having the form | ||
* `/subscriptions/<SUBSCRIPTION_GUID>/resourceGroups/<RG>/providers/Microsoft.Web/sites/<FUNCAPP>/functions/<FUNC>`. | ||
* This means that a span attribute **MUST** be used, as an Azure function app can host multiple functions that would usually share | ||
* a TracerProvider. | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
exports.ATTR_CLOUD_RESOURCE_ID = 'cloud.resource_id'; | ||
/** | ||
* 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. | ||
@@ -199,2 +227,22 @@ * | ||
/** | ||
* The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. | ||
* | ||
* @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de | ||
* | ||
* @note * **AWS Lambda:** Use the (full) log stream name. | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
exports.ATTR_FAAS_INSTANCE = 'faas.instance'; | ||
/** | ||
* The amount of memory available to the serverless function converted to Bytes. | ||
* | ||
* @example 134217728 | ||
* | ||
* @note It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). | ||
* | ||
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. | ||
*/ | ||
exports.ATTR_FAAS_MAX_MEMORY = 'faas.max_memory'; | ||
/** | ||
* The immutable version of the function being executed. | ||
@@ -201,0 +249,0 @@ * |
{ | ||
"name": "@opentelemetry/resource-detector-aws", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"description": "OpenTelemetry SDK resource detector for AWS", | ||
@@ -45,5 +45,5 @@ "main": "build/src/index.js", | ||
"@opentelemetry/api": "^1.0.0", | ||
"@opentelemetry/contrib-test-utils": "^0.45.0", | ||
"@opentelemetry/instrumentation-fs": "^0.19.0", | ||
"@opentelemetry/instrumentation-http": "^0.57.0", | ||
"@opentelemetry/contrib-test-utils": "^0.45.1", | ||
"@opentelemetry/instrumentation-fs": "^0.19.1", | ||
"@opentelemetry/instrumentation-http": "^0.57.1", | ||
"@types/mocha": "8.2.3", | ||
@@ -68,3 +68,3 @@ "@types/node": "18.18.14", | ||
"sideEffects": false, | ||
"gitHead": "bcf1da7964e72c47e127cfc3f615c79da3c5dc30" | ||
"gitHead": "1eb77007669bae87fe5664d68ba6533b95275d52" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
396944
4.87%4112
3.63%6
-14.29%81
-6.9%27
107.69%