-
Notifications
You must be signed in to change notification settings - Fork 5
Added resources as runtimeOnly dependency #14
Conversation
Note: adding the
Our instrumentation docs will be updated to reflect this change. |
@@ -40,6 +40,7 @@ dependencies { | |||
implementation "io.opentelemetry:opentelemetry-exporter-otlp-logs:$otelVersion-alpha" | |||
implementation "io.opentelemetry:opentelemetry-exporter-logging" // only for debug | |||
runtimeOnly("io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0:$otelVersion-alpha") | |||
runtimeOnly "io.opentelemetry.instrumentation:opentelemetry-resources:$otelVersion-alpha" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great finding - didn't know about that!
Just checked out the implementation, and we should probably also use InetAddress.getLocalHost().getHostName()
instead of System.getenv("HOSTNAME")
as here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
@@ -40,6 +40,7 @@ dependencies { | |||
implementation "io.opentelemetry:opentelemetry-exporter-otlp-logs:$otelVersion-alpha" | |||
implementation "io.opentelemetry:opentelemetry-exporter-logging" // only for debug | |||
runtimeOnly("io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0:$otelVersion-alpha") | |||
runtimeOnly "io.opentelemetry.instrumentation:opentelemetry-resources:$otelVersion-alpha" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might also make sense to describe how the service.name is created from both the manifest and the jar name there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a closer look. Below is the order of precedence for service name
- OTEL_SERVICE_NAME
- OTEL_RESOURCE_ATTRIBUTES
a.service_name
key:value (manually set)
b. spring application name
c. manifest
If none of the above are set the service_name
shows as unknown_service:java
Note that JarServiceNameDetector
extends ConditionalResourceProvider
so it will only be applied if the shouldApply
method returns true.
- Updated method call for hostname to match call in Otel's HostResource - Fixed typo in log message
Co-authored-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
No description provided.