oc

package
Version: v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package oc provides a cmdutil.Server for opencensus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExporter

func NewExporter(tc trace.Config, opts ...ocagent.ExporterOption) (cmdutil.Server, error)

NewExporter creates and registers an open census trace exporter as a cmdutil.Server wit the provided trace.Config / ocagent.ExporterOptions.

Types

type Config

type Config struct {
	// AgentAddress in the form of 'host:port'. Leave empty to disable.
	// (ocagent.WithAddress).
	AgentAddress string `env:"OC_AGENT_ADDR"`
	// ReconnectionPeriod to use when reconnecting to the agent. Defaults to
	// 5s.(ocagent.WithReconnectionPeriod).
	ReconnectionPeriod time.Duration `env:"OC_RECONNECTION_PERIOD,default=5s"`
	// WithInsecure. Defaults to false (ocagent.WithInsecure).
	WithInsecure bool `env:"OC_INSECURE,default=false"`
}

Config of Open Census, via github.com/joeshaw/envdecode

TODO[freeformz]: Support the other ocagent.WithXX options

func (Config) ExporterOptions

func (c Config) ExporterOptions(serviceName string) []ocagent.ExporterOption

ExporterOptions derived from the configuration.

func (Config) TraceConfig

func (c Config) TraceConfig() trace.Config

TraceConfig derived from the Config. This currently defaults to AlwaysSample and otherwise Default Max for the other trace.Config items.

TODO[freeformz]: implement determining trace.Config via environment.

Source Files

Jump to

Keyboard shortcuts

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