coredns/vendor/github.com/DataDog/dd-trace-go
Yong Tang c7321fabc2 Prune dependencies (#1917)
When running `dep prune` explicitly, the following message show up:
```
dep prune
Pruning is now performed automatically by dep ensure.
```

However, after the explicit `dep prune`, there are still many files deleted. (Guess `dep ensure` is not complete yet).

This fix did a `dep prune` to clean up unneeded files.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-06-30 22:47:19 +01:00
..
opentracing Add DD support (#1596) 2018-03-09 15:08:57 -05:00
tracer Prune dependencies (#1917) 2018-06-30 22:47:19 +01:00
.env Dep ensure (#1803) 2018-05-16 13:17:06 -07:00
.gitignore Add DD support (#1596) 2018-03-09 15:08:57 -05:00
circle.yml Add DD support (#1596) 2018-03-09 15:08:57 -05:00
docker-compose.yml Add DD support (#1596) 2018-03-09 15:08:57 -05:00
Gopkg.toml Add DD support (#1596) 2018-03-09 15:08:57 -05:00
LICENSE Add DD support (#1596) 2018-03-09 15:08:57 -05:00
LICENSE-3rdparty.csv Add DD support (#1596) 2018-03-09 15:08:57 -05:00
Rakefile Add DD support (#1596) 2018-03-09 15:08:57 -05:00
README.md Add DD support (#1596) 2018-03-09 15:08:57 -05:00
wait-for-services.sh Add DD support (#1596) 2018-03-09 15:08:57 -05:00

CircleCI Godoc

Datadog APM client that implements an OpenTracing Tracer.

Initialization

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

import (
	// ddtrace namespace is suggested
	ddtrace "github.com/DataDog/dd-trace-go/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 Datadog tracer as a GlobalTracer
	opentracing.SetGlobalTracer(tracer)
	startWebServer()
}

Function NewTracer(config) returns an io.Closer instance that can be used to gracefully shutdown the tracer. It's recommended to always call the closer.Close(), otherwise internal buffers are not flushed and you may lose some traces.

Usage

See Opentracing documentation for some usage patterns. Legacy documentation is available in GoDoc format.

Contributing Quick Start

Requirements:

Run the tests

Start the containers defined in docker-compose.yml so that integrations can be tested:

$ docker-compose up -d
$ ./wait-for-services.sh  # wait that all services are up and running

Fetch package's third-party dependencies (integrations and testing utilities):

$ rake init

This will only work if your working directory is in $GOPATH/src.

Now, you can run your tests via :

$ rake test:lint  # linting via gometalinter
$ rake test:all   # test the tracer and all integrations
$ rake test:race  # use the -race flag

Further Reading

Automatically traced libraries and frameworks: https://godoc.org/github.com/DataDog/dd-trace-go/tracer#pkg-subdirectories Sample code: https://godoc.org/github.com/DataDog/dd-trace-go/tracer#pkg-examples