-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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(core): Respect prefix for all Prometheus metrics #10130
Conversation
} | ||
|
||
disableAllLabels() { | ||
for (const label of Object.keys(this.includes.labels) as MetricLabel[]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we not use a for-in
loop here instead of a for-of
on Object.keys
?
metrics: { | ||
default: config.getEnv('endpoints.metrics.includeDefaultMetrics'), | ||
api: config.getEnv('endpoints.metrics.includeApiEndpoints'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a breaking change 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you mean? This is an internal implementation detail, the schema path and the env remain the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this not change the metric name that gets scraped by prometheus?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's what you mean. Since we advertise this as experimental I take it this is okay to change, but I can add a mention just in case.
}); | ||
} | ||
|
||
private addPrefixToMetrics(metrics: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we make this public and add unit tests just for this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is covered by integration tests containing the n8n_test_
prefix.
3 flaky tests on run #6064 ↗︎
Details:
5-ndv.cy.ts • 2 flaky tests
10-undo-redo.cy.ts • 1 flaky test
Review all test suite changes for PR #10130 ↗︎ |
✅ All Cypress E2E specs passed |
Got released with |
Prometheus metrics from
express-prom-bundle
andprom-client
were not respectingN8N_METRICS_PREFIX