# OpenTelemetry traces work locally but not in CI/CD pipeline (Azure) with same parameters (Spring boot)

**URL:** <https://discuss.elastic.co/t/opentelemetry-traces-work-locally-but-not-in-ci-cd-pipeline-azure-with-same-parameters-spring-boot/378649>\
**Category:** Elastic Observability\
**Tags:** elastic-stack-monitoring\
**Created:** [May 28, 2025, 1:18pm UTC](https://discuss.elastic.co/t/opentelemetry-traces-work-locally-but-not-in-ci-cd-pipeline-azure-with-same-parameters-spring-boot/378649 "2025-05-28T13:18:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pooya\_Mirzapour](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pooya_mirzapour/32/143200_2.png) [@Pooya\_Mirzapour](https://discuss.elastic.co/u/Pooya_Mirzapour)\
**Post date:** [May 28, 2025, 1:18pm UTC](https://discuss.elastic.co/t/opentelemetry-traces-work-locally-but-not-in-ci-cd-pipeline-azure-with-same-parameters-spring-boot/378649/1 "2025-05-28T13:18:34Z")

</div>

I stuck in monitoring logs, can someone help me please, I'm using OpenTelemetry Java Agent with a Spring Boot application. I think it is because I am trying to attach the agent with RuntimeAttach.attachJavaagentToCurrentJvm(); that is not working on Cloud foundry, this is the right dependency to build an agent for running in CF?

```
    <dependency>
        <groupId>co.elastic.otel</groupId>
        <artifactId>elastic-otel-javaagent</artifactId>
        <version>1.4.1</version>
    </dependency>

```

In my **local development environment** , everything works as expected: traces are collected and I can see full details in the APM. However, when running the same application with the same OTEL parameters (  
OTEL\_EXPORTER\_OTLP\_HEADERS=my header  
OTEL\_EXPORTER\_OTLP\_ENDPOINT=my endpoint  
OTEL\_SERVICE\_NAME=my service name  
OTEL\_RESOURCE\_ATTRIBUTES=service.environment=test)

inside a **CI/CD pipeline (Azure),** could not create trace and trace is incomplete (just shows conrtroller URL) , and instead an error in elastic:

`at io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.Instrumenter.doEnd(Instrumenter.java:273) at io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.Instrumenter.end(Instrumenter.java:151) at io.opentelemetry.javaagent.instrumentation.tomcat.common.TomcatHelper.end(TomcatHelper.java:53) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:426) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:398) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:903) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1740) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1189) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:658) at`
