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

[processor/resourcedetection] Proposal to add a Dynatrace resource detector #37577

Open
evan-bradley opened this issue Jan 29, 2025 · 8 comments
Assignees
Labels
enhancement New feature or request processor/resourcedetection Resource detection processor

Comments

@evan-bradley
Copy link
Contributor

evan-bradley commented Jan 29, 2025

Component(s)

processor/resourcedetection

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

The Dynatrace OneAgent makes resource attributes about hosts on which it is installed available for external processes to read and use to enrich their telemetry. Similar to the other detectors in the Resource Detection Processor, users may want to use these attributes for enrichment.

Describe the solution you'd like

Include a dynatrace detector in the Resource Detection Processor that can be used alongside the other detectors. The format of the files is simple, so the detector will be relatively straightforward to implement. It will also not need any additional configuration on top of being enabled. An example config would look like:

processors:
  resourcedetection:
    detectors: [aws, system, dynatrace]

Describe alternatives you've considered

A new, separate processor could be used instead to do this enrichment, but would require configuring additional processors since users with OneAgents installed on their hosts will likely also want to use at least one of the detectors in the Resource Detection Processor.

Additional context

Dynatrace resource detectors have already been implemented for Istio and Envoy. For Envoy, here is the implementation to give an idea of the complexity of the implementation.

@evan-bradley evan-bradley added enhancement New feature or request needs triage New item requiring triage labels Jan 29, 2025
@github-actions github-actions bot added the processor/resourcedetection Resource detection processor label Jan 29, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@dashpole dashpole removed the needs triage New item requiring triage label Jan 29, 2025
@dashpole
Copy link
Contributor

What part of it is tied to dynatrace? Does it work in dynatrace-managed environments (or platforms)? Or is it just that the file format was designed by dynatrace?

@dashpole dashpole self-assigned this Jan 29, 2025
@evan-bradley
Copy link
Contributor Author

The path to the file and the attributes provided by the file are specific to Dynatrace. The format of each file (which contain the same data) is standard JSON or Java properties (key=value). For example, if the OneAgent is installed on a *nix host, it will populate a file at /var/lib/dynatrace/enrichment/dt_metadata.properties with the Dynatrace-specific attributes it gathered as documented here.

@dashpole
Copy link
Contributor

I'm definitely OK with adding a dynatrace-secific resource detector if that is what you want. If you think there is an opportunity to support a more generic "jsonfile" (naming up for discussion) detector instead, that also seems like a good idea.

@evan-bradley
Copy link
Contributor Author

I agree a more generic detector that reads key-value pairs from JSON/properties files would be a good idea, but for reading Dynatrace-specifc attributes it would be better to have a Dynatrace detector with the paths to the files hardcoded since they are always in the same place.

At a minimum, we can make the code such that if someone wanted to create such a detector in the future they could reuse the (relatively small) function would translate the attributes into pdata.

@dashpole
Copy link
Contributor

That works for me

@bacherfl
Copy link
Contributor

bacherfl commented Jan 30, 2025

@evan-bradley feel free to assign me to implement this

Edit: just saw that this is already assigned, sorry

@evan-bradley
Copy link
Contributor Author

evan-bradley commented Jan 30, 2025

@bacherfl will be working on this and should have a PR out shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request processor/resourcedetection Resource detection processor
Projects
None yet
Development

No branches or pull requests

3 participants