kit: github.com/go-kit/kit/tracing/zipkin Index | Files

package zipkin

import "github.com/go-kit/kit/tracing/zipkin"

Package zipkin provides Go kit integration to the OpenZipkin project through the use of zipkin-go, the official OpenZipkin tracer implementation for Go. OpenZipkin is the most used open source distributed tracing ecosystem with many different libraries and interoperability options.

Index

Package Files

doc.go endpoint.go grpc.go http.go options.go

func GRPCClientTrace Uses

func GRPCClientTrace(tracer *zipkin.Tracer, options ...TracerOption) kitgrpc.ClientOption

GRPCClientTrace enables native Zipkin tracing of a Go kit gRPC transport Client.

Go kit creates gRPC transport clients per remote endpoint. This middleware can be set-up individually by adding the endpoint name for each of the Go kit transport clients using the Name() TracerOption. If wanting to use the gRPC FullMethod (/service/method) as Span name you can create a global client tracer omitting the Name() TracerOption, which you can then feed to each Go kit gRPC transport client. If instrumenting a client to an external (not on your platform) service, you will probably want to disallow propagation of SpanContext using the AllowPropagation TracerOption and setting it to false.

func GRPCServerTrace Uses

func GRPCServerTrace(tracer *zipkin.Tracer, options ...TracerOption) kitgrpc.ServerOption

GRPCServerTrace enables native Zipkin tracing of a Go kit gRPC transport Server.

Go kit creates gRPC transport servers per gRPC method. This middleware can be set-up individually by adding the method name for each of the Go kit method servers using the Name() TracerOption. If wanting to use the gRPC FullMethod (/service/method) as Span name you can create a global server tracer omitting the Name() TracerOption, which you can then feed to each Go kit method server. For this to work you will need to wire the Go kit gRPC Interceptor too. If instrumenting a service to external (not on your platform) clients, you will probably want to disallow propagation of a client SpanContext using the AllowPropagation TracerOption and setting it to false.

func HTTPClientTrace Uses

func HTTPClientTrace(tracer *zipkin.Tracer, options ...TracerOption) kithttp.ClientOption

HTTPClientTrace enables native Zipkin tracing of a Go kit HTTP transport Client.

Go kit creates HTTP transport clients per remote endpoint. This middleware can be set-up individually by adding the endpoint name for each of the Go kit transport clients using the Name() TracerOption. If wanting to use the HTTP Method (Get, Post, Put, etc.) as Span name you can create a global client tracer omitting the Name() TracerOption, which you can then feed to each Go kit transport client. If instrumenting a client to an external (not on your platform) service, you will probably want to disallow propagation of SpanContext using the AllowPropagation TracerOption and setting it to false.

func HTTPServerTrace Uses

func HTTPServerTrace(tracer *zipkin.Tracer, options ...TracerOption) kithttp.ServerOption

HTTPServerTrace enables native Zipkin tracing of a Go kit HTTP transport Server.

Go kit creates HTTP transport servers per HTTP endpoint. This middleware can be set-up individually by adding the method name for each of the Go kit method servers using the Name() TracerOption. If wanting to use the HTTP method (Get, Post, Put, etc.) as Span name you can create a global server tracer omitting the Name() TracerOption, which you can then feed to each Go kit method server.

If instrumenting a service to external (not on your platform) clients, you will probably want to disallow propagation of a client SpanContext using the AllowPropagation TracerOption and setting it to false.

func TraceEndpoint Uses

func TraceEndpoint(tracer *zipkin.Tracer, name string) endpoint.Middleware

TraceEndpoint returns an Endpoint middleware, tracing a Go kit endpoint. This endpoint tracer should be used in combination with a Go kit Transport tracing middleware or custom before and after transport functions as propagation of SpanContext is not provided in this middleware.

type TracerOption Uses

type TracerOption func(o *tracerOptions)

TracerOption allows for functional options to our Zipkin tracing middleware.

func AllowPropagation Uses

func AllowPropagation(propagate bool) TracerOption

AllowPropagation instructs the tracer to allow or deny propagation of the span context between this instrumented client or service and its peers. If the instrumented client connects to services outside its own platform or if the instrumented service receives requests from untrusted clients it is strongly advised to disallow propagation. Propagation between services inside your own platform benefit from propagation. Default for both TraceClient and TraceServer is to allow propagation.

func Logger Uses

func Logger(logger log.Logger) TracerOption

Logger adds a Go kit logger to our Zipkin Middleware to log SpanContext extract / inject errors if they occur. Default is Noop.

func Name Uses

func Name(name string) TracerOption

Name sets the name for an instrumented transport endpoint. If name is omitted at tracing middleware creation, the method of the transport or transport rpc name is used.

func Tags Uses

func Tags(tags map[string]string) TracerOption

Tags adds default tags to our Zipkin transport spans.

Package zipkin imports 12 packages (graph) and is imported by 30 packages. Updated 2018-05-07. Refresh now. Tools for package owners.