-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[feat][broker] PIP-264: Add Java runtime metrics #22616
Merged
lhotari
merged 28 commits into
apache:master
from
dragosvictor:pip-264-java-runtime-metrics
May 7, 2024
Merged
[feat][broker] PIP-264: Add Java runtime metrics #22616
lhotari
merged 28 commits into
apache:master
from
dragosvictor:pip-264-java-runtime-metrics
May 7, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
doc-required
Your PR changes impact docs and you will update later.
label
Apr 29, 2024
merlimat
approved these changes
Apr 29, 2024
dao-jun
approved these changes
May 1, 2024
lhotari
approved these changes
May 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There were quite a few OOMs in that last runs. I'll close and reopen to see if they were originating from the changes made in this PR. |
…runtime memory leak
…ip-264-java-runtime-metrics
… issues caused by TestNG memory leaks
lhotari
reviewed
May 6, 2024
lhotari
reviewed
May 6, 2024
Co-authored-by: Lari Hotari <[email protected]>
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PIP-264
Motivation
Adds support for exporting Java runtime metrics via the OpenTelemetry pipeline. For ease of implementation, relies on the built-in OTel library providing this exact functionality. We can add any extra metrics we see fit separately, as deemed necessary.
Modifications
Add and initialize field type
io.opentelemetry.instrumentation.runtimemetrics.java17.RuntimeMetrics
inOpenTelemetryService
. This object exposes the desired runtime metrics. Placing it insideOpenTelemetryService
automatically makes it available for all users of the class (broker, proxy and function workers) without any further work needed. Enable metric collection for all Java features.Some of the metrics are presently marked as experimental (see doc):
jvm.memory.init
,jvm.buffer.memory.usage
,jvm.buffer.memory.limit
,jvm.buffer.count
. Others are exposed only if flagOTEL_SEMCONV_STABILITY_IN
includes valuejvm
. Since they are still useful, enable their collection too.The original (Prometheus) metric list can be consulted here.
For a full description of the semantics of the OpenTelemetry metrics, see this.
jvm.buffer.count
jvm_buffer_pool_used_buffers
jvm.buffer.memory.limit
jvm_buffer_pool_capacity_bytes
jvm.buffer.memory.usage
jvm_buffer_pool_used_bytes
jvm.class.count
jvm_classes_currently_loaded
jvm.class.loaded
jvm_classes_loaded_total
jvm.class.unloaded
jvm_classes_unloaded_total
jvm.cpu.time
process_cpu_seconds_total
jvm.gc.duration
jvm_gc_collection_seconds
jvm.memory.committed
jvm_memory_bytes_committed
jvm.memory.init
jvm_memory_bytes_init
jvm.memory.limit
jvm_memory_bytes_max
jvm.memory.used
jvm_memory_bytes_used
jvm.memory.used_after_last_gc
jvm_memory_pool_allocated_bytes_total
jvm.thread.count
jvm_threads_state, jvm_threads_current and jvm_threads_daemon
Verifying this change
This change added tests and can be verified as follows:
org.apache.pulsar.opentelemetry.OpenTelemetryServiceTest#testJvmRuntimeMetrics
verifying the respective metrics are present at runtime.Does this pull request potentially affect one of the following parts:
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: dragosvictor#18