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

Fix metrics not reporting new values #5781

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

isum
Copy link
Member

@isum isum commented Jan 23, 2025

This PR updates the metric registration mechanism so that the most recent metric registration attempt is considered valid and the previous registration is discarded, fixing a long-standing issue that caused multiple metrics to fail to report new values.

Closes #5758

Context

In the previous implementation, only the first metric registration was considered valid, and all subsequent attempts to create the same metric were internally considered invalid. External modules always get a metric on calls to register, even if the registration fails internally. This was a problem because many operations in graph-node are expected to be executed multiple times, and the limited cleanup of old metrics was not working as expected. The result was that many operations in graph-node had non-working metrics after restarts. An example is the subgraph runner, which silently got unregistered metrics after almost every deployment restart/reassignment.

Testing

I have tested the fix locally and the previously broken metrics are now working as expected. The behavior of previously working metrics has not changed.

@isum isum added the metrics label Jan 23, 2025
@isum isum self-assigned this Jan 23, 2025
@fordN fordN linked an issue Jan 23, 2025 that may be closed by this pull request
@isum isum marked this pull request as ready for review January 23, 2025 18:45
@fordN fordN requested a review from encalypto January 30, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix: ensure recreating metrics works as expected
1 participant