telemetry

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HookConditionPreHookDB     = "prehookdb"
	HookConditionPostHookDB    = "posthookdb"
	HookConditionPreHookQueue  = "prehookqueue"
	HookConditionPostHookQueue = "posthookqueue"
)

Variables

View Source
var (
	TagReceiverType     = tag.MustNewKey("receiver_type")
	TagNotificationType = tag.MustNewKey("notification_type")
	TagMessageStatus    = tag.MustNewKey("status")
	TagHookCondition    = tag.MustNewKey("hook_condition")

	MetricNotificationMessageQueueTime = stats.Int64("notification.message.queue.time", "time of message from enqueued to be picked up", stats.UnitMilliseconds)

	MetricNotificationMessageCounter = stats.Int64("notification.message", "notification messages counter", stats.UnitDimensionless)

	MetricNotificationSubscriberNotFound = stats.Int64("notification.subscriber.notfound", "notification does not match any subscription", stats.UnitDimensionless)

	MetricReceiverHookFailed = stats.Int64("receiver.hook.failed", "failed hook condition", stats.UnitDimensionless)
)

Functions

func GaugeMillisecond

func GaugeMillisecond(ctx context.Context, si64 *stats.Int64Measure, value int64, tagMutator ...tag.Mutator)

func IncrementInt64Counter

func IncrementInt64Counter(ctx context.Context, si64 *stats.Int64Measure, tagMutator ...tag.Mutator)

func Init

func Init(ctx context.Context, cfg Config, lg log.Logger)

Init initialises OpenCensus based async-telemetry processes and returns (i.e., it does not block).

Types

type Config

type Config struct {
	// Debug sets the bind address for pprof & zpages server.
	Debug string `mapstructure:"debug_addr" yaml:"debug_addr" default:"localhost:8083"`

	// OpenCensus trace & metrics configurations.
	EnableCPU        bool    `mapstructure:"enable_cpu" yaml:"enable_cpu" default:"true"`
	EnableMemory     bool    `mapstructure:"enable_memory" yaml:"enable_memory" default:"true"`
	SamplingFraction float64 `mapstructure:"sampling_fraction" yaml:"sampling_fraction" default:"1"`

	// OpenCensus exporter configurations.
	ServiceName string `mapstructure:"service_name" yaml:"service_name" default:"siren"`

	// NewRelic exporter.
	EnableNewrelic bool   `mapstructure:"enable_newrelic" yaml:"enable_newrelic" default:"false"`
	NewRelicAPIKey string `mapstructure:"newrelic_api_key" yaml:"newrelic_api_key" default:"____LICENSE_STRING_OF_40_CHARACTERS_____"`

	// OpenTelemetry Agent exporter.
	EnableOtelAgent  bool   `mapstructure:"enable_otel_agent" yaml:"enable_otel_agent" default:"false"`
	OpenTelAgentAddr string `mapstructure:"otel_agent_addr" yaml:"otel_agent_addr" default:"localhost:55678"`
}

type MessagingTracer

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

func NewMessagingTracer

func NewMessagingTracer(queueSystem string) *MessagingTracer

func (*MessagingTracer) StartSpan

func (msg *MessagingTracer) StartSpan(ctx context.Context, op string, spanAttributes ...trace.Attribute) (context.Context, *trace.Span)

func (*MessagingTracer) StopSpan added in v0.6.7

func (msg *MessagingTracer) StopSpan()

type PostgresTracer

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

func NewPostgresTracer

func NewPostgresTracer(url string) (*PostgresTracer, error)

func (*PostgresTracer) StartSpan

func (d *PostgresTracer) StartSpan(ctx context.Context, op string, tableName string, query string, spanAttributes ...trace.Attribute) (context.Context, *trace.Span)

func (*PostgresTracer) StopSpan added in v0.6.7

func (d *PostgresTracer) StopSpan()

type Transport

type Transport struct {
	Origin http.RoundTripper
}

func (*Transport) RoundTrip

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

Jump to

Keyboard shortcuts

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