traces

package
v0.0.0-...-561a725 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package traces allows for instrumenting osquery-go with OpenTelemetry traces. Unless the consuming application specifically configures a trace exporter, all tracing is a no-op.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OsqueryGoTracer

func OsqueryGoTracer() trace.Tracer

OsqueryGoTracer provides a tracer with a standardized name and version. It should be used to start a span that requires `SpanStartOption`s that are not supported by `StartSpan` below -- i.e., any `SpanStartOption` besides `WithAttributes`.

func SetTracerProvider

func SetTracerProvider(tp trace.TracerProvider)

SetTracerProvider allows consuming libraries to set a custom/non-global tracer provider.

func StartSpan

func StartSpan(ctx context.Context, spanName string, keyVals ...string) (context.Context, trace.Span)

StartSpan is a wrapper around trace.Tracer.Start that simplifies passing in span attributes. `keyVals` should be a list of pairs, where the first in the pair is a string representing the attribute key and the second in the pair is the attribute value. The caller is always responsible for ending the returned span. Any spans requiring more specific configuration can be created manually via OsqueryGoTracer().Start.

Types

This section is empty.

Jump to

Keyboard shortcuts

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