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

Duplication of Resource Detectors with opentelemetry-go-contrib #1590

Closed
dackroyd opened this issue Nov 16, 2020 · 8 comments
Closed

Duplication of Resource Detectors with opentelemetry-go-contrib #1590

dackroyd opened this issue Nov 16, 2020 · 8 comments
Labels
comp:aws AWS components enhancement New feature or request Stale

Comments

@dackroyd
Copy link

Is your feature request related to a problem? Please describe.

Resource detectors implemented in this repository duplicate those available in opentelemetry-go-contrib, or otherwise would benefit from being included there.

Describe the solution you'd like

Rather than maintaining independent implementations in both places, with inconsistencies and requiring maintenance in both places, resource detectors are implemented in opentelemetry-go-contrib, and used as a dependency.

This would also mean that those resource detectors are available when not using this collector (say the Jaeger variant, or another custom one?)

Describe alternatives you've considered

Having both projects maintain their own copies (as applies currently) likely provides more implementation flexibility, since not tied to changes being made in the other project and waiting on releases.

Additional context

AWS EC2: Collector Contrib / Go Contrib
AWS ECS: Collector Contrib / Go Contrib not implemented (submit?)
GCP GCE: Collector Contrib / Go Contrib
GCP GKE: Collector Contrib not implemented? / Go Contrib
Env: Collector Contrib / OTel Go Available OOTB with OTel Go
System (OS type, hostname): Collector Contrib / OTel Go/Go Contrib not implemented?

@dackroyd dackroyd changed the title Duplication of Resource Detectors with opentelemetry-go Duplication of Resource Detectors with opentelemetry-go-contrib Nov 16, 2020
@dackroyd
Copy link
Author

I was looking into adding resource attributes for AWS and Kubernetes to applications running on that infrastructure. These could be detected at the application level, but that adds complexity and dependencies at that level which are likely undesirable.

For example, using the OpenTelemetry-go-contrib implementation from the application to detect AWS attributes requires a dependency on the AWS SDK, even if the app doesn't use any of the AWS apis otherwise. That library is quite large, and OpenTelemetry-go-contrib doesn't have the resources to maintain an implementation that doesn't have this dependency: open-telemetry/opentelemetry-go-contrib#429

I think it is preferable not to have each application trying to detect these resource attributes themselves, but instead to have this done by the agent/collector for the infrastructure where the app is running. Other setups however may call for the application to do so, and there are other collectors (the Jaeger collector, or a customised one?) which would benefit from being able to reuse the same detection code, maintained in the one place (OpenTelemetry-go-contrib).

@bogdandrutu
Copy link
Member

@dackroyd completely agree, I think collector should be used for resource detection in general.

@andrewhsu andrewhsu added enhancement New feature or request and removed feature request labels Jan 6, 2021
dyladan referenced this issue in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
Map and array attribute value types which were recently added to the specification had not been implemented in the collector yet. This PR implements across all tracing receivers and exporters.

**Link to tracking Issue:** #1590

**Testing:** Added map and array attribute values to golden dataset. All unit and correctness tests continue to pass.
jrcamp referenced this issue in jrcamp/opentelemetry-collector-contrib Mar 22, 2021
This adds an eks detector for Amazon EKS. It sets cloud.provider,
cloud.infrastructure_service, and k8s.cluster.name.

It's intended to be used in conjunction with ec2 detector. The eks detector
should come first so that the more specific cloud.infrastructure_service value
wins (see README.md).

Note that this code is taken from
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/detectors/aws/eks.
There is a goal to prevent duplication with go-contrib in #1590 and I started
down that path but it will require more time than currently available as it
needs to transform from different data models, deal with any differences in
metadata between existing detectors, etc.
jrcamp referenced this issue in jrcamp/opentelemetry-collector-contrib Mar 22, 2021
This adds an gke detector for GKE. It sets cloud.provider,
cloud.infrastructure_service, and k8s.cluster.name.

It's intended to be used in conjunction with gce detector. The gke detector
should come first so that the more specific cloud.infrastructure_service value
wins (see README.md).

Note that this code is taken from
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/detectors/gcp.
There is a goal to prevent duplication with go-contrib in #1590 and I started
down that path but it will require more time than currently available as it
needs to transform from different data models, deal with any differences in
metadata between existing detectors, etc.
bogdandrutu pushed a commit that referenced this issue Mar 25, 2021
* [processor/resourcedetection] Add GKE detector

