Skip to content

[FLINK-39790][state/metrics] Fix State latency/size tracking metrics not exported without sampling#28257

Open
Efrat19 wants to merge 1 commit into
apache:masterfrom
Efrat19:state-tracking-not-working-with-sample-interval-of-1
Open

[FLINK-39790][state/metrics] Fix State latency/size tracking metrics not exported without sampling#28257
Efrat19 wants to merge 1 commit into
apache:masterfrom
Efrat19:state-tracking-not-working-with-sample-interval-of-1

Conversation

@Efrat19
Copy link
Copy Markdown
Contributor

@Efrat19 Efrat19 commented May 26, 2026

What is the purpose of the change

Previousely when set to

state.*-track.keyed-state-enabled: true
state.*-track.sample-interval: 1

Metrics were not exported because for sampleInterval of 1, StateMetricBase#loopUpdateCounter will always return 0.

Brief change log

  • StateMetricBase#loopUpdateCounter to always return 1 if sampleInterval = 1

Verifying this change

This change added tests and can be verified as follows:

  • A test to verify datapoint are reported to the histogram even when sampleInterval = 1

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

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

Was generative AI tooling used to co-author this PR?

no

@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented May 26, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@Efrat19
Copy link
Copy Markdown
Contributor Author

Efrat19 commented May 26, 2026

@flinkbot run azure

@Efrat19 Efrat19 force-pushed the state-tracking-not-working-with-sample-interval-of-1 branch 3 times, most recently from 588c12f to e035d38 Compare May 27, 2026 18:41
@Efrat19 Efrat19 changed the title [FLINK-xxx][runtime/metrics] test with SAMPLE_INTERVAL = 1 [FLINK-39790][state/metrics] Fix State latency/size tracking metrics not exported without sampling May 27, 2026
…not exported without sampling

Previousely when set to
state.*-track.keyed-state-enabled: true
state.*-track.sample-interval: 1

metrics are not exported because for sampleInterval of 1, StateMetricBase#loopUpdateCounter will always return 0.
@Efrat19 Efrat19 force-pushed the state-tracking-not-working-with-sample-interval-of-1 branch from e035d38 to 7811eb2 Compare May 28, 2026 05:02
@Efrat19 Efrat19 marked this pull request as ready for review May 28, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants