0

I am trying to enable opentelemetry for one of our SpringBoot services. I was able to invoke it by adding the below to the build.gradle

implementation 'io.opentelemetry:opentelemetry-bom:1.39.0'
implementation 'io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:2.5.0-alpha'            

However, i am getting an error trying to connect to the Jaeger instance:

io.opentelemetry.sdk.internal.ThrottlingLogger doLog SEVERE: Failed to export spans. The request could not be executed. Full error message: Failed to connect to localhost/127.0.0.1:4318

I have tried to specify the following settings in the configmap of the service

OTEL_TRACES_SAMPLER_ARG: "1"
OTEL_TRACES_SAMPLER: "parentbased_traceidratio"
OTEL_RESOURCE_ATTRIBUTES: service.name=myservice,service.version=1.0.0
OTEL_TRACES_EXPORTER: otlp
OTEL_METRICS_EXPORTER: otlp
OTEL_LOGS_EXPORTER: otlp
OTEL_EXPORTER_OTLP_COMPRESSION: gzip
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger-collector.default:4317

but i still get the same error "Failed to connect to localhost/127.0.0.1:4318". Looks like the OTEL_EXPORTER_OTLP_ENDPOINT is not taken into consideration.

Any idea how to address this issue?

Thanks in advance! SG

5
  • Looks like your configmap is not being used. Could you share the yamls for your deployment and configmap? Commented Jul 17, 2024 at 13:34
  • Thanks Juliano, Yes i found it and added it to the right place and confirmed inside the POD that the env settings does have this URL set. Despite the setting, i still get the same error. Commented Jul 18, 2024 at 15:02
  • Also I noticed from the below article, it seems to suggest implementing ObservationHandler. Is that needed? spring.io/blog/2022/10/12/observability-with-spring-boot-3. I did the opentelemetry with Quarkus where i just needed to include the extensions. Commented Jul 18, 2024 at 18:32
  • Have you seen this page? opentelemetry.io/docs/zero-code/java/spring-boot-starter Commented Jul 19, 2024 at 7:59
  • Thanks Juliano, I did. I was trying to use the micrometer based approach instead. docs.spring.io/spring-boot/3.3-SNAPSHOT/reference/actuator/…. Finally i am able to get it to work by providing the management.otlp.tracing.endpoint. However, i am only seeing the http get /actuator/health/** in Jaeger but no other service requests. Looks like not everything is getting traced. I even set the tracing.sampling.probability to 1.0 which did not help. any idea? Commented Jul 19, 2024 at 21:10

1 Answer 1

-1

For local testing you can set the below values , for production deployments you need to have a 'collector' running to process your trace and export it to otel servers .

OTEL_TRACES_EXPORTER: logging OTEL_METRICS_EXPORTER: logging OTEL_LOGS_EXPORTER: logging

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.