Hello, I'm trying to get clj-otel working to send Datomic metrics (as gauges) to a local receiver on 127.0.0.1:4317. Everything seems OK and I don't get errors, but I also don't see the metrics in the receiver's logs. I'm invoking Datomic like so:
java -server -cp resources:datomic-transactor-pro-1.0.7394.jar:lib/* -Xmx8G -Xms1g -javaagent:/home/jett/opentelemetry-javaagent.jar -Dotel.service.name=<my-service-name> -Dotel.traces.exporter=none -Dotel.logs.exporter=none -Dotel.exporter.otlp.traces.protocol=grpc clojure.main --main datomic.launcher postgres-transactor.properties
I had to add -Dotel.exporter.oltp.traces.protocol=grpc because my receiver does not support OLTP over HTTP. Do I also need to set -Dotel.metrics.exporter to some value?The default for system property otel.metrics.exporter is otlp, so I think what you have is fine. You may want to review the other autoconfiguration properties for metrics https://opentelemetry.io/docs/languages/java/configuration/#properties-metrics
In particular, otel.exporter.otlp.endpoint. If localhost is not known, then that might be an issue.
Ah, I think I've spotted the issue; you need -Dotel.exporter.otlp.protocol=grpc not -Dotel.exporter.otlp.traces.protocol=grpc
This is assuming you need grpc on all signals, not just traces
The instrumentation agent settings use http/protobuf as the default protocol, unlike the SDK, which uses grpc as the default protocol 🤷🏼♂️
Thank you! I was looking at the SDK docs which talked about grpc being the default and I couldn't understand why it would make a difference to set it explicitly. When I set it for metrics or for all signals does seem to work.
I also had a question about https://github.com/steffan-westcott/clj-otel/blob/master/doc/guides.adoc#configure-and-run-an-application-with-telemetry. Do options 2 and 3 not require the additional jar passed to -javaagent (i.e. all the dependencies can be packaged directly in an uberjar)?
(assuming I need only manual instrumentation)
• Option 1 is about using the agent; this needs the -javaagent option on the command line
• Options 2-4 do not involve the agent; no -javaagent option is used here
The linked sections walk you through the dependencies you'll need. You could put them (with transitive dependencies) in an uberjar if you want.
Thank you--really appreciate all the help here. I (obviously) have a lot to learn about the otel ecosystem but it's great to have so much flexibility.