All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 1m18s
17 lines
384 B
Go
17 lines
384 B
Go
package core
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"go.opentelemetry.io/otel/attribute"
|
|
"go.opentelemetry.io/otel/trace"
|
|
)
|
|
|
|
func UpdateSpan(r *http.Request) {
|
|
currentSpan := trace.SpanFromContext(r.Context())
|
|
if currentSpan != nil {
|
|
currentSpan.SetAttributes(attribute.String("http.pattern", r.Pattern))
|
|
currentSpan.SetAttributes(attribute.String("http.pattern.id", r.PathValue("id")))
|
|
}
|
|
}
|