config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportersFromYAMLConfig

func ExportersFromYAMLConfig(config []byte) (traceExporters []exporter.TraceExporter, metricsExporters []exporter.MetricsExporter, doneFns []func() error, err error)

ExportersFromYAMLConfig parses the config yaml payload and returns the respective exporters from:

  • datadog
  • stackdriver
  • zipkin
  • jaeger
  • kafka
  • opencensus
  • prometheus

Types

type Config

type Config struct {
	Receivers *Receivers    `yaml:"receivers"`
	ZPages    *ZPagesConfig `yaml:"zpages"`
	Exporters *Exporters    `yaml:"exporters"`
}

Config denotes the configuration for the various elements of an agent, that is: * Receivers * ZPages * Exporters

func ParseOCAgentConfig

func ParseOCAgentConfig(yamlBlob []byte) (*Config, error)

ParseOCAgentConfig unmarshals byte content in the YAML file format to retrieve the configuration that will be used to run the OpenCensus agent.

func (*Config) CanRunOpenCensusMetricsReceiver

func (c *Config) CanRunOpenCensusMetricsReceiver() bool

CanRunOpenCensusMetricsReceiver returns true if the configuration permits running the OpenCensus Metrics receiver.

func (*Config) CanRunOpenCensusTraceReceiver

func (c *Config) CanRunOpenCensusTraceReceiver() bool

CanRunOpenCensusTraceReceiver returns true if the configuration permits running the OpenCensus Trace receiver.

func (*Config) CheckLogicalConflicts

func (c *Config) CheckLogicalConflicts(blob []byte) error

CheckLogicalConflicts serves to catch logical errors such as if the Zipkin receiver port conflicts with that of the exporter, lest we'll have a self DOS because spans will be exported "out" from the exporter, yet be received from the receiver, then sent back out and back in a never ending loop.

func (*Config) JaegerReceiverEnabled

func (c *Config) JaegerReceiverEnabled() bool

JaegerReceiverEnabled returns true if Config is non-nil and if the Jaeger receiver configuration is also non-nil.

func (*Config) JaegerReceiverPorts

func (c *Config) JaegerReceiverPorts() (collectorPort, thriftPort int)

JaegerReceiverPorts is a helper to safely retrieve the address that the Jaeger receiver will run on.

func (*Config) OpenCensusReceiverAddress

func (c *Config) OpenCensusReceiverAddress() string

OpenCensusReceiverAddress is a helper to safely retrieve the address that the OpenCensus receiver will be bound to. If Config is nil or the OpenCensus receiver's configuration is nil, it will return the default of ":55678"

func (*Config) OpenCensusReceiverCorsAllowedOrigins added in v0.1.0

func (c *Config) OpenCensusReceiverCorsAllowedOrigins() []string

OpenCensusReceiverCorsAllowedOrigins is a helper to safely retrieve the list of allowed CORS origins for HTTP/JSON requests to the grpc-gateway adapter.

func (*Config) ZPagesDisabled

func (c *Config) ZPagesDisabled() bool

ZPagesDisabled returns true if zPages have not been enabled. It returns true if Config is nil or if ZPages are explicitly disabled.

func (*Config) ZPagesPort

func (c *Config) ZPagesPort() (int, bool)

ZPagesPort tries to dereference the port on which zPages will be served. If zPages are disabled, it returns (-1, false) Else if no port is set, it returns the default 55679

func (*Config) ZipkinReceiverAddress

func (c *Config) ZipkinReceiverAddress() string

ZipkinReceiverAddress is a helper to safely retrieve the address that the Zipkin receiver will run on. If Config is nil or the Zipkin receiver's configuration is nil, it will return the default of "localhost:9411"

func (*Config) ZipkinReceiverEnabled

func (c *Config) ZipkinReceiverEnabled() bool

ZipkinReceiverEnabled returns true if Config is non-nil and if the Zipkin receiver configuration is also non-nil.

type Exporters

type Exporters struct {
	Zipkin *exporterparser.ZipkinConfig `yaml:"zipkin"`
}

Exporters denotes the configurations for the various backends that this service exports observability signals to.

type ReceiverConfig

type ReceiverConfig struct {
	// The address to which the OpenCensus receiver will be bound and run on.
	Address             string `yaml:"address"`
	CollectorHTTPPort   int    `yaml:"collector_http_port"`
	CollectorThriftPort int    `yaml:"collector_thrift_port"`

	// The allowed CORS origins for HTTP/JSON requests the grpc-gateway adapter
	// for the OpenCensus receiver. See github.com/rs/cors
	// An empty list means that CORS is not enabled at all. A wildcard (*) can be
	// used to match any origin or one or more characters of an origin.
	CorsAllowedOrigins []string `yaml:"cors_allowed_origins"`

	// DisableTracing disables trace receiving and is only applicable to trace receivers.
	DisableTracing bool `yaml:"disable_tracing"`
	// DisableMetrics disables metrics receiving and is only applicable to metrics receivers.
	DisableMetrics bool `yaml:"disable_metrics"`
}

ReceiverConfig is the per-receiver configuration that identifies attributes that a receiver's configuration can have such as: * Address * Various ports

type Receivers

type Receivers struct {
	OpenCensus *ReceiverConfig `yaml:"opencensus"`
	Zipkin     *ReceiverConfig `yaml:"zipkin"`
	Jaeger     *ReceiverConfig `yaml:"jaeger"`
}

Receivers denotes configurations for the various telemetry ingesters, such as: * Jaeger * OpenCensus * Zipkin

type ZPagesConfig

type ZPagesConfig struct {
	Disabled bool `yaml:"disabled"`
	Port     int  `yaml:"port"`
}

ZPagesConfig denotes the configuration that zPages will be run with.

Jump to

Keyboard shortcuts

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