protobuf_span

package module
v0.0.0-...-44aad02 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: MIT Imports: 3 Imported by: 0

README

Protobuf Span for Jaeger

Example
package main

import (
	ot "github.com/opentracing/opentracing-go"
	jcc "github.com/uber/jaeger-client-go/config"
	"github.com/zevst/protobuf_span"
)

func main() {
	cfg := jcc.Configuration{
		// ...
	}
	propagator := protobuf_span.NewPropagator() // You can add BaggagePrefix as an option.

	// Create Jaeger tracer from Configuration
	// be sure to handle the error
	tracer, closer, _ := cfg.NewTracer(
		jcc.Injector(protobuf_span.Format, propagator),
		jcc.Extractor(protobuf_span.Format, propagator),
	)
	ot.SetGlobalTracer(tracer)
	defer func() {
		// be sure to handle the error
		_ = closer.Close()
	}()
	// continue main()
}

Documentation

Index

Constants

View Source
const Format = "pb-span-format"

ProtoBufSpanFormat is an OpenTracing carrier format constant

Variables

This section is empty.

Functions

func NewPropagator

func NewPropagator(opts ...Option) *propagator

Types

type Option

type Option func(p *propagator)

Option sets an option on Propagator

func BaggagePrefix

func BaggagePrefix(prefix string) Option

BaggagePrefix sets baggage prefix on Propagator

Directories

Path Synopsis
pb

Jump to

Keyboard shortcuts

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