[LIVY-1070] Gate session metrics behind livy.server.session-metrics.enabled - #553
Open
samuhasavak5 wants to merge 1 commit into
Open
[LIVY-1070] Gate session metrics behind livy.server.session-metrics.enabled#553samuhasavak5 wants to merge 1 commit into
samuhasavak5 wants to merge 1 commit into
Conversation
…nabled Follow-up to apache#543. Add livy.server.session-metrics.enabled (default false) so livy.sessions.* gauges are only registered when explicitly enabled. Document opt-in behavior in rest-api.md and livy.conf.template.
Contributor
Author
|
@roczei , @gyogal , @nileshrathi345 and @ArnavBalyan Thanks..!!!! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
This PR adds an opt-in configuration flag for LIVY-1070 session monitoring gauges (follow-up to #543).
Problem: PR #543 always registers
LivySessionMetricsat server startup. Operators and downstream distributions need per-deployment control — session gauges should be disabled by default and enabled only when monitoring is desired.Solution: Introduce
livy.server.session-metrics.enabled(defaultfalse). Whentrue,LivySessionMetrics.register()runs at startup (same behavior as #543). Whenfalse, the/metrics/metricsservlet remains available butlivy.sessions.*gauges are not published.Changes
SESSION_METRICS_ENABLEDconfig entryLivySessionMetrics.register()behind config flag/metrics/metricsNo changes to
LivySessionMetrics.scala— the 18 gauges implementation remains as merged in #543.Configuration
Default: opt-in disabled
livy.server.session-metrics.enabled=false
Enable session gauges (same 18 gauges as #543)
livy.server.session-metrics.enabled=true
Behavior when enabled (
livy.server.session-metrics.enabled=true)Same 18 gauges as #543:
Overall (3)
livy.sessions.totallivy.sessions.active.totallivy.sessions.terminal.totalInteractive (8)
livy.sessions.interactive.totallivy.sessions.interactive.{idle,busy,starting,shutting_down,dead,error,killed}Batch (7)
livy.sessions.batch.totallivy.sessions.batch.{starting,running,success,dead,error,killed}Design notes
false— opt-in per deploymentgetValuereturns0on exceptionCompatibility
/metricsAdminServletlivy.server.session-metrics.enabled=trueto enable themJIRA: https://issues.apache.org/jira/browse/LIVY-1070
How was this patch tested?
Build
mvn package -Pspark3 -Pscala-2.12 -pl server -am
-s /tmp/livy-mvn-central-settings.xml -DskipTests
Result: BUILD SUCCESS
Unit tests
mvn test -Pspark3 -Pscala-2.12 -pl server
-s /tmp/livy-mvn-central-settings.xml
-Dsuites=org.apache.livy.server.LivySessionMetricsSpec
Result: 9/9 tests passed
Code coverage
JaCoCo agent enabled during test run (
server/target/jacoco/main.execgenerated).No UI changes in this PR.
Was this patch authored or co-authored using generative AI tooling?
Yes, this was co-authored using Cursor to help generate the new test case and documentation.