This adds an gke detector for GKE. It sets cloud.provider,
cloud.infrastructure_service, and k8s.cluster.name.

It's intended to be used in conjunction with gce detector. The gke detector
should come first so that the more specific cloud.infrastructure_service value
wins (see README.md).

Note that this code is taken from
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/detectors/gcp.
There is a goal to prevent duplication with go-contrib in #1590 and I started
down that path but it will require more time than currently available as it
needs to transform from different data models, deal with any differences in
metadata between existing detectors, etc.

* add coverage for gce mock

* review feedback

* fix tests
@jrcamp
Copy link
Contributor

jrcamp commented Mar 25, 2021

I looked into this as part of adding EKS and GKE. There are some differences between detectors in go-contrib and here. e.g. they add container.id because they can determine what container the app is running in. If we were to include container.id we would put in the collector's own container id. You could configure the processor not to override existing attributes but it's also just not clear if collector should ever insert container.id (unless it's for self-metrics).

go-contrib may also be more sensitive to dependencies being pulled in given their not using k8s client API in EKS for instance. (Though I haven't discussed it with them, I'm just inferring.) In collectors case it's less of a concern.

Given the relatively small amount of code I'm not 100% sure it's worth the effort even though it sounds good in theory.

tigrannajaryan pushed a commit that referenced this issue Mar 25, 2021
This adds an eks detector for Amazon EKS. It sets cloud.provider,
cloud.infrastructure_service, and k8s.cluster.name.

It's intended to be used in conjunction with ec2 detector. The eks detector
should come first so that the more specific cloud.infrastructure_service value
wins (see README.md).

Note that this code is taken from
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/detectors/aws/eks.
There is a goal to prevent duplication with go-contrib in #1590 and I started
down that path but it will require more time than currently available as it
needs to transform from different data models, deal with any differences in
metadata between existing detectors, etc.
pmatyjasek-sumo referenced this issue in pmatyjasek-sumo/opentelemetry-collector-contrib Apr 28, 2021
* [processor/resourcedetection] Add GKE detector

This adds an gke detector for GKE. It sets cloud.provider,
cloud.infrastructure_service, and k8s.cluster.name.

It's intended to be used in conjunction with gce detector. The gke detector
should come first so that the more specific cloud.infrastructure_service value
wins (see README.md).

Note that this code is taken from
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/detectors/gcp.
There is a goal to prevent duplication with go-contrib in #1590 and I started
down that path but it will require more time than currently available as it
needs to transform from different data models, deal with any differences in
metadata between existing detectors, etc.

* add coverage for gce mock

* review feedback

* fix tests
pmatyjasek-sumo referenced this issue in pmatyjasek-sumo/opentelemetry-collector-contrib Apr 28, 2021
This adds an eks detector for Amazon EKS. It sets cloud.provider,
cloud.infrastructure_service, and k8s.cluster.name.

It's intended to be used in conjunction with ec2 detector. The eks detector
should come first so that the more specific cloud.infrastructure_service value
wins (see README.md).

Note that this code is taken from
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/detectors/aws/eks.
There is a goal to prevent duplication with go-contrib in #1590 and I started
down that path but it will require more time than currently available as it
needs to transform from different data models, deal with any differences in
metadata between existing detectors, etc.
@alolita alolita added the comp:aws AWS components label Sep 2, 2021
@alolita alolita added the comp:aws-xray AWS XRay related issues label Sep 30, 2021
@willarmiros
Copy link
Contributor

Hi @jrcamp @bogdandrutu can we untag aws-xray from this feature request (or resolve if the resource detectors have been migrated)? Seems reasonable to have aws tagged, but there's nothing specific to X-Ray in this issue I can see.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2022

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Nov 8, 2022
@jpkrohling jpkrohling removed the comp:aws-xray AWS XRay related issues label Nov 23, 2022
@jpkrohling
Copy link
Member

@Aneurysm9, is this something your team would be interested in working on?

@Aneurysm9
Copy link
Member

I'm not sure I see the need for, or value in, sharing implementations here. Would like to hear from other @open-telemetry/go-approvers, but I would currently lean toward closing this issue.

@dackroyd
Copy link
Author

Happy for the issue to be closed. Clear to me that there is a need for each to be implemented separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:aws AWS components enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests

8 participants