Skip to content

Conversation

@ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Mar 20, 2025

Why this should be merged

The metrics.Enabled global is misleadingly named and disables constructors, not individual metrics when they're used. This resulted in all ava-labs/coreth metrics being no-ops because it was only set to true after they were all constructed. As the majority of metrics are globals, they're created during package initialisation so simply setting metrics.Enabled = true somewhere in coreth isn't a guarantee of ordering. The old coreth/metrics package simply set the global to true by default.

How this works

metrics.Enabled = true at the point of declaration.

How this was tested

Local inspection of metrics on a running binary.

@ARR4N ARR4N enabled auto-merge (squash) March 20, 2025 14:48
@ARR4N ARR4N requested a review from a team March 20, 2025 14:48
@ARR4N ARR4N merged commit 7be6bee into main Mar 20, 2025
11 checks passed
@ARR4N ARR4N deleted the arr4n/enable-metrics branch March 20, 2025 15:24
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