mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
various bugfixes and improvements
This commit is contained in:
parent
e221c8af84
commit
51fa483885
12 changed files with 819 additions and 306 deletions
32
internal/telemetry/trace/debug.go
Normal file
32
internal/telemetry/trace/debug.go
Normal file
|
@ -0,0 +1,32 @@
|
|||
package trace
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
)
|
||||
|
||||
type stackTraceProcessor struct{}
|
||||
|
||||
// ForceFlush implements trace.SpanProcessor.
|
||||
func (s *stackTraceProcessor) ForceFlush(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// OnEnd implements trace.SpanProcessor.
|
||||
func (*stackTraceProcessor) OnEnd(s sdktrace.ReadOnlySpan) {
|
||||
}
|
||||
|
||||
// OnStart implements trace.SpanProcessor.
|
||||
func (*stackTraceProcessor) OnStart(parent context.Context, s sdktrace.ReadWriteSpan) {
|
||||
_, file, line, _ := runtime.Caller(2)
|
||||
s.SetAttributes(attribute.String("caller", fmt.Sprintf("%s:%d", file, line)))
|
||||
}
|
||||
|
||||
// Shutdown implements trace.SpanProcessor.
|
||||
func (s *stackTraceProcessor) Shutdown(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue