tracker

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MeterProvider metric.MeterProvider
View Source
var TraceProvider sdktrace.TracerProvider

Functions

func Bool

func Bool(k string, v bool) attribute.KeyValue

Bool creates a attribute.KeyValue with a BOOL Value type.

func BoolSlice

func BoolSlice(k string, v []bool) attribute.KeyValue

BoolSlice creates a attribute.KeyValue with a BOOLSLICE Value type.

func ErrorCode

func ErrorCode() codes.Code

func ErrorRecording

func ErrorRecording(ctx context.Context, err error)

func Float64

func Float64(k string, v float64) attribute.KeyValue

Float64 creates a attribute.KeyValue with a FLOAT64 Value type.

func Float64Slice

func Float64Slice(k string, v []float64) attribute.KeyValue

Float64Slice creates a attribute.KeyValue with a FLOAT64SLICE Value type.

func Int

func Int(k string, v int) attribute.KeyValue

Int creates a attribute.KeyValue with an INT64 Value type.

func Int64

func Int64(k string, v int64) attribute.KeyValue

Int64 creates a attribute.KeyValue with an INT64 Value type.

func Int64Slice

func Int64Slice(k string, v []int64) attribute.KeyValue

Int64Slice creates a attribute.KeyValue with an INT64SLICE Value type.

func IntSlice

func IntSlice(k string, v []int) attribute.KeyValue

IntSlice creates a attribute.KeyValue with an INT64SLICE Value type.

func SetAttribute

func SetAttribute(ctx context.Context, name string, value string)

func SpanFromContext

func SpanFromContext(ctx context.Context) trace.Span

func SpanID

func SpanID(ctx context.Context) string

func String

func String(k, v string) attribute.KeyValue

String creates a attribute.KeyValue with a STRING Value type.

func StringSlice

func StringSlice(k string, v []string) attribute.KeyValue

StringSlice creates a attribute.KeyValue with a STRINGSLICE Value type.

func Stringer

func Stringer(k string, v fmt.Stringer) attribute.KeyValue

Stringer creates a new key-value pair with a passed name and a string value generated by the passed Stringer interface.

func TraceID

func TraceID(ctx context.Context) string

func WithStackTrace

func WithStackTrace(b bool) trace.SpanEndEventOption

Types

type Config

type Config struct {
	TenantID    string
	AccessToken string

	LogHost string

	Tp *sdktrace.TracerProvider
	Mp *sdkmetric.MeterProvider
	Lp *sdklog.LoggerProvider
	// contains filtered or unexported fields
}

func Track

func Track(opts ...Options) (*Config, error)

func TrackWithCtx

func TrackWithCtx(ctx context.Context, opts ...Options) (*Config, error)

type ConfigTag

type ConfigTag string
const (
	PauseMetrics             ConfigTag = "pauseMetrics"             // Boolean - disable all metrics
	PauseDefaultMetrics      ConfigTag = "pauseDefaultMetrics"      // Boolean - disable default runtime metrics
	PauseTraces              ConfigTag = "pauseTraces"              // Boolean - disable all traces
	PauseLogs                ConfigTag = "pauseLogs"                // Boolean - disable all logs
	PauseProfiling           ConfigTag = "pauseProfiling"           // Boolean - disable profiling
	Debug                    ConfigTag = "debug"                    // Boolean - enable debug in console
	DebugLogFile             ConfigTag = "debugLogFile"             // Boolean - get logs files for debug mode
	Service                  ConfigTag = "service"                  // String - Service Name e.g: "My-Service"
	Target                   ConfigTag = "target"                   // String - Target e.g: "http://mxl-otelcol.service-availability.apps.ocpthikadev01.safaricom.net"
	Workspace                ConfigTag = "workspaceId"              // String - Workspace Name e.g: "My-Workspace"
	Token                    ConfigTag = "accessToken"              // String - Token string found at agent installation
	CustomResourceAttributes ConfigTag = "customResourceAttributes" // map[string]interface{}
)

type Logs

type Logs struct{}

type Metrics

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

func NewMetrics

func NewMetrics() *Metrics

func (*Metrics) Initialize

func (t *Metrics) Initialize()

type Options

type Options func(*Config)

func WithConfigTag

func WithConfigTag(k ConfigTag, v interface{}) Options

type Traces

type Traces struct{}

Jump to

Keyboard shortcuts

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