Help us shape the future of Go! Take the 2026 Go Developer Survey

telemetry

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 19 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 added in v0.5.4

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

func IncrementInt64Counter added in v0.5.2

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

func Init added in v0.5.2

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 added in v0.5.2

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

	// 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"`
	NewRelicAppName string `mapstructure:"newrelic_app_name" yaml:"newrelic_app_name"`
	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 added in v0.5.2

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

func NewMessagingTracer added in v0.5.2

func NewMessagingTracer(queueSystem string) *MessagingTracer

func (MessagingTracer) StartSpan added in v0.5.2

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

type PostgresTracer added in v0.5.2

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

func NewPostgresTracer added in v0.5.2

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

func (PostgresTracer) StartSpan added in v0.5.2

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

type Transport added in v0.5.2

type Transport struct {
	Base http.RoundTripper
}

func (*Transport) RoundTrip added in v0.5.2

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