group

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package group provides a tetratelabs/run Group compatible OpenCensus metrics service.

Index

Constants

View Source
const (
	NoPrometheus        = "disable-prometheus"
	PrometheusAddress   = "prometheus-address"
	PrometheusEndpoint  = "prometheus-endpoint"
	PrometheusNamespace = "prometheus-namespace"

	OpenCensus          = "enable-opencensus"
	OpenCensusAddress   = "opencensus-address"
	OpenCensusService   = "opencensus-servicename"
	OpenCensusReport    = "opencensus-report-interval"
	OpenCensusReconnect = "opencensus-reconnect-interval"
)

Exported flags.

View Source
const (
	DefaultPrometheusAddress   = ":42422"
	DefaultPrometheusEndpoint  = "/metrics"
	DefaultPrometheusNamespace = ""

	DefaultOpenCensusAddress           = "otel-collector:9091"
	DefaultOpenCensusServiceName       = ""
	DefaultOpenCensusReportInterval    = 10 * time.Second
	DefaultOpenCensusReconnectInterval = 10 * time.Second
)

Default configuration values.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// ExternalPromWebHandler will disable the ability to configure and run the
	// Prometheus exporter from this group Config handler, as it is handled
	// externally.
	ExternalPromWebHandler bool

	// NoPrometheus will disable configuring the Prometheus exporter in favor.
	NoPrometheus bool

	// PrometheusAddress sets the scraping address to listen on.
	PrometheusAddress string

	// PrometheusEndpoint sets the scraping endpoint.
	PrometheusEndpoint string

	// PrometheusNamespace sets the namespace (prefix) for Prometheus metrics.
	PrometheusNamespace string

	// OpenCensus enables metric streaming to OpenCensus / OpenTelemetry service.
	OpenCensus bool

	// OpenCensusAddress of OpenCensus / OpenTelemetry service to connect to.
	OpenCensusAddress string

	// OpenCensusServiceName to use for outgoing metrics.
	OpenCensusServiceName string

	// OpenCensusReportInterval sets the metric views default reporting interval.
	OpenCensusReportInterval time.Duration

	// OpenCensusReconnectInterval sets the reconnection interval to use when disconnected.
	OpenCensusReconnectInterval time.Duration
}

type Service

type Service interface {
	run.Config
	run.PreRunner
	run.Service
}

Service implements tetratelabs/run Group interfaces.

func New

func New(config Config) Service

New takes a config and creates a tetratelabs/run Group compatible metrics service for our tetratelabs/telemetry metrics implementation.

Jump to

Keyboard shortcuts

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