Skip to content

Commit

Permalink
wip: update context
Browse files Browse the repository at this point in the history
Signed-off-by: David Wertenteil <dwertent@armosec.io>
  • Loading branch information
David Wertenteil committed Jun 3, 2023
1 parent e6b60a1 commit 7b5a715
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion httphandler/handlerequests/v1/prometheus.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package v1

import (
"context"
"fmt"
"net/http"
"os"
Expand All @@ -12,6 +13,7 @@ import (
"github.com/kubescape/kubescape/v2/core/cautils/getter"
apisv1 "github.com/kubescape/opa-utils/httpserver/apis/v1"
utilsapisv1 "github.com/kubescape/opa-utils/httpserver/apis/v1"
"go.opentelemetry.io/otel/trace"

"github.com/google/uuid"
)
Expand All @@ -34,7 +36,7 @@ func (handler *HTTPHandler) Metrics(w http.ResponseWriter, r *http.Request) {
scanInfo: scanInfo,
scanID: scanID,
}
scanParams.ctx = r.Context()
scanParams.ctx = trace.ContextWithSpanContext(context.Background(), trace.SpanContextFromContext(r.Context()))

handler.scanResponseChan.set(scanID) // add scan to channel
defer handler.scanResponseChan.delete(scanID)
Expand Down

0 comments on commit 7b5a715

Please sign in to comment.