postgrest
postgrest copied to clipboard
OpenTelemetry integration tracking issue
An umbrella issue for tracking of OpenTelemetry integration to PostgREST.
- [x] Get familiar with OTel and terminology
- [ ] Wrap meaningful and measurable actions with OTel spans
- [ ] Get hands dirty by exposing
Server-Timingmetrics for collection (per the suggestion at https://github.com/PostgREST/postgrest/issues/1526#issuecomment-1854668454) - [ ] Collect metrics during loadtest and include these to reports
- [ ] Collect & export memory stats
- [x] Collect web request/response stats with
hs-opentelemetry-instrumentation-wai - [ ] Wrap hasql to a stats-collecting middleware
- [x] Handle and propagate trace ID
I have played with the idea some time ago and have a preliminary implementation. The main goal was to trace SQL statements so it required Hasql adjustments. I also wanted to play with https://hackage.haskell.org/package/effectful to make the whole thing extensible.
As Hasql is a family of projects I had to fork quite a bunch of Hasql repositories.
At the end of the day only minimal changes to Postgrest itself were needed as I was able to replace monomorphic usage of Hasql with polymorphic based on effectful by using Cabal mixins.
Not sure if there is anything interesting there to actually provide a pull request but maybe worth looking at and discussing.
https://github.com/PostgREST/postgrest/compare/main...mkleczek:postgrest:temp-opentelemetry
@mkleczek whoa, you've got yourself a nice flake.nix too! Seems to be way ahead of https://github.com/PostgREST/postgrest/pull/3105 of mine (and working, I presume?). Do you mind us borrowing a thing here and there, or, better yet, you submit a PR with it?
It was working last time I tried :)
As mentioned in https://github.com/PostgREST/postgrest/pull/3105#issuecomment-1863025619 - static binary builds not tested.
Could really do with otel tracing and it looks as though the basics are in https://github.com/PostgREST/postgrest/compare/main...mkleczek:postgrest:temp-opentelemetry
How can I help to get this over the line?