go-tracer

module
v0.0.0-...-2c0343b Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0, BSD-3-Clause, Apache-2.0

README

CircleCI Godoc

Installing

go get gopkg.in/Divedot/dd-trace-go.v1/...

### :warning: WARNING! This branch is no longer maintained. Development is now on the [`v1` branch](https://github.com/DataDog/dd-trace-go/tree/v1). Please consider upgrading using our [migration guide](https://github.com/DataDog/dd-trace-go/blob/v1/MIGRATING.md).

---

[![CircleCI](https://circleci.com/gh/DataDog/dd-trace-go/tree/master.svg?style=svg)](https://circleci.com/gh/DataDog/dd-trace-go/tree/master)
[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/DataDog/dd-trace-go/opentracing)

Divedot APM client that implements an [OpenTracing](http://opentracing.io) Tracer.

## Initialization

To start using the Divedot Tracer with the OpenTracing API, you should first initialize the tracer with a proper `Configuration` object:

```go
import (
	// ddtrace namespace is suggested
	ddtrace "gitlab.com/65A/go-tracer/opentracing"
	opentracing "github.com/opentracing/opentracing-go"
)

func main() {
	// create a Tracer configuration
	config := ddtrace.NewConfiguration()
	config.ServiceName = "api-intake"
	config.AgentHostname = "ddagent.consul.local"

	// initialize a Tracer and ensure a graceful shutdown
	// using the `closer.Close()`
	tracer, closer, err := ddtrace.NewTracer(config)
	if err != nil {
		// handle the configuration error
	}
	defer closer.Close()

	// set the Divedot tracer as a GlobalTracer
	opentracing.SetGlobalTracer(tracer)
	startWebServer()
}

Requires:

  • Go >= 1.12
  • Divedot's Trace Agent >= 5.21.1

Documentation

The API is documented on godoc as well as Divedot's official documentation. If you are migrating from an older version of the tracer (e.g. 0.6.x) you may also find the migration document we've put together helpful.

Contributing

Before considering contributions to the project, please take a moment to read our brief contribution guidelines.

Testing

Tests can be run locally using the Go toolset. The grpc.v12 integration will fail (and this is normal), because it covers for deprecated methods. In the CI environment we vendor this version of the library inside the integration. Under normal circumstances this is not something that we want to do, because users using this integration might be running versions different from the vendored one, creating hard to debug conflicts.

To run integration tests locally, you should set the INTEGRATION environment variable. The dependencies of the integration tests are best run via Docker. To get an idea about the versions and the set-up take a look at our CI config.

The best way to run the entire test suite is using the CircleCI CLI. Simply run circleci build in the repository root. Note that you might have to increase the resources dedicated to Docker to around 4GB.

Directories

Path Synopsis
contrib
Shopify/sarama
Package sarama provides functions to trace the Shopify/sarama package (https://github.com/Shopify/sarama).
Package sarama provides functions to trace the Shopify/sarama package (https://github.com/Shopify/sarama).
aws/aws-sdk-go/aws
Package aws provides functions to trace aws/aws-sdk-go (https://github.com/aws/aws-sdk-go).
Package aws provides functions to trace aws/aws-sdk-go (https://github.com/aws/aws-sdk-go).
bradfitz/gomemcache/memcache
Package memcache provides functions to trace the bradfitz/gomemcache package (https://github.com/bradfitz/gomemcache).
Package memcache provides functions to trace the bradfitz/gomemcache package (https://github.com/bradfitz/gomemcache).
cloud.google.com/go/pubsub.v1
Package pubsub provides functions to trace the cloud.google.com/pubsub/go package.
Package pubsub provides functions to trace the cloud.google.com/pubsub/go package.
confluentinc/confluent-kafka-go/kafka
Package kafka provides functions to trace the confluentinc/confluent-kafka-go package (https://github.com/confluentinc/confluent-kafka-go).
Package kafka provides functions to trace the confluentinc/confluent-kafka-go package (https://github.com/confluentinc/confluent-kafka-go).
database/sql
Package sql provides functions to trace the database/sql package (https://golang.org/pkg/database/sql).
Package sql provides functions to trace the database/sql package (https://golang.org/pkg/database/sql).
emicklei/go-restful
Package restful provides functions to trace the emicklei/go-restful package (https://github.com/emicklei/go-restful).
Package restful provides functions to trace the emicklei/go-restful package (https://github.com/emicklei/go-restful).
garyburd/redigo
Package redigo provides functions to trace the garyburd/redigo package (https://github.com/garyburd/redigo).
Package redigo provides functions to trace the garyburd/redigo package (https://github.com/garyburd/redigo).
gin-gonic/gin
Package gin provides functions to trace the gin-gonic/gin package (https://github.com/gin-gonic/gin).
Package gin provides functions to trace the gin-gonic/gin package (https://github.com/gin-gonic/gin).
globalsign/mgo
Package mgo provides functions and types which allow tracing of the MGO MongoDB client (https://github.com/globalsign/mgo)
Package mgo provides functions and types which allow tracing of the MGO MongoDB client (https://github.com/globalsign/mgo)
go-chi/chi
Package chi provides tracing functions for tracing the go-chi/chi package (https://github.com/go-chi/chi).
Package chi provides tracing functions for tracing the go-chi/chi package (https://github.com/go-chi/chi).
go-redis/redis
Package redis provides tracing functions for tracing the go-redis/redis package (https://github.com/go-redis/redis).
Package redis provides tracing functions for tracing the go-redis/redis package (https://github.com/go-redis/redis).
go-redis/redis.v8
Package redis provides tracing functions for tracing the go-redis/redis package (https://github.com/go-redis/redis).
Package redis provides tracing functions for tracing the go-redis/redis package (https://github.com/go-redis/redis).
go.mongodb.org/mongo-driver/mongo
Package mongo provides functions to trace the mongodb/mongo-go-driver package (https://github.com/mongodb/mongo-go-driver).
Package mongo provides functions to trace the mongodb/mongo-go-driver package (https://github.com/mongodb/mongo-go-driver).
gocql/gocql
Package gocql provides functions to trace the gocql/gocql package (https://github.com/gocql/gocql).
Package gocql provides functions to trace the gocql/gocql package (https://github.com/gocql/gocql).
gofiber/fiber.v2
Package fiber provides tracing functions for tracing the fiber package (https://github.com/gofiber/fiber).
Package fiber provides tracing functions for tracing the fiber package (https://github.com/gofiber/fiber).
gomodule/redigo
Package redigo provides functions to trace the gomodule/redigo package (https://github.com/gomodule/redigo).
Package redigo provides functions to trace the gomodule/redigo package (https://github.com/gomodule/redigo).
google.golang.org/api
Package api provides functions to trace the google.golang.org/api package.
Package api provides functions to trace the google.golang.org/api package.
google.golang.org/grpc
Package grpc is a generated protocol buffer package.
Package grpc is a generated protocol buffer package.
google.golang.org/grpc.v12
Package grpc is a generated protocol buffer package.
Package grpc is a generated protocol buffer package.
gopkg.in/jinzhu/gorm.v1
Package gorm provides helper functions for tracing the jinzhu/gorm package (https://github.com/jinzhu/gorm).
Package gorm provides helper functions for tracing the jinzhu/gorm package (https://github.com/jinzhu/gorm).
gorilla/mux
Package mux provides tracing functions for tracing the gorilla/mux package (https://github.com/gorilla/mux).
Package mux provides tracing functions for tracing the gorilla/mux package (https://github.com/gorilla/mux).
gorm.io/gorm.v1
Package gorm provides helper functions for tracing the gorm.io/gorm package (https://github.com/go-gorm/gorm).
Package gorm provides helper functions for tracing the gorm.io/gorm package (https://github.com/go-gorm/gorm).
graph-gophers/graphql-go
Package graphql provides functions to trace the graph-gophers/graphql-go package (https://github.com/graph-gophers/graphql-go).
Package graphql provides functions to trace the graph-gophers/graphql-go package (https://github.com/graph-gophers/graphql-go).
hashicorp/vault
Package vault contains functions to construct or augment an http.Client that will integrate with the github.com/hashicorp/vault/api and collect traces to send to Datadog.
Package vault contains functions to construct or augment an http.Client that will integrate with the github.com/hashicorp/vault/api and collect traces to send to Datadog.
jinzhu/gorm
Package gorm provides helper functions for tracing the jinzhu/gorm package (https://github.com/jinzhu/gorm).
Package gorm provides helper functions for tracing the jinzhu/gorm package (https://github.com/jinzhu/gorm).
jmoiron/sqlx
Package sqlx provides functions to trace the jmoiron/sqlx package (https://github.com/jmoiron/sqlx).
Package sqlx provides functions to trace the jmoiron/sqlx package (https://github.com/jmoiron/sqlx).
julienschmidt/httprouter
Package httprouter provides functions to trace the julienschmidt/httprouter package (https://github.com/julienschmidt/httprouter).
Package httprouter provides functions to trace the julienschmidt/httprouter package (https://github.com/julienschmidt/httprouter).
k8s.io/client-go/kubernetes
Package kubernetes provides functions to trace k8s.io/client-go (https://github.com/kubernetes/client-go).
Package kubernetes provides functions to trace k8s.io/client-go (https://github.com/kubernetes/client-go).
labstack/echo
Package echo provides functions to trace the labstack/echo package (https://github.com/labstack/echo).
Package echo provides functions to trace the labstack/echo package (https://github.com/labstack/echo).
labstack/echo.v4
Package echo provides functions to trace the labstack/echo package (https://github.com/labstack/echo).
Package echo provides functions to trace the labstack/echo package (https://github.com/labstack/echo).
net/http
Package http provides functions to trace the net/http package (https://golang.org/pkg/net/http).
Package http provides functions to trace the net/http package (https://golang.org/pkg/net/http).
olivere/elastic
Package elastic provides functions to trace the gopkg.in/olivere/elastic.v{3,5} packages.
Package elastic provides functions to trace the gopkg.in/olivere/elastic.v{3,5} packages.
syndtr/goleveldb/leveldb
Package leveldb provides functions to trace the syndtr/goleveldb package (https://github.com/syndtr/goleveldb).
Package leveldb provides functions to trace the syndtr/goleveldb package (https://github.com/syndtr/goleveldb).
twitchtv/twirp
Package twirp provides tracing functions for tracing clients and servers generated by the twirp framework (https://github.com/twitchtv/twirp).
Package twirp provides tracing functions for tracing clients and servers generated by the twirp framework (https://github.com/twitchtv/twirp).
zenazn/goji.v1/web
Package web provides functions to trace the zenazn/goji/web package (https://github.com/zenazn/goji).
Package web provides functions to trace the zenazn/goji/web package (https://github.com/zenazn/goji).
Package ddtrace contains the interfaces that specify the implementations of Datadog's tracing library, as well as a set of sub-packages containing various implementations: our native implementation ("tracer"), a wrapper that can be used with Opentracing ("opentracer") and a mock tracer to be used for testing ("mocktracer").
Package ddtrace contains the interfaces that specify the implementations of Datadog's tracing library, as well as a set of sub-packages containing various implementations: our native implementation ("tracer"), a wrapper that can be used with Opentracing ("opentracer") and a mock tracer to be used for testing ("mocktracer").
ext
Package ext contains a set of Datadog-specific constants.
Package ext contains a set of Datadog-specific constants.
mocktracer
Package mocktracer provides a mock implementation of the tracer used in testing.
Package mocktracer provides a mock implementation of the tracer used in testing.
opentracer
Package opentracer provides a wrapper on top of the Datadog tracer that can be used with Opentracing.
Package opentracer provides a wrapper on top of the Datadog tracer that can be used with Opentracing.
tracer
Package tracer contains Datadog's core tracing client.
Package tracer contains Datadog's core tracing client.
globalconfig
Package globalconfig stores configuration which applies globally to both the tracer and integrations.
Package globalconfig stores configuration which applies globally to both the tracer and integrations.
log
Package log provides logging utilities for the tracer.
Package log provides logging utilities for the tracer.
Package profiler periodically collects and sends profiles to the Datadog API.
Package profiler periodically collects and sends profiles to the Datadog API.
internal/stackparse
Package stackparse parses goroutines stack trace dumps as produced by runtime.Stack().
Package stackparse parses goroutines stack trace dumps as produced by runtime.Stack().
tracer
ext

Jump to

Keyboard shortcuts

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