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

Support resource detection when using the java agent #278

Closed
dashpole opened this issue Dec 13, 2023 · 4 comments
Closed

Support resource detection when using the java agent #278

dashpole opened this issue Dec 13, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request priority: p2

Comments

@dashpole
Copy link
Contributor

dashpole commented Dec 13, 2023

From #247 (comment):

It seems that my current configuration is not enough to use the Google Cloud official Resource Detectors. Unlike Auto-Configuration for OpenTelemetry in Google Cloud, Resource Detectors are not designed as extension for javaagent, so I cannot enable them via otel.javaagent.extensions system property.

@dashpole dashpole added enhancement New feature or request priority: p2 labels Dec 13, 2023
@dashpole
Copy link
Contributor Author

This might need to happen after #266

@psx95
Copy link
Contributor

psx95 commented Mar 21, 2024

Regarding #247 (comment)

As a trial, I enabled the Auto-Configuration for OpenTelemetry in Google Cloud as a javaagent extension, and it worked but metrics had no instance ID nor service ID in their attributes yet: generic_node{location:global,node_id:localhost,namespace:}

I did some investigation into this and here are my findings -

Summary

  • Java Agent + Auto Exporter Setup works and I was able to view traces and metrics.
    • Note 1: Shaded version of auto-exporter is needed when using it as an extension to Java Agent.
    • Note 2: Service name was not appearing as a metric label (instance_id was being shown on GCE though), but was being shown in trace attribute. This might be a bug which needs to be addressed.
  • Google Cloud Resource Detectors are now bundled into the Java Agent as of v2.2.0 Release. Instructions to enable this can be found on opentelemetry.io.
    • Note: To export telemetry to Google Cloud, you would still need to use the Auto-exporter as an extension to the agent, regardless of enabling the gcp-resource-detector built-in to the agent.
  • For Java Agents v1.x.x, the resource detectors are not packaged in the Agent, however exporting to Google Cloud via the Agent still works when using the shaded auto-exporter since auto-exporter has the resource detectors built-in.

Is this in-line with your findings @KengoTODA ?

@dashpole As part of this issue, I will look into why service name is not appearing in the metric attributes when using Java Agent.

@dashpole
Copy link
Contributor Author

@psx95 I consider this issue fixed. You are welcome to track the service.name attribute issue here, or in a new issue.

@psx95
Copy link
Contributor

psx95 commented Mar 22, 2024

Created #313 to track this. Will mark this issue as completed.

@psx95 psx95 closed this as completed Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: p2
Projects
None yet
Development

No branches or pull requests

2 participants