Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add seamless OpenTelemetry Java agent integration#27639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
srstrickland wants to merge2 commits intotrinodb:master
base:master
Choose a base branch
Loading
fromsrstrickland:fix/global-otel-javaagent

Conversation

@srstrickland
Copy link

@srstricklandsrstrickland commentedDec 12, 2025
edited
Loading

Enable automatic integration with OpenTelemetry Java agent while maintaining full backwards compatibility with standalone tracing configuration.

Fixes#27638

Changes

  • Add ConditionalTracingModule that auto-detects GlobalOpenTelemetry
  • Add GlobalOpenTelemetryModule to bind global instance when detected
  • Update Server.java to use ConditionalTracingModule
  • Add tests for auto-detection and override behavior
  • Update OpenTelemetry documentation with Java agent integration guide

Behavior

When Java agent is present:

  • Auto-detects GlobalOpenTelemetry and uses it (logged as "Using GlobalOpenTelemetry")
  • All spans share resource attributes from agent
  • Configuration done once via agent (OTEL_* env vars)
  • Single exporter, single SDK instance

When Java agent is NOT present:

  • Falls back to TracingModule (logged as "Using dedicated TracingModule")
  • Existing tracing.* configuration works unchanged
  • 100% backwards compatible

Override

System property or environment variable to force specific behavior:

Force use of global

-Dtracing.use-global=true
export TRACING_USE_GLOBAL=true

Force use of dedicated TracingModule

-Dtracing.use-global=false

Testing

Unit tests verify:

  • Auto-detection when GlobalOpenTelemetry is initialized
  • Fallback when not initialized
  • System property override
  • Backwards compatibility

Documentation

  • docs/src/main/sphinx/admin/opentelemetry.md: Added Java agent integration section
  • docs/src/main/sphinx/develop/opentelemetry-java-agent.md: Developer guide

Description

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
() Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text:

##OpenTelemetry* Fix integration with opentelemetry javaagent (duplicate instances). ({issue}`27638`)

@cla-bot
Copy link

cla-botbot commentedDec 12, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors:Scott Strickland.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commitsgit config --list | grep email
  2. If not, set it up usinggit config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, seehttps://github.com/settings/emails

Enable automatic integration with OpenTelemetry Java agent while maintainingfull backwards compatibility with standalone tracing configuration.Fixestrinodb#27638Changes-------- Add ConditionalTracingModule that auto-detects GlobalOpenTelemetry- Add GlobalOpenTelemetryModule to bind global instance when detected- Update Server.java to use ConditionalTracingModule- Add comprehensive tests for auto-detection and override behavior- Update OpenTelemetry documentation with Java agent integration guideBehavior--------When Java agent is present:- Auto-detects GlobalOpenTelemetry and uses it (logged as "Using GlobalOpenTelemetry")- All spans share resource attributes from agent- Configuration done once via agent (OTEL_* env vars)- Single exporter, single SDK instanceWhen Java agent is NOT present:- Falls back to TracingModule (logged as "Using dedicated TracingModule")- Existing tracing.* configuration works unchanged- 100% backwards compatibleOverride--------System property or environment variable to force specific behavior:  # Force use of global  -Dtracing.use-global=true  export TRACING_USE_GLOBAL=true  # Force use of dedicated TracingModule  -Dtracing.use-global=falseTesting-------Unit tests verify:- Auto-detection when GlobalOpenTelemetry is initialized- Fallback when not initialized- System property override- Backwards compatibilityDocumentation-------------- docs/src/main/sphinx/admin/opentelemetry.md: Added Java agent integration section- docs/src/main/sphinx/develop/opentelemetry-java-agent.md: Developer guide
@cla-bot
Copy link

cla-botbot commentedDec 12, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign ourContributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA tocla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, seehttps://github.com/trinodb/cla

1 similar comment
@cla-bot
Copy link

cla-botbot commentedDec 12, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign ourContributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA tocla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, seehttps://github.com/trinodb/cla

@cla-bot
Copy link

cla-botbot commentedDec 12, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign ourContributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA tocla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, seehttps://github.com/trinodb/cla

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Duplicate OpenTelemetry Instances When Using Java Agent

1 participant

@srstrickland

[8]ページ先頭

©2009-2025 Movatter.jp