diff --git a/backend/adapter_utils.go b/backend/adapter_utils.go index 41528ab5d..57864035f 100644 --- a/backend/adapter_utils.go +++ b/backend/adapter_utils.go @@ -120,6 +120,11 @@ func tracingWrapper(next handlerWrapperFunc) handlerWrapperFunc { func logWrapper(next handlerWrapperFunc) handlerWrapperFunc { return func(ctx context.Context) (RequestStatus, error) { start := time.Now() + + ctxLogger := Logger.FromContext(ctx) + logFunc := ctxLogger.Debug + logFunc("Plugin Request Started") + status, err := next(ctx) logParams := []any{ @@ -133,8 +138,6 @@ func logWrapper(next handlerWrapperFunc) handlerWrapperFunc { logParams = append(logParams, "statusSource", string(errorSourceFromContext(ctx))) - ctxLogger := Logger.FromContext(ctx) - logFunc := ctxLogger.Debug if status > RequestStatusCancelled { logFunc = ctxLogger.Error } diff --git a/backend/log.go b/backend/log.go index fa9a45446..ffef48ccd 100644 --- a/backend/log.go +++ b/backend/log.go @@ -18,7 +18,7 @@ var NewLoggerWith = func(args ...interface{}) log.Logger { } func withContextualLogAttributes(ctx context.Context, pCtx PluginContext) context.Context { - args := []any{"pluginID", pCtx.PluginID} + args := []any{"pluginId", pCtx.PluginID} endpoint := EndpointFromContext(ctx) if !endpoint.IsEmpty() { @@ -26,13 +26,13 @@ func withContextualLogAttributes(ctx context.Context, pCtx PluginContext) contex } if tid := trace.SpanContextFromContext(ctx).TraceID(); tid.IsValid() { - args = append(args, "traceID", tid.String()) + args = append(args, "traceId", tid.String()) } if pCtx.DataSourceInstanceSettings != nil { args = append( args, "dsName", pCtx.DataSourceInstanceSettings.Name, - "dsUID", pCtx.DataSourceInstanceSettings.UID, + "dsUid", pCtx.DataSourceInstanceSettings.UID, ) if pCtx.User != nil { args = append(args, "uname", pCtx.User.Name)