Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AWS resource detector entry points #1

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

abstractOwl
Copy link
Owner

Description

The AWS resource detectors currently are not picked up when using the new OTEL_EXPERIMENTAL_RESOURCE_DETECTORS environment variable because they are not registered under the opentelemetry_resource_detector entry point.

This PR adds the relevant section to the sdk-aws pyproject.toml file to allow the resource detectors to be used.

Fixes open-telemetry#1861, open-telemetry#2370

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Added the following line to my Dockerfile in an otel-instrumented test Flask app:

RUN echo "\n\n[opentelemetry_resource_detector]\naws_elastic_beanstalk =
opentelemetry.sdk.extension.aws.resource.beanstalk:AwsBeanstalkResourceDetector"
 >>
/usr/local/lib/python3.12/site-packages/opentelemetry_sdk_extension_aws-2.0.1.dist-info/entry_points.txt

The logs showed that the relevant resource attributes were set:

web_1             | {
web_1             |     "resource_metrics": [
web_1             |         {
web_1             |             "resource": {
web_1             |                 "attributes": {
web_1             |                     "telemetry.sdk.language": "python",
web_1             |                     "telemetry.sdk.name":
"opentelemetry",
web_1             |                     "telemetry.sdk.version": "1.20.0",
web_1             |                     "cloud.provider": "aws",
web_1             |                     "cloud.platform":
"aws_elastic_beanstalk",
web_1             |                     "service.name": "otel_test",
web_1             |                     "service.instance.id": "abc123",
web_1             |                     "service.namespace": "12345",
web_1             |                     "service.version": "0.0.1",
web_1             |                     "telemetry.auto.version": "0.41b0"
web_1             |                 },
web_1             |                 "schema_url": ""
web_1             |             },
web_1             |             "scope_metrics": [],
web_1             |             "schema_url": ""
web_1             |         }
web_1             |     ]
web_1             | }

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@abstractOwl abstractOwl merged commit d25b6fb into main Mar 29, 2024
@abstractOwl abstractOwl deleted the 2370-add-aws-resource-detector-entry-points branch March 29, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to use OTEL_EXPERIMENTAL_RESOURCE_DETECTORS with contrib
1 participant