Skip to content

Publish process-wide metrics in Flink runner - #182

Merged
cirquare merged 1 commit into
li-release-2.75from
yf186035/beam-2.75-phase4b-global-metrics
Oct 6, 2026
Merged

cirquare merged 1 commit into
li-release-2.75from
yf186035/beam-2.75-phase4b-global-metrics

Conversation

@cirquare

@cirquare cirquare commented Oct 6, 2026

Copy link
Copy Markdown

Summary

Publish Beam 2.75 process-wide metrics through the Flink runner's metric bridge. FlinkMetricContainerBase now owns a process-wide MetricsContainerImpl, installs it via Beam's existing MetricsEnvironment.setProcessWideContainer(...), and forwards that container's counters, gauges, and distributions to Flink metrics during updateMetrics(...).

This intentionally uses Beam 2.75's process-wide metrics model instead of restoring the old LI global-container API. Ordinary unscoped public Metrics.* calls from unmanaged callback threads remain unchanged and are not implicitly promoted to process-wide metrics.

Testing Done

  • ./gradlew :runners:flink:1.20:test --tests org.apache.beam.runners.flink.metrics.FlinkMetricContainerTest.testProcessWideMetrics --no-daemon -Dorg.gradle.java.home=$(/usr/libexec/java_home -v 11.0.21)
  • ./gradlew :runners:flink:1.20:test --tests org.apache.beam.runners.flink.metrics.FlinkMetricContainerTest.testProcessWideMetrics --tests org.apache.beam.runners.flink.metrics.FlinkMetricContainerTest.testProcessWideMetricsArePublishedOnlyByOwningContainer --no-daemon -Dorg.gradle.java.home=$(/usr/libexec/java_home -v 11.0.21)
  • ./gradlew :runners:flink:1.20:test :runners:flink:2.2:test --tests org.apache.beam.runners.flink.metrics.FlinkMetricContainerTest --no-daemon -Dorg.gradle.java.home=$(/usr/libexec/java_home -v 11.0.21)
  • ./gradlew :runners:flink:1.20:build :runners:flink:2.2:build --no-daemon -Dorg.gradle.java.home=$(/usr/libexec/java_home -v 11.0.21)
  • ./gradlew :runners:flink:1.19:build :runners:flink:2.0:build :runners:flink:2.1:build --no-daemon -Dorg.gradle.java.home=$(/usr/libexec/java_home -v 11.0.21)
  • Focused flink-li-framework metrics reporter compatibility tests: ./gradlew :flink-li-metrics:test --tests com.linkedin.flink.metrics.reporter.TestOpenTelemetryMetricReporter.testNotifyOfAddedMetricCounter --tests com.linkedin.flink.metrics.reporter.TestOpenTelemetryMetricReporter.testNotifyOfAddedMetricGauge --tests com.linkedin.flink.metrics.reporter.TestOpenTelemetryMetricRegistry.testRegisterCounter --tests com.linkedin.flink.metrics.reporter.TestOpenTelemetryMetricRegistry.testRegisterGauge
  • git diff --check
  • Attempted ./gradlew build --no-daemon -Dorg.gradle.java.home=$(/usr/libexec/java_home -v 11.0.21), but it is blocked before tests by the local missing Go/Prism prerequisite: :runners:prism:goPrepare requires Go > 1.16.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@cirquare
cirquare marked this pull request as ready for review October 6, 2026 21:39
@cirquare
cirquare merged commit 87e4508 into li-release-2.75 Oct 6, 2026
1 check passed
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.

1 participant