mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
Server: Format Tracing values to string
GitOrigin-RevId: eaa5aba0bc283f36870910671e3336aca0ea8222
This commit is contained in:
parent
5850423aa6
commit
f6fbf20b80
@ -39,6 +39,7 @@ In the future, we will probably offer a way to explicitly choose which behaviour
|
||||
- server: add a new `/dev/rts_stats` endpoint, enabled when hasura is started with '+RTS -T'
|
||||
- server: re-enable a default HASURA_GRAPHQL_PG_CONN_LIFETIME of 10min
|
||||
- server: support for bigquery datasets
|
||||
- server: format the values of `injectEventContext` as hexadecimal string instead of integer (fix #6465)
|
||||
- console: add custom_column_names to track_table request with replaced invalid characters (#992)
|
||||
- console: add details button to the success notification to see inserted row
|
||||
- console: add request preview for REST endpoints
|
||||
|
@ -247,8 +247,8 @@ extractHttpContext hdrs = do
|
||||
injectEventContext :: TraceContext -> J.Value
|
||||
injectEventContext TraceContext{..} =
|
||||
J.object
|
||||
[ "trace_id" J..= tcCurrentTrace
|
||||
, "span_id" J..= tcCurrentSpan
|
||||
[ "trace_id" J..= word64ToHex tcCurrentTrace
|
||||
, "span_id" J..= word64ToHex tcCurrentSpan
|
||||
]
|
||||
|
||||
-- | Extract a trace context from an event trigger payload.
|
||||
@ -256,9 +256,9 @@ extractEventContext :: J.Value -> IO (Maybe TraceContext)
|
||||
extractEventContext e = do
|
||||
freshSpanId <- liftIO Rand.randomIO
|
||||
pure $ TraceContext
|
||||
<$> (e ^? JL.key "trace_context" . JL.key "trace_id" . JL._Integral)
|
||||
<$> (hexToWord64 =<< e ^? JL.key "trace_context" . JL.key "trace_id" . JL._String)
|
||||
<*> pure freshSpanId
|
||||
<*> pure (e ^? JL.key "trace_context" . JL.key "span_id" . JL._Integral)
|
||||
<*> pure (hexToWord64 =<< e ^? JL.key "trace_context" . JL.key "span_id" . JL._String)
|
||||
|
||||
-- | Perform HTTP request which supports Trace headers
|
||||
tracedHttpRequest
|
||||
|
Loading…
Reference in New Issue
Block a user