diff --git a/server/src-lib/Hasura/Eventing/EventTrigger.hs b/server/src-lib/Hasura/Eventing/EventTrigger.hs index 60120b1d203..fa6c7e862d3 100644 --- a/server/src-lib/Hasura/Eventing/EventTrigger.hs +++ b/server/src-lib/Hasura/Eventing/EventTrigger.hs @@ -210,7 +210,7 @@ processEventQueue logger logenv httpMgr pool getSchemaCache eeCtx@EventEngineCtx Tracing.runTraceTInContext tracingCtx t <- processEvent event - & runTraceT "Event trigger" + & runTraceT "process event" & withEventEngineCtx eeCtx & flip runReaderT (logger, httpMgr) & LA.async diff --git a/server/src-lib/Hasura/Eventing/ScheduledTrigger.hs b/server/src-lib/Hasura/Eventing/ScheduledTrigger.hs index 81853564b3f..bc7e00b1bae 100644 --- a/server/src-lib/Hasura/Eventing/ScheduledTrigger.hs +++ b/server/src-lib/Hasura/Eventing/ScheduledTrigger.hs @@ -376,7 +376,7 @@ processCronEvents logger logEnv httpMgr pgpool getSC lockedCronEvents = do ctiRetryConf ctiHeaders ctiComment - finally <- Tracing.runTraceT "Scheduled event" . runExceptT $ + finally <- Tracing.runTraceT "scheduled event" . runExceptT $ runReaderT (processScheduledEvent logEnv pgpool scheduledEvent CronScheduledEvent) (logger, httpMgr) removeEventFromLockedEvents id' lockedCronEvents either logInternalError pure finally @@ -431,7 +431,7 @@ processStandAloneEvents env logger logEnv httpMgr pgpool lockedStandAloneEvents retryConf headerInfo' comment - finally <- Tracing.runTraceT "Scheduled event" . runExceptT $ + finally <- Tracing.runTraceT "scheduled event" . runExceptT $ runReaderT (processScheduledEvent logEnv pgpool scheduledEvent StandAloneEvent) $ (logger, httpMgr) removeEventFromLockedEvents id' lockedStandAloneEvents diff --git a/server/src-lib/Hasura/GraphQL/Resolve/Action.hs b/server/src-lib/Hasura/GraphQL/Resolve/Action.hs index 169333c8fcb..5eea760108d 100644 --- a/server/src-lib/Hasura/GraphQL/Resolve/Action.hs +++ b/server/src-lib/Hasura/GraphQL/Resolve/Action.hs @@ -428,7 +428,7 @@ asyncActionsProcessor env logger cacheRef pgPool httpManager = forever $ do either mempty return res callHandler :: ActionCache -> ActionLogItem -> m () - callHandler actionCache actionLogItem = Tracing.runTraceT "Async actions processor" do + callHandler actionCache actionLogItem = Tracing.runTraceT "async actions processor" do let ActionLogItem actionId actionName reqHeaders sessionVariables inputPayload = actionLogItem case Map.lookup actionName actionCache of diff --git a/server/src-lib/Hasura/GraphQL/Transport/HTTP.hs b/server/src-lib/Hasura/GraphQL/Transport/HTTP.hs index 451340ea053..70cd3e37ae9 100644 --- a/server/src-lib/Hasura/GraphQL/Transport/HTTP.hs +++ b/server/src-lib/Hasura/GraphQL/Transport/HTTP.hs @@ -168,12 +168,12 @@ runHasuraGQ runHasuraGQ reqId (query, queryParsed) userInfo resolvedOp = do (E.ExecutionCtx logger _ pgExecCtx _ _ _ _ _) <- ask (telemTimeIO, respE) <- withElapsedTime $ runExceptT $ case resolvedOp of - E.ExOpQuery tx genSql asts -> trace "Query" $ do + E.ExOpQuery tx genSql asts -> trace "pg" $ do -- log the generated SQL and the graphql query logQueryLog logger query genSql reqId Tracing.interpTraceT id $ executeQuery queryParsed asts genSql pgExecCtx Q.ReadOnly tx - E.ExOpMutation respHeaders tx -> trace "Mutation" $ do + E.ExOpMutation respHeaders tx -> trace "pg" $ do logQueryLog logger query Nothing reqId ctx <- Tracing.currentContext (respHeaders,) <$> Tracing.interpTraceT (runLazyTx pgExecCtx Q.ReadWrite . withTraceContext ctx . withUserInfo userInfo) tx diff --git a/server/src-lib/Hasura/GraphQL/Transport/WebSocket.hs b/server/src-lib/Hasura/GraphQL/Transport/WebSocket.hs index 57ce18cbdd2..a50e1ab8801 100644 --- a/server/src-lib/Hasura/GraphQL/Transport/WebSocket.hs +++ b/server/src-lib/Hasura/GraphQL/Transport/WebSocket.hs @@ -363,11 +363,11 @@ onStart env serverEnv wsConn (StartMsg opId q) = catchAndIgnore $ do -> E.ExecOp (Tracing.TraceT (LazyTx QErr)) -> ExceptT () m () runHasuraGQ timerTot telemCacheHit reqId query queryParsed userInfo = \case - E.ExOpQuery opTx genSql asts -> Tracing.trace "Query" $ + E.ExOpQuery opTx genSql asts -> Tracing.trace "pg" $ execQueryOrMut Telem.Query genSql . fmap snd $ Tracing.interpTraceT id $ executeQuery queryParsed asts genSql pgExecCtx Q.ReadOnly opTx -- Response headers discarded over websockets - E.ExOpMutation _ opTx -> Tracing.trace "Mutation" do + E.ExOpMutation _ opTx -> Tracing.trace "pg" do execQueryOrMut Telem.Mutation Nothing $ Tracing.interpTraceT (runLazyTx pgExecCtx Q.ReadWrite . withUserInfo userInfo) opTx E.ExOpSubs lqOp -> do @@ -524,7 +524,7 @@ onMessage -> AuthMode -> WSServerEnv -> WSConn -> BL.ByteString -> m () -onMessage env authMode serverEnv wsConn msgRaw = Tracing.runTraceT "Websocket" do +onMessage env authMode serverEnv wsConn msgRaw = Tracing.runTraceT "websocket" do case J.eitherDecode msgRaw of Left e -> do let err = ConnErrMsg $ "parsing ClientMessage failed: " <> T.pack e diff --git a/server/src-lib/Hasura/Server/Auth.hs b/server/src-lib/Hasura/Server/Auth.hs index 1a9e6cf5fac..4e17d612e32 100644 --- a/server/src-lib/Hasura/Server/Auth.hs +++ b/server/src-lib/Hasura/Server/Auth.hs @@ -164,7 +164,7 @@ setupAuthMode mAdminSecretHash mWebHook mJwtSecret mUnAuthRole httpManager logge -- header), do not start a background thread for refreshing the JWK getJwkFromUrl url = do ref <- liftIO $ newIORef $ JWKSet [] - maybeExpiry <- withJwkError $ Tracing.runTraceT "JWK init" $ updateJwkRef logger httpManager url ref + maybeExpiry <- withJwkError $ Tracing.runTraceT "jwk init" $ updateJwkRef logger httpManager url ref case maybeExpiry of Nothing -> return ref Just time -> do diff --git a/server/src-lib/Hasura/Server/Auth/JWT.hs b/server/src-lib/Hasura/Server/Auth/JWT.hs index 12c85e7b6c6..a489606ec54 100644 --- a/server/src-lib/Hasura/Server/Auth/JWT.hs +++ b/server/src-lib/Hasura/Server/Auth/JWT.hs @@ -136,7 +136,7 @@ jwkRefreshCtrl -> m void jwkRefreshCtrl logger manager url ref time = do liftIO $ C.sleep time - forever $ Tracing.runTraceT "JWK refresh" do + forever $ Tracing.runTraceT "jwk refresh" do res <- runExceptT $ updateJwkRef logger manager url ref mTime <- either (const $ logNotice >> return Nothing) return res -- if can't parse time from header, defaults to 1 min diff --git a/server/src-rsr/initialise.sql b/server/src-rsr/initialise.sql index 0ea913bbb81..076ff1ea3c7 100644 --- a/server/src-rsr/initialise.sql +++ b/server/src-rsr/initialise.sql @@ -303,7 +303,7 @@ CREATE TABLE hdb_catalog.event_log tries INTEGER NOT NULL DEFAULT 0, created_at TIMESTAMP DEFAULT NOW(), /* when locked IS NULL the event is unlocked and can be processed */ - locked TIMESTAMP, + locked TIMESTAMPTZ, next_retry_at TIMESTAMP, archived BOOLEAN NOT NULL DEFAULT FALSE ); diff --git a/server/src-rsr/migrations/37_to_38.sql b/server/src-rsr/migrations/37_to_38.sql index 0d07dc3f9a0..ba366b6ca82 100644 --- a/server/src-rsr/migrations/37_to_38.sql +++ b/server/src-rsr/migrations/37_to_38.sql @@ -1,3 +1,3 @@ ALTER TABLE hdb_catalog.event_log ALTER COLUMN locked DROP DEFAULT; ALTER TABLE hdb_catalog.event_log ALTER COLUMN locked DROP NOT NULL; -ALTER TABLE hdb_catalog.event_log ALTER COLUMN locked TYPE TIMESTAMP USING CASE WHEN locked THEN NOW() ELSE NULL END; \ No newline at end of file +ALTER TABLE hdb_catalog.event_log ALTER COLUMN locked TYPE TIMESTAMPTZ USING CASE WHEN locked THEN NOW() ELSE NULL END; \ No newline at end of file