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

[dvc][fc][tc] Lazily register client-side metrics #1104

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

kvargha
Copy link
Contributor

@kvargha kvargha commented Aug 8, 2024

Summary

Unused metrics result in excessive WARN log messages. By registering metrics only when they are recorded, this issue is avoided.

How was this PR tested?

CI

Does this PR introduce any user-facing changes?

  • No. You can skip the rest of this section.
  • Yes. Make sure to explain your proposed changes and call out the behavior change.

@@ -109,14 +110,14 @@ public class IngestionStats {

/** Record a version-level offset rewind events for VTs across all stores. */
private final Count versionTopicEndOffsetRewindCount = new Count();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to do this one too?

@ZacAttack
Copy link
Contributor

Is there a rhyme or reason to which metrics we did this fix for? I think it's non exhaustive?

@@ -207,6 +211,17 @@ public IngestionStats(VeniceServerConfig serverConfig) {
registerSensor(localMetricRepository, OFFSET_REGRESSION_DCR_ERROR, offsetRegressionDCRErrorSensor);
registerSensor(localMetricRepository, TOMBSTONE_CREATION_DCR, tombstoneCreationDCRSensor);
registerSensor(localMetricRepository, IDLE_TIME, idleTimeSensor);

transformerLatencySensor = new WritePathLatencySensor(localMetricRepository, METRIC_CONFIG, TRANSFORMER_LATENCY);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused here. Why are some of these lazy and some not? When do these get registered?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some metrics are required to be registered by some unit/integration tests by asserting that their value is 0. Should I modify the tests to assert that the sensor be null instead?

The underlying sensor inside WritePathLatencySensor is registered as lazy, but when a record is called on it the sensor will be registered.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's ok to edit tests if the behavior no longer matches up. I think we should be uniform here unless theres a valid reason to not do so.

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