Documentation
¶
Index ¶
- Constants
- func AnyValueToString(v *dash0api.AnyValue) string
- func DefaultScopeVersion() string
- func DerefHexBytes(b *[]byte) string
- func DerefInt64(i *int64) string
- func DerefString(s *string) string
- func FindAttribute(attrs []dash0api.KeyValue, key string) string
- func MergeAttributes(attrSlices ...[]dash0api.KeyValue) []dash0api.KeyValue
- func ParseKeyValuePairs(pairs []string) (map[string]string, error)
- func ParseSpanID(s string) (pcommon.SpanID, error)
- func ParseTraceID(s string) (pcommon.TraceID, error)
- func ResolveScopeDefaults(cmd *cobra.Command, scopeName *string, scopeVersion *string)
- func SeverityNumberToRange(n int32) string
- type OtlpLogSeverityRange
Constants ¶
const DefaultScopeName = "dash0-cli"
DefaultScopeName is the default instrumentation scope name used by the CLI.
Variables ¶
This section is empty.
Functions ¶
func AnyValueToString ¶ added in v1.5.0
AnyValueToString converts an AnyValue to its string representation.
func DefaultScopeVersion ¶
func DefaultScopeVersion() string
DefaultScopeVersion returns the default scope version (the CLI version).
func DerefHexBytes ¶ added in v1.5.0
DerefHexBytes returns the hex encoding of a *[]byte, or "" if nil.
func DerefInt64 ¶ added in v1.5.0
DerefInt64 returns the string representation of a *int64, or "" if nil.
func DerefString ¶ added in v1.5.0
DerefString returns the value of a *string, or "" if nil.
func FindAttribute ¶ added in v1.5.0
FindAttribute looks up key in attrs and returns its string representation. Returns "" if the key is not found or the value is empty.
func MergeAttributes ¶ added in v1.5.0
MergeAttributes merges multiple attribute slices into a single slice. Later slices take precedence over earlier ones for duplicate keys.
func ParseKeyValuePairs ¶
ParseKeyValuePairs parses a slice of "key=value" strings into a map.
func ParseSpanID ¶
ParseSpanID parses a 16 hex character string into a pcommon.SpanID.
func ParseTraceID ¶
ParseTraceID parses a 32 hex character string into a pcommon.TraceID.
func ResolveScopeDefaults ¶
ResolveScopeDefaults clears the default value for scope-name or scope-version when only the other flag is explicitly set. This avoids pairing a custom scope name with the dash0-cli version (or vice versa).
func SeverityNumberToRange ¶
SeverityNumberToRange maps an OTel severity number (0–24) to its severity range. Numbers outside the defined bands return a formatted string like "SEVERITY_25".
Types ¶
type OtlpLogSeverityRange ¶
type OtlpLogSeverityRange string
OtlpLogSeverityRange represents the OpenTelemetry log severity ranges. Each range covers a band of four severity numbers as defined by the OpenTelemetry specification.
const ( Unknown OtlpLogSeverityRange = "UNKNOWN" Trace OtlpLogSeverityRange = "TRACE" Debug OtlpLogSeverityRange = "DEBUG" Info OtlpLogSeverityRange = "INFO" Warn OtlpLogSeverityRange = "WARN" Error OtlpLogSeverityRange = "ERROR" Fatal OtlpLogSeverityRange = "FATAL" )