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

OpenTelemetry integration tracking issue #3118

Open
7 tasks
develop7 opened this issue Dec 15, 2023 · 3 comments
Open
7 tasks

OpenTelemetry integration tracking issue #3118

develop7 opened this issue Dec 15, 2023 · 3 comments

Comments

@develop7
Copy link
Collaborator

develop7 commented Dec 15, 2023

An umbrella issue for tracking of OpenTelemetry integration to PostgREST.

  • Get familiar with OTel and terminology
    • Wrap meaningful and measurable actions with OTel spans
  • Get hands dirty by exposing Server-Timing metrics for collection (per the suggestion at Feature Request: metrics or instrumentation #1526 (comment))
  • Collect metrics during loadtest and include these to reports
  • Collect & export memory stats
  • Collect web request/response stats with hs-opentelemetry-instrumentation-wai
  • Wrap hasql to a stats-collecting middleware
@mkleczek
Copy link
Contributor

mkleczek commented Dec 15, 2023

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.

main...mkleczek:postgrest:temp-opentelemetry

@develop7
Copy link
Collaborator Author

@mkleczek whoa, you've got yourself a nice flake.nix too! Seems to be way ahead of #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?

@mkleczek
Copy link
Contributor

It was working last time I tried :)

As mentioned in #3105 (comment) - static binary builds not tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants