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

feat: Expose pgxpool metrics #18

Closed
wants to merge 3 commits into from
Closed

Conversation

KasonBraley
Copy link

Adapted from https://github.com/nhatthm/otelsql, this change allows pgxpool stats to be collected and then exposed through the OpenTelemetry metrics API.

Uses the new Metrics API released in v0.35.0 -
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.12.0.

Adapted from https://github.com/nhatthm/otelsql, this change allows pgxpool stats
to be collected and then exposed through the OpenTelemetry metrics API.

Uses the new Metrics API released in v0.35.0 -
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.12.0.
@costela
Copy link
Member

costela commented Feb 22, 2023

We're a bit swamped at the moment and couldn't find the time to give this PR the proper attention. But we'll get to it eventually!

@batazor
Copy link

batazor commented Oct 29, 2023

@costela hi, I could use this feature, maybe we can look into it now?

@obitech
Copy link
Member

obitech commented Jan 19, 2024

I'm sorry for keeping you waiting for so long. I gotta admit I'm having trouble reviewing and testing this because we don't use the OTEL metrics interfaces internally, only Prometheus via https://github.com/prometheus/client_golang.

Would you be able to include an example (either here, or in the README) on how to make this work with Prometheus? Then I'd have an easier time testing this. Thank you!

@obitech obitech requested a review from costela January 19, 2024 15:11
@KasonBraley
Copy link
Author

I'm sorry for keeping you waiting for so long. I gotta admit I'm having trouble reviewing and testing this because we don't use the OTEL metrics interfaces internally, only Prometheus via https://github.com/prometheus/client_golang.

Would you be able to include an example (either here, or in the README) on how to make this work with Prometheus? Then I'd have an easier time testing this. Thank you!

Yes I can do that. If you are just asking for the metrics to ultimately end up in Prometheus server, that would be accomplished with the OTEL Collector. Using either the prometheusexporter, or the prometheusremotewriteexporter. Prometheus has also recently added support for native OTLP ingestion, although I have not used it and unaware of it's stability.

I'll have to dig up some concrete configuration examples of how to use the OTEL collector to send the OTLP metrics to Prometheus, the links provide most of the examples, but I will get to it eventually.

@onordgren
Copy link

Hey! We're also interested in this. Any work remaining to get this merged into main?

@KasonBraley
Copy link
Author

Closing in favor of #43.

@KasonBraley KasonBraley closed this Dec 6, 2024
@KasonBraley KasonBraley deleted the metrics branch December 6, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants