feat(users/Profpatsch/whatcd-resolver): log json+ld fetching
This traces the target of a json+ld fetch. We also simplify the telemetry stuff by using a pseudo-class `MonadOtel` everywhere. I wonder if we can get rid of passing the span to `assertM`, because it’s kind of an antipattern to be honest. Change-Id: I1448d643c909a29684fa1ae54037177ba2c20639 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11166 Tested-by: BuildkiteCI Autosubmit: Profpatsch <mail@profpatsch.de> Reviewed-by: Profpatsch <mail@profpatsch.de>
This commit is contained in:
parent
0b06dda9a6
commit
981c7fef0e
4 changed files with 98 additions and 71 deletions
|
|
@ -543,11 +543,11 @@ traceQueryIfEnabled tools span logDatabaseQueries qry params = do
|
|||
Otel.addAttributes
|
||||
span
|
||||
$ HashMap.fromList
|
||||
$ ( ("postgres.query", Otel.toAttribute @Text errs.query)
|
||||
$ ( ("_.postgres.query", Otel.toAttribute @Text errs.query)
|
||||
: ( errs.explain
|
||||
& foldMap
|
||||
( \ex ->
|
||||
[("postgres.explain", Otel.toAttribute @Text ex)]
|
||||
[("_.postgres.explain", Otel.toAttribute @Text ex)]
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue