opentelemetry-java-examples icon indicating copy to clipboard operation
opentelemetry-java-examples copied to clipboard

Unable to send custom metrics using otel Java Agent.

Open rahul-narkhede opened this issue 1 year ago • 2 comments

I have a java servlet application running via otel agent in tomcat server. I can see the traces and default metrics created by application coming into my collector and eventually into datadog.

However, I wanted to add some custom metric Histograms. So, I created the meter object using GlobalOpenTelemetry

Meter meter = GlobalOpenTelemetry.getMeter("")
LongHistogram myhistogram =  meter.histogramBuilder(...)
....

When I set the -Dotel.metrics.exporter=otlp,logging , I can see the metric value logged on my console, but nothing shows up on collector or datadog.

Any help in this matter is appreciated.

rahul-narkhede avatar May 14 '24 02:05 rahul-narkhede

@rahul-narkhede any fix for this. Running into the same problem

vg-meesho avatar Jun 24 '24 09:06 vg-meesho

do you have the otlp exporter added as a dependency?

implementation("io.opentelemetry:opentelemetry-exporter-otlp")

jaydeluca avatar Jul 16 '24 11:07 jaydeluca

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 if no further activity occurs within 7 days of this comment.

github-actions[bot] avatar Oct 09 '24 10:10 github-actions[bot]