{"name":"@opentelemetry/resource-detector-aws","version":"1.5.0","description":"OpenTelemetry SDK resource detector for AWS","main":"build/src/index.js","types":"build/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/open-telemetry/opentelemetry-js-contrib.git"},"scripts":{"clean":"rimraf build/*","compile":"tsc -p .","lint":"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix","precompile":"tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-aws --include-dependencies","prewatch":"npm run precompile","prepublishOnly":"npm run compile","test":"nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'","tdd":"npm run test -- --watch-extensions ts --watch","watch":"tsc -w"},"keywords":["opentelemetry","nodejs","resources","stats","profiling"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","engines":{"node":">=14"},"publishConfig":{"access":"public"},"devDependencies":{"@opentelemetry/api":"^1.0.0","@opentelemetry/contrib-test-utils":"^0.39.0","@types/mocha":"8.2.3","@types/node":"18.6.5","@types/sinon":"10.0.18","mocha":"7.2.0","nock":"13.3.3","nyc":"15.1.0","rimraf":"5.0.5","sinon":"15.2.0","ts-mocha":"10.0.0","typescript":"4.4.4"},"peerDependencies":{"@opentelemetry/api":"^1.0.0"},"dependencies":{"@opentelemetry/core":"^1.0.0","@opentelemetry/resources":"^1.0.0","@opentelemetry/semantic-conventions":"^1.22.0"},"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/detectors/node/opentelemetry-resource-detector-aws#readme","gitHead":"54365a9aafaca6555e13f1276945d6f869d103da","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"_id":"@opentelemetry/resource-detector-aws@1.5.0","_nodeVersion":"18.20.2","_npmVersion":"lerna/6.6.2/node@v18.20.2+x64 (linux)","dist":{"integrity":"sha512-JNk/kSzzNQaiMo/F0b/bm8S3Qtr/m89BckN9B4U/cPHSqKLdxX03vgRBOqkXJ5KlAD8kc6K1Etcr8QfvGw6+uA==","shasum":"85f025f4246bde30d45d1e7531b94e081f0a1ced","tarball":"http://registry-npm.ywwl.com/@opentelemetry/resource-detector-aws/download/@opentelemetry/resource-detector-aws-1.5.0.tgz","fileCount":27,"unpackedSize":111259,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGZjOz9Z1rKImBPEp+Ot/Dmi/hUvxiEYnYPB+6MQqYOAiEAhEffi/wVvKHZyoc3pDpcfcIIDTJ1sShmvENxQtxxInc="}],"size":23417,"noattachment":false,"key":"/@opentelemetry/resource-detector-aws/-/@opentelemetry/resource-detector-aws-1.5.0.tgz"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"directories":{},"maintainers":[{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/resource-detector-aws_1.5.0_1715780140865_0.47690340682079513"},"_hasShrinkwrap":false,"readme":"# OpenTelemetry Resource Detector for AWS\n\n[![NPM Published Version][npm-img]][npm-url]\n[![Apache License][license-image]][license-image]\n\n[component owners](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/.github/component_owners.yml): @carolabadeer\n\nResource detector for Amazon Web Services.\n\n## Status\n\n| Maturity                                  | [Component Owner](../../.github/component_owners.yml) | Compatibility         |\n| ----------------------------------------- | ----------------------------------------------------- | --------------------- |\n| [Stable](../../../CONTRIBUTING.md#stable) | @carolabadeer                                         | API 1.0+<br/>SDK 1.0+ |\n\n## Installation\n\n```bash\nnpm install --save @opentelemetry/resource-detector-aws\n```\n\n## Usage\n\n```typescript\nimport { detectResources } from '@opentelemetry/resources';\nimport { awsEc2Detector } from '@opentelemetry/resource-detector-aws'\nconst resource = await detectResources({\n   detectors: [awsEc2Detector],\n})\n\nconst tracerProvider = new NodeTracerProvider({ resource });\n```\n\n## Available detectors\n\nThis package uses `@opentelemetry/semantic-conventions` version `1.22+`, which implements Semantic Convention [Version 1.7.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/semantic_conventions/README.md)\n\n### AWS Beanstalk Detector\n\nPopulates `service` for processes running on [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)\n\n| Resource Attribute  | Description                                                              |\n|---------------------|--------------------------------------------------------------------------|\n| cloud.platform      | The cloud platform. In this context, it's always \"aws_elastic_beanstalk\" |\n| cloud.provider      | The cloud provider. In this context, it's always \"aws\"                   |\n| service.instance.id | Value of `deployment_id` from config file `environment.conf`             |\n| service.name        | The service name. In this context, it's always \"aws_elastic_beanstalk\"   |\n| service.namespace   | Value of `environment_name` from config file `environment.conf`          |\n| service.version     | Value of `version_label` from config file `environment.conf`             |\n\n### AWS EC2 Detector\n\nPopulates `cloud` and `host` for processes running on [Amazon EC2](https://aws.amazon.com/ec2/), including abstractions such as ECS on EC2. Notably, it does not populate anything on AWS Fargate.\n\n| Resource Attribute      | Description                                                                           |\n|-------------------------|---------------------------------------------------------------------------------------|\n| cloud.account.id        | Value of `accountId` from `/latest/dynamic/instance-identity/document` request        |\n| cloud.availability_zone | Value of `availabilityZone` from `/latest/dynamic/instance-identity/document` request |\n| cloud.platform          | The cloud platform. In this context, it's always \"aws_ec2\"                            |\n| cloud.provider          | The cloud provider. In this context, it's always \"aws\"                                |\n| cloud.region            | Value of `region` from `/latest/dynamic/instance-identity/document` request           |\n| host.id                 | Value of `instanceId` from `/latest/dynamic/instance-identity/document` request       |\n| host.name               | Value of `hostname` from `/latest/dynamic/instance-identity/document` request         |\n| host.type               | Value of `instanceType` from `/latest/dynamic/instance-identity/document` request     |\n\n### AWS ECS Detector\n\nPopulates `container` for containers running on [Amazon ECS](https://aws.amazon.com/ecs/).\n\n| Resource Attribute      | Description                                                                            |\n|-------------------------|----------------------------------------------------------------------------------------|\n| aws.ecs.container.arn   | Value of `ContainerARN` from the request to the metadata Uri. The Metadata Uri is stored on the Environment Variable `ECS_CONTAINER_METADATA_URI_V4`  |\n| aws.ecs.cluster.arn     | Value in the format `${baseArn}:cluster/${cluster}`, with `baseArn` and `cluster` from a `ECS_CONTAINER_METADATA_URI_V4/task` request, with values from `TaskARN` and `Cluster` respectively |\n| aws.ecs.launchtype      | Value of `LaunchType` from `ECS_CONTAINER_METADATA_URI_V4/task` request                |\n| aws.ecs.task.arn        | Value of `TaskARN` from `ECS_CONTAINER_METADATA_URI_V4/task` request                   |\n| aws.ecs.task.family     | Value of `Family` from `ECS_CONTAINER_METADATA_URI_V4/task` request                    |\n| aws.ecs.task.revision   | Value of `Revision` from `ECS_CONTAINER_METADATA_URI_V4/task` request                  |\n| aws.log.group.arns      | Value on format `arn:aws:logs:${logsRegion}:${awsAccount}:log-group:${logsGroupName}`, with `logsRegions` and `logsGroupName` from logs metadata, values of `awslogs-region` and `awslogs-group` respectively, and `awsAccount` parsed value from the `TaskARN`. Logs metadata values come from `LogOptions` on `ECS_CONTAINER_METADATA_URI_V4` request |\n| aws.log.group.names     | Value of `awslogs-group` from logs metadata. Logs metadata values come from `LogOptions` on `ECS_CONTAINER_METADATA_URI_V4` request |\n| aws.log.stream.arns     | Value on format `arn:aws:logs:${logsRegion}:${awsAccount}:log-group:${logsGroupName}:log-stream:${logsStreamName}`, with `logsRegions`, `logsGroupName` and `logsStreamName` from logs metadata, values of `awslogs-region`, `awslogs-group` and `awslogs-stream` respectively, and `awsAccount` parsed value from the `TaskARN` |\n| aws.log.stream.names    | Value of `awslogs-stream` from logs metadata |\n| cloud.account.id        | Parsed value from the `TaskARN` |\n| cloud.availability_zone | Value of `AvailabilityZone` from `ECS_CONTAINER_METADATA_URI_V4/task` request. This value is not available in all Fargate runtimes |\n| cloud.platform          | The cloud platform. In this context, it's always \"aws_ecs\"                             |\n| cloud.provider          | The cloud provider. In this context, it's always \"aws\"                                 |\n| cloud.region            | Parsed value from the `TaskARN`                                                        |\n| cloud.resource_id       | Value of `ContainerARN` from `ECS_CONTAINER_METADATA_URI_V4/task` request              |\n| container.id            | Value from file `/proc/self/cgroup`                                                    |\n| container.name          | The hostname of the operating system                                                   |\n\n### AWS EKS Detector\n\nPopulates `container` and `k8s.cluster_name` for containers running on [Amazon EKS](https://aws.amazon.com/eks/).\n`k8s.cluster_name` is not always available depending on the configuration of CloudWatch monitoring for the EKS cluster.\n\n| Resource Attribute | Description                                                                                         |\n|--------------------|-----------------------------------------------------------------------------------------------------|\n| cloud.platform     | The cloud platform. In this context, it's always \"aws_eks\"                                          |\n| cloud.provider     | The cloud provider. In this context, it's always \"aws\"                                              |\n| container.id       | Value from config file `/proc/self/cgroup`                                                          |\n| k8s.cluster.name   | Value of `cluster.name` from `/api/v1/namespaces/amazon-cloudwatch/configmaps/cluster-info` request |\n\n### AWS Lambda Detector\n\nPopulates `faas` and `cloud` for functions running on [AWS Lambda](https://aws.amazon.com/lambda/).\n`faas.id` is currently not populated as it is not provided by the runtime at startup.\n\n| Resource Attribute | Description                                                         |\n|--------------------|---------------------------------------------------------------------|\n| cloud.platform     | The cloud platform. In this context, it's always \"aws_lambda\"       |\n| cloud.provider     | The cloud provider. In this context, it's always \"aws\"              |\n| cloud.region       | Value of Process Environment Variable `AWS_REGION`                  |\n| faas.name          | Value of Process Environment Variable `AWS_LAMBDA_FUNCTION_NAME`    |\n| faas.version       | Value of Process Environment Variable `AWS_LAMBDA_FUNCTION_VERSION` |\n\n## Useful links\n\n- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>\n- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>\n- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]\n\n## License\n\nApache 2.0 - See [LICENSE][license-url] for more information.\n\n[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions\n[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE\n[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/resource-detector-aws\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fresource-detector-aws.svg\n","publish_time":1715780140995,"_cnpm_publish_time":1715780140995,"dist-tags":{"canary":"0.24.1-alpha.7","latest":"3.0.0","next":"0.24.0"}}