opentracing

package module
Version: v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 13 Imported by: 6

README

opentracing

Opentracing tracer for Kitex

Server usage

import (
    ...
    internal_opentracing "github.com/kitex-contrib/tracer-opentracing"
    ...
)

func main() {
    ...
    svr := echo.NewServer(new(EchoImpl), internal_opentracing.DefaultServerOption())
    ...
}

DefaultServerOption will use opentracing global tracer as tracer, and {Service Name}::{Method Name} as operation name. You can customize both by ServerOption.

Client usage

import (
    ...
    internal_opentracing "github.com/kitex-contrib/tracer-opentracing"
    ...
)

func main() {
    ...
    client, err := echo.NewClient("echo", internal_opentracing.DefaultClientOption())
	if err != nil {
		log.Fatal(err)
	}
    ...
}

Just like server, DefaultClientOption will use opentracing global tracer as tracer, and {Service Name}::{Method Name} as operation name. You can customize both by ClientOption.

Example

Executable Example

Documentation

Overview

Package opentracing implements KiteX tracer with opentracing.

Index

Constants

View Source
const (
	SpanContextKey = "JaegerSpanContext"
)

Variables

This section is empty.

Functions

func NewClientSuite added in v0.0.2

func NewClientSuite(tracer opentracing.Tracer, formOperationName func(c context.Context) string) client.Suite

func NewDefaultClientSuite added in v0.0.2

func NewDefaultClientSuite() client.Suite

func NewDefaultServerSuite added in v0.0.2

func NewDefaultServerSuite() server.Suite

func NewServerSuite added in v0.0.2

func NewServerSuite(tracer opentracing.Tracer, formOperationName func(c context.Context) string) server.Suite

func SpanContextExtractMW added in v0.0.2

func SpanContextExtractMW(next endpoint.Endpoint) endpoint.Endpoint

func SpanContextInjectMW added in v0.0.2

func SpanContextInjectMW(next endpoint.Endpoint) endpoint.Endpoint

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL