0

I have a Java application running with an OTel agent to collect telemetries and send them to the New Relic platform.

Configuration of OTel Java agent:

-javaagent:./agents/opentelemetry-javaagent-all.jar
-Dotel.traces.exporter=otlp
-Dotel.resource.attributes=service.name=my-application
-Dotel.exporter.otlp.endpoint=https://otlp.nr-data.net:4317
-Dotel.exporter.otlp.headers=api-key=${NEW_RELIC_LICENSE_KEY}

When this app is starting an error occurs:

Caused by: java.lang.IllegalArgumentException: cannot find a NameResolver for https://otlp.nr-data.net:4317

How to resolve this problem?

  • Which version of the OTEL javaagent are you running? Are you able to resolve `otlp.nr-data.net` e.g. `nslookup otlp.nr-data.net` on the system where this Java app is running? – Jan Garaj Apr 06 '22 at 15:56
  • @JanGaraj the OTel javaagent version is 1.12.1, locally this application works fine, but when deploying the app on the server this error occurs, I tested `ping` and `telnet` at host `otlp.nr-data.net` are responding correctly. – Jonathan Henrique Medeiros Apr 06 '22 at 16:16

2 Answers2

0

I would try:

-Dotel.exporter.otlp.endpoint=otlp.nr-data.net:4317

OTLP endpoint should be officially URL (so scheme part should be included), but some implementations need it without scheme part. I guess this is your case.

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
0

The problem has been solved for me when adjusting Dockerfile forcing the download of OTel java agent on the image build process.

From:

COPY ./agents/opentelemetry-javaagent-all.jar .

To:

ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.1/opentelemetry-javaagent.jar .