Closed krishnaexplore closed 10 months ago
These attributes are not added by the HostResourceProvider
hence disabling it will have no effect. To get rid of them try setting OTEL_SEMCONV_STABILITY_OPT_IN=http
or alternatively you can drop them by configuring a metrics view https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/incubator
@laurit which resource provider adding these labels (net_host_name, net_host_port)? and what is the functionality of views ?
@krishnaexplore they are not added by a resource provider. Description of views can be found in https://opentelemetry.io/docs/concepts/signals/metrics/#views
This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed automatically if there is no response from the author within 7 additional days from this comment.
Describe the bug
when I disabled HostResourceProvider using environment variable below labels still generated by java agent
net_host_name="localhost", net_host_port="8081",
http_server_duration_milliseconds_count{exported_job="cart", http_method="GET", http_route="/cart", http_scheme="http", http_status_code="200", instance="0.0.0.0:8889", job="otel_collector", net_host_name="localhost", net_host_port="8081", net_protocol_name="http", net_protocol_version="1.1"}
export OTEL_JAVA_DISABLED_RESOURCE_PROVIDERS=io.opentelemetry.instrumentation.resources.HostResourceProvider
Steps to reproduce
my otelcollector-contrib config
java agent configuration
running app like java -javaagent:opentelemetry-javaagent.jar -jar build/libs/cart-0.0.1-SNAPSHOT.jar
console output
metrics in prometheus
Expected behavior
should not be generated below labels for metric : http_server_duration_milliseconds_count net_host_name="localhost", net_host_port="8081"
Actual behavior
labels generated for metrics : http_server_duration_milliseconds_count net_host_name="localhost", net_host_port="8081"
Javaagent or library instrumentation version
v1.31.0
Environment
JDK: amazoncorretto:11 OS: MacOs
Additional context
No response