Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][misc] Disable OTel by default when running the pulsar-perf tool #23585

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

Shawyeok
Copy link
Contributor

@Shawyeok Shawyeok commented Nov 11, 2024

Fixes #23475

Motivation

Since pulsar 3.3.0 (#22179), pulsar-perf constantly print warning message on the console if user haven't configured a OTel-compatible metric collector in their environment. To align with broker, proxy, and other components, OTel metric collection should be disabled in pulsar-perf by default. #22010

With this patch, the following log will appear before running the performance test:

Nov 10, 2024 3:36:19 PM io.opentelemetry.api.GlobalOpenTelemetry maybeAutoConfigureAndSetGlobal
INFO: AutoConfiguredOpenTelemetrySdk found on classpath but automatic configuration is disabled. To enable, run your JVM with -Dotel.java.global-autoconfigure.enabled=true

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 11, 2024
@lhotari
Copy link
Member

lhotari commented Nov 11, 2024

An alternative would be to have OTel configured, but disabled by default as it's done in Pulsar's OpenTelemetryService:

sdkBuilder.addPropertiesSupplier(() -> Map.of(
OTEL_SDK_DISABLED_KEY, "true",
.

@dragosvictor Please review this PR and suggest a suitable approach.

@Shawyeok Shawyeok force-pushed the disable-otel-default-in-pulsar-perf branch from 166ce03 to 55b8b36 Compare November 12, 2024 02:03
@Shawyeok
Copy link
Contributor Author

@lhotari
Thanks for pointed out, otel.sdk.disabled=true is documented in PIP-320, so I think it would be better have a consistent toggle option to enable OTel in pulsar.

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@lhotari lhotari closed this Nov 26, 2024
@lhotari lhotari reopened this Nov 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.23%. Comparing base (bbc6224) to head (55b8b36).
Report is 756 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23585      +/-   ##
============================================
+ Coverage     73.57%   74.23%   +0.66%     
+ Complexity    32624     3353   -29271     
============================================
  Files          1877     1945      +68     
  Lines        139502   149262    +9760     
  Branches      15299    16698    +1399     
============================================
+ Hits         102638   110809    +8171     
- Misses        28908    29876     +968     
- Partials       7956     8577     +621     
Flag Coverage Δ
inttests 27.99% <ø> (+3.40%) ⬆️
systests 24.88% <ø> (+0.56%) ⬆️
unittests 73.76% <ø> (+0.92%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 670 files with indirect coverage changes

@lhotari lhotari merged commit 2c36410 into apache:master Nov 27, 2024
102 of 104 checks passed
@lhotari lhotari added this to the 4.1.0 milestone Nov 27, 2024
lhotari pushed a commit that referenced this pull request Nov 27, 2024
lhotari pushed a commit that referenced this pull request Nov 27, 2024
@lhotari
Copy link
Member

lhotari commented Dec 3, 2024

Workaround for 4.0.0

export OTEL_SDK_DISABLED=true

hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 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.

pulsar-perf tool constant print WARNING: Failed to export metrics
4 participants