Skip to content

refactor: migrate OpenTelemetry configuration from agent to Spring Boot Starter - #1730

Merged
lbroudoux merged 3 commits into
microcks:1.13.xfrom
StartUpNationLabs:refactor/move-otel-from-agent-to-spring-boot-starter
Sep 23, 2025
Merged

lbroudoux merged 3 commits into
microcks:1.13.xfrom
StartUpNationLabs:refactor/move-otel-from-agent-to-spring-boot-starter

Conversation

@Apoorva64

@Apoorva64 Apoorva64 commented Sep 10, 2025 •

Copy link
Copy Markdown
Contributor

Description

Why?
We need to migrate to spring boot starter because:

  • it allows us to deeply customize the opentelmetry SDK to add a span processor
  • it allows us to have opentelemetry in native image

What do we lose?

Breaking

This PR currently breaks the default opentelemetry configuration. As the Java Agent and the Spring Boot Starter does not use the same ENV vars for enabling and disabling the opentelemetry configuration

The JAVA Agent uses: "OTEL_JAVAAGENT_ENABLED" to enable the agent
But spring boot starter uses: "OTEL_SDK_DISABLED" to disable the sdk

Futhermore, we cannot completely disable the Spring Boot Start with OTEL_SDK_DISABLED, as we want to use Opentelemetry to collect the traces in memory for #1728 that is why in this PR the SDK is not disabled but the exporters are set to none. The best option would be to add something like

otel.traces.exporter=${OTEL_JAVAAGENT_ENABLED:true ? 'otlp' : 'none'}
otel.metrics.exporter=${OTEL_JAVAAGENT_ENABLED:true ? 'otlp' : 'none'}
otel.logs.exporter=${OTEL_JAVAAGENT_ENABLED:true ? 'otlp' : 'none'}

in the application.properties but it doesn't work that way xD. We could also implement an entrypoint to do this but before going futher i want to discuss a bit about it

Related issue(s)

See #1728

@Apoorva64
Apoorva64 force-pushed the refactor/move-otel-from-agent-to-spring-boot-starter branch from 7f197e0 to b9e5daf Compare September 10, 2025 08:03
Signed-off-by: Apoorva Srinivas Appadoo <[email protected]>
@Apoorva64
Apoorva64 marked this pull request as ready for review September 10, 2025 08:51
Comment thread webapp/pom.xml Resolved
Comment thread webapp/pom.xml Resolved
Comment thread webapp/src/main/docker/Dockerfile Resolved
@lbroudoux

Copy link
Copy Markdown
Member

This topic is maybe a bit hard to follow in an asynchronous way and may deserve a dedicated design session. What do you think about organizing a specific chat/video call for that?

@Apoorva64

Copy link
Copy Markdown
Contributor Author

@lbroudoux I think it would be a great idea to make a call to design all of this. I am available everyday xD, when are you available?

@lbroudoux

Copy link
Copy Markdown
Member

@lbroudoux I think it would be a great idea to make a call to design all of this. I am available everyday xD, when are you available?

I'm available tomorrow morning and afternoon. Let's ping via Discord.

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just introduce the variable for opentelemetry version and we will be ready to go!

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the explanations and applying the changes.

@Apoorva64

Copy link
Copy Markdown
Contributor Author

i think that RestControllerIT.testProxyFallbackWithDelay is a flaky test, i can't replicate it in local

@lbroudoux
lbroudoux merged commit e4bd83e into microcks:1.13.x Sep 23, 2025
lbroudoux added a commit that referenced this pull request Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants