ocgoconfig

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: MIT Imports: 8 Imported by: 0

README

OpenCensus Configuration for Golang

Parses URI type value for OpenCensus exporters.

If no value is passed to Setup then it will check OCGO_EXPORTER.

Example

package main

import (
	"flag"
	"time"

	"github.com/bweston92/ocgoconfig"
	"go.opencensus.io/trace"
)

var (
	ocgov string
)

func init() {
	flag.StringVar(&ocgov, "oc-exporter", "", "Configuration for OpenCensus exporter")
}

func main() {
	flag.Parse()

	ocgoconfig.Setup(ocgov)

	s := trace.NewSpan("myheavywork")
	for i := 0; i < 100 {
		time.Sleep(time.Microsecond)
	}
	s.End()
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidConfiguration = errors.New("invalid configuration")
	ErrUnknownExporter      = errors.New("unknown exporter")
)

Functions

func Available

func Available() []string

func Setup

func Setup(config string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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