Replies: 4 comments 1 reply
-
Error message: ReadObject: expect { or , or } or n, but found #, error found in #1 byte of ...|# HELP http|..., bigger context ...|# HELP http_server_duration_milliseconds The durati|... - There was an error returned querying the Prometheus API. |
Beta Was this translation helpful? Give feedback.
-
hi @mitht, is there any exception stack trace logged in the application that's running the java agent? if not, can you try to repro using the OTel Java SDK + Prometheus exporter directly to help narrow down the issue? |
Beta Was this translation helpful? Give feedback.
-
cc @zeitlinger |
Beta Was this translation helpful? Give feedback.
-
The issue is resolved by adding the following configuration to Prometheus.
|
Beta Was this translation helpful? Give feedback.
-
opentelemetry-javaagent version: 1.33.1
prometheus version: 2.51.1.darwin-amd64
grafana version: 10.4.1
environment variable
OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317;OTEL_INSTRUMENTATION_COMMON_DB_STATEMENT_SANITIZER_ENABLED=false;OTEL_METRICS_EXPORTER=prometheus;OTEL_EXPORTER_PROMETHEUS_HOST=127.0.0.1;OTEL_EXPORTER_PROMETHEUS_PORT=9090
javaagent
-javaagent:/app/opentelemetry-javaagent-1.33.1.jar -Dotel.service.name=my-service -Dotel.instrumentation.jdbc.enabled=true -Dotel.logs.exporter=none
After configuring OTEL_METRICS_EXPORTER=prometheus;OTEL_EXPORTER_PROMETHEUS_HOST=127.0.0.1;OTEL_EXPORTER_PROMETHEUS_PORT=9090, Grafana fails to connect to Prometheus, with the following error message:
Without Prometheus environment variables configured, visit: http://127.0.0.1:9090/graph
With the environment configuration added, OTEL_METRICS_EXPORTER=prometheus;OTEL_EXPORTER_PROMETHEUS_HOST=127.0.0.1;OTEL_EXPORTER_PROMETHEUS_PORT=9090, visit: http://127.0.0.1:9090/graph.
Beta Was this translation helpful? Give feedback.
All reactions