mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 07:19:56 +00:00
TUN-1734: Pin packages at exact versions
This commit is contained in:
32
vendor/github.com/opentracing/opentracing-go/README.md
generated
vendored
32
vendor/github.com/opentracing/opentracing-go/README.md
generated
vendored
@@ -1,4 +1,5 @@
|
||||
[](https://gitter.im/opentracing/public) [](https://travis-ci.org/opentracing/opentracing-go) [](http://godoc.org/github.com/opentracing/opentracing-go)
|
||||
[](https://sourcegraph.com/github.com/opentracing/opentracing-go?badge)
|
||||
|
||||
# OpenTracing API for Go
|
||||
|
||||
@@ -7,8 +8,8 @@ This package is a Go platform API for OpenTracing.
|
||||
## Required Reading
|
||||
|
||||
In order to understand the Go platform API, one must first be familiar with the
|
||||
[OpenTracing project](http://opentracing.io) and
|
||||
[terminology](http://opentracing.io/documentation/pages/spec.html) more specifically.
|
||||
[OpenTracing project](https://opentracing.io) and
|
||||
[terminology](https://opentracing.io/specification/) more specifically.
|
||||
|
||||
## API overview for those adding instrumentation
|
||||
|
||||
@@ -26,7 +27,7 @@ The simplest starting point is `./default_tracer.go`. As early as possible, call
|
||||
import ".../some_tracing_impl"
|
||||
|
||||
func main() {
|
||||
opentracing.InitGlobalTracer(
|
||||
opentracing.SetGlobalTracer(
|
||||
// tracing impl specific:
|
||||
some_tracing_impl.New(...),
|
||||
)
|
||||
@@ -34,7 +35,7 @@ The simplest starting point is `./default_tracer.go`. As early as possible, call
|
||||
}
|
||||
```
|
||||
|
||||
##### Non-Singleton initialization
|
||||
#### Non-Singleton initialization
|
||||
|
||||
If you prefer direct control to singletons, manage ownership of the
|
||||
`opentracing.Tracer` implementation explicitly.
|
||||
@@ -133,6 +134,21 @@ reference.
|
||||
}
|
||||
```
|
||||
|
||||
#### Conditionally capture a field using `log.Noop`
|
||||
|
||||
In some situations, you may want to dynamically decide whether or not
|
||||
to log a field. For example, you may want to capture additional data,
|
||||
such as a customer ID, in non-production environments:
|
||||
|
||||
```go
|
||||
func Customer(order *Order) log.Field {
|
||||
if os.Getenv("ENVIRONMENT") == "dev" {
|
||||
return log.String("customer", order.Customer.ID)
|
||||
}
|
||||
return log.Noop()
|
||||
}
|
||||
```
|
||||
|
||||
#### Goroutine-safety
|
||||
|
||||
The entire public API is goroutine-safe and does not require external
|
||||
@@ -145,3 +161,11 @@ Tracing system implementors may be able to reuse or copy-paste-modify the `basic
|
||||
## API compatibility
|
||||
|
||||
For the time being, "mild" backwards-incompatible changes may be made without changing the major version number. As OpenTracing and `opentracing-go` mature, backwards compatibility will become more of a priority.
|
||||
|
||||
## Tracer test suite
|
||||
|
||||
A test suite is available in the [harness](https://godoc.org/github.com/opentracing/opentracing-go/harness) package that can assist Tracer implementors to assert that their Tracer is working correctly.
|
||||
|
||||
## Licensing
|
||||
|
||||
[Apache 2.0 License](./LICENSE).
|
||||
|
Reference in New Issue
Block a user