Skip to content
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

Merged
merged 11 commits into from
Oct 30, 2024

Conversation

Dosexe
Copy link
Collaborator

@Dosexe Dosexe commented Oct 29, 2024

Changes

Please describe

Checklist

  • Apply one of following labels; major, minor, patch or skip-release
  • I've updated the documentation, or no changes were necessary
  • I've updated the tests, or no changes were necessary

@Dosexe Dosexe added the minor label Oct 29, 2024
this.metrics.gauges[gaugeMetric.key]?.set(gaugeMetric.value)
}
for (const histogramMetric of jsonMetrics.histograms) {
this.metrics.histograms[histogramMetric.key]?.observe(histogramMetric.value.sum)
Copy link
Collaborator Author

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

@Dosexe Dosexe marked this pull request as ready for review October 30, 2024 12:03
metricsPrefix: string
}

function registerMetrics(_prefix: string, jsonMetrics: Metrics): PrometheusMetricsDefinitions {
Copy link
Collaborator Author

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,
Copy link
Collaborator Author

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

@Dosexe Dosexe merged commit 6e9feb5 into main Oct 30, 2024
4 checks passed
@Dosexe Dosexe deleted the feature/AP-5778_prisma_metrics_plugin branch October 30, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants