Documentation ¶
Index ¶
- func InitMetricsProvider(logger zerolog.Logger, addr string, ...) (func(), error)
- func InitTraceProvider(logger zerolog.Logger, serviceName string, addr string, ...) (func(), error)
- func LoadKeyPair(ca_path, cert_path, key_path string) (*credentials.TransportCredentials, error)
- func WithDefaultMetricOpts(serviceName string) []metric.Option
- func WithDefaultResource(ctx context.Context, serviceName string) (*resource.Resource, error)
- func WithDefaultResourceOpts() []resource.Option
- func WithDefaultTracingOpts(serviceName string) []sdktrace.TracerProviderOption
- func WithNomad() resource.Option
- type Option
- type PyroscopeConfig
- type PyroscopeLogger
- type TelemetryConfig
- func (t *TelemetryConfig) InitializeTelemetry(ctx context.Context, serviceName string, logger zerolog.Logger, ...) error
- func (t *TelemetryConfig) Merge(o *TelemetryConfig) error
- func (t *TelemetryConfig) RegisterFlags(f *flag.FlagSet)
- func (t *TelemetryConfig) Shutdown(ctx context.Context, logger zerolog.Logger) error
- func (t *TelemetryConfig) Validate() error
- type TelemetryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMetricsProvider ¶
func InitMetricsProvider(logger zerolog.Logger, addr string, credentials *credentials.TransportCredentials, collectionInterval time.Duration, opts ...metric.Option) (func(), error)
Initializes an OTLP exporter, and configures the corresponding trace and metric providers.
NOTE: this temporarily returns a metric.MeterProvider while opentelemetry-go reworks the metrics API upstream to support globals. This will be updated in tandem when https://github.com/open-telemetry/opentelemetry-go/pull/2587 is deployed.
func InitTraceProvider ¶
func InitTraceProvider(logger zerolog.Logger, serviceName string, addr string, creds *credentials.TransportCredentials, pyroscopeConfig PyroscopeConfig, opts ...sdktrace.TracerProviderOption) (func(), error)
Initializes an OTLP exporter, and configures the corresponding trace and metric providers.
func LoadKeyPair ¶
func LoadKeyPair(ca_path, cert_path, key_path string) (*credentials.TransportCredentials, error)
func WithDefaultMetricOpts ¶
func WithDefaultResource ¶
func WithDefaultResourceOpts ¶
func WithDefaultTracingOpts ¶
func WithDefaultTracingOpts(serviceName string) []sdktrace.TracerProviderOption
Types ¶
type Option ¶
type Option func(*TelemetryOptions) error
func MetricOptions ¶
func TracingOptions ¶
func TracingOptions(tracingOptions ...sdktrace.TracerProviderOption) Option
type PyroscopeConfig ¶
type PyroscopeConfig struct { URL string `toml:"url"` Token string `toml:"token"` User string `toml:"user"` // contains filtered or unexported fields }
func (*PyroscopeConfig) Start ¶
func (c *PyroscopeConfig) Start(ctx context.Context, serviceName string) error
func (*PyroscopeConfig) Stop ¶
func (c *PyroscopeConfig) Stop() error
type PyroscopeLogger ¶
type PyroscopeLogger struct {
// contains filtered or unexported fields
}
func (*PyroscopeLogger) Debugf ¶
func (l *PyroscopeLogger) Debugf(a string, b ...interface{})
func (*PyroscopeLogger) Errorf ¶
func (l *PyroscopeLogger) Errorf(a string, b ...interface{})
func (*PyroscopeLogger) Infof ¶
func (l *PyroscopeLogger) Infof(a string, b ...interface{})
type TelemetryConfig ¶
type TelemetryConfig struct { OTLPAddr string `toml:"addr"` OTLPCAPath string `toml:"ca_path"` OTLPCertPath string `toml:"cert_path"` OTLPKeyPath string `toml:"key_path"` Insecure bool `toml:"insecure"` ServiceName string `toml:"service_name"` MetricsCollectionInterval time.Duration `toml:"metrics_collection_interval"` Pyroscope PyroscopeConfig `toml:"pyroscope"` // contains filtered or unexported fields }
func (*TelemetryConfig) InitializeTelemetry ¶
func (t *TelemetryConfig) InitializeTelemetry(ctx context.Context, serviceName string, logger zerolog.Logger, options ...Option) error
Initialize Metrics + Tracing for the app. NOTE: you must call defer t.Stop() to propely cleanup
func (*TelemetryConfig) Merge ¶
func (t *TelemetryConfig) Merge(o *TelemetryConfig) error
func (*TelemetryConfig) RegisterFlags ¶
func (t *TelemetryConfig) RegisterFlags(f *flag.FlagSet)
func (*TelemetryConfig) Validate ¶
func (t *TelemetryConfig) Validate() error
type TelemetryOptions ¶
type TelemetryOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.