Giter VIP home page Giter VIP logo

opentelemetry-go's Introduction

OpenTelemetry-Go

Circle CI Docs Go Report Card Gitter

The Go OpenTelemetry client.

Installation

This repository includes multiple packages. The api package contains core data types, interfaces and no-op implementations that comprise the OpenTelemetry API following the specification. The sdk package is the reference implementation of the API.

Libraries that produce telemetry data should only depend on api and defer the choice of the SDK to the application developer. Applications may depend on sdk or another package that implements the API.

All packages are published to go.opentelemetry.io/otel and is the preferred location to import from.

Additional resources:

Quick Start

Below is a brief example of importing OpenTelemetry, initializing a tracer and creating some simple spans.

package main

import (
	"context"
	"log"

	"go.opentelemetry.io/otel/api/global"
	"go.opentelemetry.io/otel/exporters/trace/stdout"
	sdktrace "go.opentelemetry.io/otel/sdk/trace"
)

func initTracer() {
	exporter, err := stdout.NewExporter(stdout.Options{PrettyPrint: true})
	if err != nil {
		log.Fatal(err)
	}
	tp, err := sdktrace.NewProvider(sdktrace.WithConfig(sdktrace.Config{DefaultSampler: sdktrace.AlwaysSample()}),
		sdktrace.WithSyncer(exporter))
	if err != nil {
		log.Fatal(err)
	}
	global.SetTraceProvider(tp)
}

func main() {
	initTracer()
	tracer := global.Tracer("ex.com/basic")

	tracer.WithSpan(context.Background(), "foo",
		func(ctx context.Context) error {
			tracer.WithSpan(ctx, "bar",
				func(ctx context.Context) error {
					tracer.WithSpan(ctx, "baz",
						func(ctx context.Context) error {
							return nil
						},
					)
					return nil
				},
			)
			return nil
		},
	)
}

See the API documentation for more detail, and the opentelemetry-example-app for a complete example.

Compatible Exporters

See the Go packages depending upon sdk/export/trace and sdk/export/metric for a list of all exporters compatible with OpenTelemetry's Go SDK.

Compatible Libraries

See the opentelemetry-go-contrib repo for packages that facilitates instrumenting other useful Go libraries with opentelemetry-go for distributed tracing and monitoring.

Contributing

See the contributing file.

Release Schedule

OpenTelemetry Go is under active development. Below is the release schedule for the Go library. The first version of the release isn't guaranteed to conform to a specific version of the specification, and future releases will not attempt to maintain backward compatibility with the alpha release.

Component Version Release Date
Tracing API Alpha v0.1.0 November 05 2019
Tracing SDK Alpha v0.1.0 November 05 2019
Jaeger Trace Exporter Alpha v0.1.0 November 05 2019
Trace Context Propagation Alpha v0.1.0 November 05 2019
OpenTracing Bridge Alpha v0.1.0 November 05 2019
Metrics API Alpha v0.2.0 December 03 2019
Metrics SDK Alpha v0.2.0 December 03 2019
Prometheus Metrics Exporter Alpha v0.2.0 December 03 2019
Context Prop. rename/Baggage Beta v0.4.0 March 30 2020
OpenTelemetry Collector Exporter Beta v0.4.0 March 30 2020
Zipkin Trace Exporter Beta v0.4.0 March 30 2020
OTLP Trace & Metrics Exporter Beta v0.4.0 March 30 2020

opentelemetry-go's People

Contributors

agneum avatar akvanhar avatar andrewhsu avatar aneurysm9 avatar bogdandrutu avatar clsung avatar codeboten avatar djosephsen avatar evantorrie avatar ferhatelmas avatar freeformz avatar iredelmeier avatar jmacd avatar krnowak avatar lizthegrey avatar matej-g avatar mralias avatar nicks avatar oncilla avatar paivagustavo avatar rghetia avatar sergeykanzhelev avatar sjkaris avatar stefanprisca avatar tensorchen avatar thinkerou avatar vmihailenco avatar wingyplus avatar xsam avatar ymotongpoo avatar

Watchers

 avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.