-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduces producing OpenTelemetry traces with hs-opentelemetry. * Adds OTel spans over the whole application loop and over each request processing phase * Preliminary OTel tracing support in spec tests
- Loading branch information
Showing
14 changed files
with
358 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
index-state: hackage.haskell.org 2024-11-10T13:08:54Z | ||
index-state: hackage.haskell.org 2024-11-25T13:43:26Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module PostgREST.OpenTelemetry (withTracer) where | ||
|
||
import OpenTelemetry.Attributes (emptyAttributes) | ||
import OpenTelemetry.Trace (InstrumentationLibrary (..), Tracer, | ||
initializeGlobalTracerProvider, | ||
makeTracer, shutdownTracerProvider, | ||
tracerOptions) | ||
import PostgREST.Version (prettyVersion) | ||
import Protolude | ||
|
||
withTracer :: Text -> (Tracer -> IO c) -> IO c | ||
withTracer label f = bracket | ||
initializeGlobalTracerProvider | ||
shutdownTracerProvider | ||
(\tracerProvider -> f $ makeTracer tracerProvider instrumentationLibrary tracerOptions) | ||
where | ||
instrumentationLibrary = | ||
InstrumentationLibrary | ||
{ libraryName = label | ||
, libraryVersion = decodeUtf8 prettyVersion | ||
, librarySchemaUrl = "" | ||
, libraryAttributes = emptyAttributes} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.