msgtrace

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompilePatterns added in v1.1.5

func CompilePatterns(raw []string) (compiled []*regexp.Regexp, bad []string)

CompilePatterns compiles user-supplied trace patterns from field-map, skipping any that fail to compile (reported via the returned bad list so callers can warn). It never returns an error — a bad custom pattern must not break a query.

func ExtractTrace added in v1.1.5

func ExtractTrace(msg string, extra []*regexp.Regexp) (traceID, spanID string, ok bool)

ExtractTrace pulls a traceId (and spanId when the format carries one) out of a log message. `extra` patterns from field-map are tried before the built-ins so users can teach it a custom shape. A pattern's first capture group is the traceId; a second group, when present, is the spanId. Returns ok=false when no pattern matches.

func ParseBracketIDs

func ParseBracketIDs(msg string) (traceID, spanID string, ok bool)

ParseBracketIDs extracts the MDC bracket-prefix traceId/spanId. Retained as a thin compatibility wrapper over ExtractTrace's first built-in pattern so older call sites keep their exact (bracket-only) semantics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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