-
Notifications
You must be signed in to change notification settings - Fork 327
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 prometheus duplicated metrics #6911
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
json-machete |
0.97.3-alpha-20240508110504-0393f55302cc850bd572c5d129d8273595191835 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/json-schema |
0.100.5-alpha-20240508110504-0393f55302cc850bd572c5d129d8273595191835 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/openapi |
0.100.6-alpha-20240508110504-0393f55302cc850bd572c5d129d8273595191835 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/raml |
0.100.5-alpha-20240508110504-0393f55302cc850bd572c5d129d8273595191835 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/json-schema |
0.100.5-alpha-20240508110504-0393f55302cc850bd572c5d129d8273595191835 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/openapi |
0.100.6-alpha-20240508110504-0393f55302cc850bd572c5d129d8273595191835 |
npm ↗︎ unpkg ↗︎ |
@omnigraph/raml |
0.100.5-alpha-20240508110504-0393f55302cc850bd572c5d129d8273595191835 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-prometheus |
0.100.0-alpha-20240508110504-0393f55302cc850bd572c5d129d8273595191835 |
npm ↗︎ unpkg ↗︎ |
💻 Website PreviewThe latest changes are available as preview in: https://837e7875.graphql-mesh.pages.dev |
EmrysMyrddin
force-pushed
the
fix-prometheus-duplicated-metrics
branch
from
May 7, 2024 14:56
1da808c
to
2bb1729
Compare
EmrysMyrddin
force-pushed
the
fix-prometheus-duplicated-metrics
branch
from
May 8, 2024 09:33
934c2eb
to
8a38ab2
Compare
EmrysMyrddin
force-pushed
the
fix-prometheus-duplicated-metrics
branch
from
May 8, 2024 11:00
e68ea09
to
f48789e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When polling is enabled, a new Mesh instance is created in the same Node run. This means the plugins are initialized again, which for the Prometheus plugin means we are trying to register metrics again on the same registry. But this is not something possible with the
prom-client
API.Fixes #6545
Type of change
expected)
Further comments
The actual fix is the addition of a metrics objects (Histogram, Counter and Summary) cache based on registry instance and metric name. The actual implementation of this is done in the base envelop plugin (see n1ru4l/envelop#2217).
For this to actually work, we had to change the API to customize metrics config, but since this was not exposed by the Mesh plugin, this is not an actual breaking change for the Mesh variant plugin.