opencensus

package module
v0.0.0-...-806a58a Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

OpenCensus Binary Propagation Format

The Problem

The ocgrpc GRPC plugin for OpenCensus is hard-coded to use a Binary propagation format.

A GRPC client and server that use OpenCensus cannot easily migrate to OpenTelemetry because there will be a period of time during which one will use OpenCensus and the other will use OpenTelemetry. If both client and server export spans to the same trace backend, the server spans will not be a child of the client spans, because they are using different propagation formats. To be able to easily migrate from OpenCensus to OpenTelemetry, it is necessary to use the OpenCensus binary propagation format with OpenTelemetry.

Usage

To add the binary propagation format with otelgrpc, use the WithPropagators option to the otelgrpc Interceptors:

import "go.opentelemetry.io/contrib/propagators/opencensus"

opt := otelgrpc.WithPropagators(opencensus.Binary{})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SemVersion deprecated

func SemVersion() string

SemVersion is the semantic version to be supplied to tracer/meter creation.

Deprecated: Use Version instead.

func Version

func Version() string

Version is the current release version of the OpenCensus propagator.

Types

type Binary

type Binary struct{}

Binary is an OpenTelemetry implementation of the OpenCensus grpc binary format. Binary propagation was temporarily removed from opentelemetry. See https://github.com/open-telemetry/opentelemetry-specification/issues/437

func (Binary) Extract

Extract extracts the SpanContext from the TextMapCarrier.

func (Binary) Fields

func (b Binary) Fields() []string

Fields returns the fields that this propagator modifies.

func (Binary) Inject

func (b Binary) Inject(ctx context.Context, carrier propagation.TextMapCarrier)

Inject injects context into the TextMapCarrier.

Directories

Path Synopsis
examples module

Jump to

Keyboard shortcuts

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