-
Notifications
You must be signed in to change notification settings - Fork 1
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
AP-5778 introduce prisma metrics plugin #373
Conversation
this.metrics.gauges[gaugeMetric.key]?.set(gaugeMetric.value) | ||
} | ||
for (const histogramMetric of jsonMetrics.histograms) { | ||
this.metrics.histograms[histogramMetric.key]?.observe(histogramMetric.value.sum) |
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.
not sure what is the proper way to work with histograms, prometheus provide only observe function to pass one number value, while prisma provide 2 values -> sum and count
metricsPrefix: string | ||
} | ||
|
||
function registerMetrics(_prefix: string, jsonMetrics: Metrics): PrometheusMetricsDefinitions { |
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.
_prefix is provided but not used, since all already prefix with prisma_
, but I would leave the value in case we want to use it in future
metrics.counters[metric.key] = new prometheus.Counter({ | ||
name: metric.key, | ||
help: metric.description, | ||
labelNames: ['prisma', 'connection_pool'] as const, |
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.
prisma has its own labels, we can use them instead + add our prisma label, not all metrics are related to connection pool
Changes
Please describe
Checklist
major
,minor
,patch
orskip-release