typelevel / skunk

A data access library for Scala + Postgres.
https://typelevel.org/skunk/
MIT License
1.59k stars 163 forks source link

Metric to track Postgres errors #1127

Open matthughes opened 2 months ago

matthughes commented 2 months ago

I'd love a counter metric that tracked every Postgres error Skunk raises. I could take a stab at a PR if there is interest and you think this fits the project's goals.

iRevive commented 2 months ago

https://opentelemetry.io/docs/specs/semconv/database/database-metrics/ - there are official database semantic conventions, but they are still in the 'experimental' / 'development' state. But they should be marked stable, presumably this year.

We can follow the convention even for the draft implementation.

iRevive commented 2 months ago

There is an experimental generation of instruments from semantic conventions: https://github.com/typelevel/otel4s/pull/764.

If we merge it, we can use it to test the implementation.