GoogleCloudPlatform / opentelemetry-operations-java

Apache License 2.0
71 stars 38 forks source link

Support resource detection when using the java agent #278

Closed dashpole closed 5 months ago

dashpole commented 9 months ago

From https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/issues/247#issuecomment-1851432709:

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 commented 9 months ago

This might need to happen after https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/issues/266

psx95 commented 5 months ago

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

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 commented 5 months ago

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

psx95 commented 5 months ago

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