tracing

package
v0.0.0-...-611bec0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 33 Imported by: 7

Documentation

Index

Constants

View Source
const (
	CollectorURLEnvVar   = "OCEL_TRACE_COLLECTOR_URL"
	CollectorTokenEnvVar = "OCEL_TRACE_COLLECTOR_TOKEN"
	CollectorPath        = "/v1/traces"
	CollectorMediaType   = "application/x-protobuf"
)
View Source
const (
	ExecutablePathKey   attribute.Key = "process.executable.path"
	CommandArgsKey      attribute.Key = "process.command_args"
	CommandLineKey      attribute.Key = "process.command_line"
	WorkingDirectoryKey attribute.Key = "process.working_directory"
	PIDKey              attribute.Key = "process.pid"
	ExitCodeKey         attribute.Key = "process.exit.code"
	StdoutTailKey       attribute.Key = "process.stdout.tail"
	StderrTailKey       attribute.Key = "process.stderr.tail"
	StdinBytesKey       attribute.Key = "process.stdin.bytes"
)
View Source
const ModeEnvVar = "OCEL_TRACE"
View Source
const Redacted = "[secret]"
View Source
const Scope = "github.com/ocelhq/ocel/pkg/tracing"
View Source
const TailBytes = 8 << 10
View Source
const TraceParentEnvVar = "TRACEPARENT"

Variables

This section is empty.

Functions

func ContextWithTraceParent

func ContextWithTraceParent(ctx context.Context, traceparent string) context.Context

func EndSpan

func EndSpan(span trace.Span, err error)

func NameRPCSpan

func NameRPCSpan(system, service, method string) (string, []attribute.KeyValue)

func NewBaseTransport

func NewBaseTransport() *http.Transport

func NewClient

func NewClient(timeout time.Duration) *http.Client

func NewCollectorProxy

func NewCollectorProxy(c Collector) (http.Handler, error)

func NewTransport

func NewTransport(base http.RoundTripper) http.RoundTripper

func ParentEnv

func ParentEnv(ctx context.Context) []string

func RedactText

func RedactText(s string) string

func RouteTrace

func RouteTrace(id trace.TraceID, provider trace.TracerProvider) (remove func())

func SetCollector

func SetCollector(c Collector)

func StepSpanID

func StepSpanID(call trace.SpanID, step []byte) trace.SpanID

func TraceParent

func TraceParent(ctx context.Context) string

Types

type Cmd

type Cmd struct {
	*exec.Cmd

	ExportsSpans bool
	// contains filtered or unexported fields
}

func Command

func Command(ctx context.Context, name string, args ...string) *Cmd

func CommandContext

func CommandContext(ctx context.Context, name string, args ...string) *Cmd

func (*Cmd) CombinedOutput

func (c *Cmd) CombinedOutput() ([]byte, error)

func (*Cmd) IsExportingSpans

func (c *Cmd) IsExportingSpans() bool

func (*Cmd) Output

func (c *Cmd) Output() ([]byte, error)

func (*Cmd) Run

func (c *Cmd) Run() error

func (*Cmd) SetAttributes

func (c *Cmd) SetAttributes(attrs ...attribute.KeyValue)

func (*Cmd) Start

func (c *Cmd) Start() error

func (*Cmd) StderrPipe

func (c *Cmd) StderrPipe() (io.ReadCloser, error)

func (*Cmd) StdoutPipe

func (c *Cmd) StdoutPipe() (io.ReadCloser, error)

func (*Cmd) Wait

func (c *Cmd) Wait() error

type Collector

type Collector struct {
	URL   string
	Token string
}

func ReadCollector

func ReadCollector() Collector

type Mode

type Mode string
const (
	ModeOn   Mode = "on"
	ModeOff  Mode = "off"
	ModeFull Mode = "full"
)

func ParseMode

func ParseMode(value string) (Mode, error)

func ReadMode

func ReadMode() Mode

type SecretValues

type SecretValues struct {
	// contains filtered or unexported fields
}

func (*SecretValues) Add

func (s *SecretValues) Add(values ...string)

func (*SecretValues) RedactAttributes

func (s *SecretValues) RedactAttributes(attrs []attribute.KeyValue) []attribute.KeyValue

func (*SecretValues) RedactText

func (s *SecretValues) RedactText(text string) string

type Tail

type Tail struct {
	Limit int
	// contains filtered or unexported fields
}

func NewTail

func NewTail(text string) *Tail

func (*Tail) String

func (t *Tail) String() string

func (*Tail) WholeLines

func (t *Tail) WholeLines() string

func (*Tail) Write

func (t *Tail) Write(p []byte) (int, error)

type Transport

type Transport struct {
	Base http.RoundTripper
	Name func(*http.Request) (string, []attribute.KeyValue, bool)
}

func (*Transport) CloseIdleConnections

func (t *Transport) CloseIdleConnections()

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL