-
Notifications
You must be signed in to change notification settings - Fork 819
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
feat: Add prometheus exporter #483
feat: Add prometheus exporter #483
Conversation
Codecov Report
@@ Coverage Diff @@
## master #483 +/- ##
==========================================
- Coverage 92.03% 90.47% -1.56%
==========================================
Files 138 144 +6
Lines 6264 7237 +973
Branches 527 640 +113
==========================================
+ Hits 5765 6548 +783
- Misses 499 689 +190
|
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 a great start, added a few comments in the first pass.
…s-contrib/opentelemetry-js into add-prometheus-exporter-dan
…s-contrib/opentelemetry-js into add-prometheus-exporter-dan
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.
Thank you @dyladan for this PR and for addressing my feedback! LGTM!
* @param name name to be sanitized | ||
*/ | ||
private _sanitizePrometheusMetricName(name: string): string { | ||
return name.replace(this._invalidCharacterRegex, '_'); // replace all invalid characters with '_' |
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 it possible this could cause duplicates? Should we write a warning in that case (could be a follow up task)?
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.
We could replace period with __DOT__
or similar
* feat: add responseHook config to redis instrumentation * fix: lint fix * feat: add responseHook config to redis instrumentation * fix: lint fix * chore(deps): update all non-major dependencies (open-telemetry#483) * chore: generalize the instrumentation file name (open-telemetry#479) * feat: add responseHook config to graphql instrumentation * Apply suggestions from code review Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com> * test: add a test for a responseHook that isn't a function * fix: lint fix Co-authored-by: WhiteSource Renovate <bot@renovateapp.com> Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com> Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
Which problem is this PR solving?
With #482 this now provides an end-to-end metrics story
Short description of the changes
Adds a metrics exporter for the prometheus backend. In its current state, the exporter maintains an internal state with the values of all exported metrics, which is then returned when an endpoint is called by Prometheus.