https://mattermost.atlassian.net/browse/MM-40676

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-02-09 23:05:16 +05:30
коммит произвёл GitHub
родитель 440790dad6
Коммит 57eafbc6ca
322 изменённых файлов: 24889 добавлений и 14797 удалений

12
vendor/github.com/uber/jaeger-client-go/CHANGELOG.md сгенерированный поставляемый
Просмотреть файл

@@ -1,10 +1,16 @@
Changes by Version
==================
2.29.2 (unreleased)
2.30.0 (2021-12-07)
-------------------
- Nothing yet.
- Add deprecation notice -- Yuri Shkuro
- Use public struct for tracer options to document initialization better (#605) -- Yuri Shkuro
- Remove redundant newline in NewReporter init message (#603) -- wwade
- [zipkin] Encode span IDs as full 16-hex strings #601 -- Nathan
- [docs] Replace godoc.org with pkg.go.dev (#591) -- Aaron Jheng
- Remove outdated reference to Zipkin model. -- Yuri Shkuro
- Move thrift compilation to a script (#590) -- Aaron Jheng
- Document JAEGER_TRACEID_128BIT env var -- Yuri Shkuro
2.29.1 (2021-05-24)
-------------------

18
vendor/github.com/uber/jaeger-client-go/Makefile сгенерированный поставляемый
Просмотреть файл

@@ -21,9 +21,7 @@ LINT_LOG=lint.log
THRIFT_VER=0.14
THRIFT_IMG=jaegertracing/thrift:$(THRIFT_VER)
THRIFT=docker run -v "${PWD}:/data" $(THRIFT_IMG) thrift
THRIFT_GO_ARGS=thrift_import="github.com/apache/thrift/lib/go/thrift"
THRIFT_GEN_DIR=thrift-gen
THRIFT=docker run -v "${PWD}:/data" -u ${shell id -u}:${shell id -g} $(THRIFT_IMG) thrift
PASS=$(shell printf "\033[32mPASS\033[0m")
FAIL=$(shell printf "\033[31mFAIL\033[0m")
@@ -105,19 +103,7 @@ thrift: idl-submodule thrift-compile
# TODO at the moment we're not generating tchan_*.go files
.PHONY: thrift-compile
thrift-compile: thrift-image
$(THRIFT) -o /data --gen go:$(THRIFT_GO_ARGS) --out /data/$(THRIFT_GEN_DIR) /data/idl/thrift/agent.thrift
$(THRIFT) -o /data --gen go:$(THRIFT_GO_ARGS) --out /data/$(THRIFT_GEN_DIR) /data/idl/thrift/sampling.thrift
$(THRIFT) -o /data --gen go:$(THRIFT_GO_ARGS) --out /data/$(THRIFT_GEN_DIR) /data/idl/thrift/jaeger.thrift
$(THRIFT) -o /data --gen go:$(THRIFT_GO_ARGS) --out /data/$(THRIFT_GEN_DIR) /data/idl/thrift/zipkincore.thrift
$(THRIFT) -o /data --gen go:$(THRIFT_GO_ARGS) --out /data/$(THRIFT_GEN_DIR) /data/idl/thrift/baggage.thrift
$(THRIFT) -o /data --gen go:$(THRIFT_GO_ARGS) --out /data/crossdock/thrift/ /data/idl/thrift/crossdock/tracetest.thrift
sed -i '' 's|"zipkincore"|"$(PROJECT_ROOT)/thrift-gen/zipkincore"|g' $(THRIFT_GEN_DIR)/agent/*.go
sed -i '' 's|"jaeger"|"$(PROJECT_ROOT)/thrift-gen/jaeger"|g' $(THRIFT_GEN_DIR)/agent/*.go
sed -i '' 's|"github.com/apache/thrift/lib/go/thrift"|"github.com/uber/jaeger-client-go/thrift"|g' \
$(THRIFT_GEN_DIR)/*/*.go crossdock/thrift/tracetest/*.go
rm -rf thrift-gen/*/*-remote
rm -rf crossdock/thrift/*/*-remote
rm -rf thrift-gen/jaeger/collector.go
docker run -v "${PWD}:/data" -u ${shell id -u}:${shell id -g} $(THRIFT_IMG) /data/scripts/gen-thrift.sh
.PHONY: idl-submodule
idl-submodule:

25
vendor/github.com/uber/jaeger-client-go/README.md сгенерированный поставляемый
Просмотреть файл

@@ -1,5 +1,9 @@
[![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![OpenTracing 1.0 Enabled][ot-img]][ot-url]
# 🛑 This library is being deprecated!
We urge all users to migrate to [OpenTelemetry](https://opentelemetry.io/). Please refer to the [notice in the documentation](https://www.jaegertracing.io/docs/latest/client-libraries/#deprecating-jaeger-clients) for details.
# Jaeger Bindings for Go OpenTracing API
Instrumentation library that implements an
@@ -15,6 +19,12 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md).
## Installation
### Preferred
Add `github.com/uber/jaeger-client-go` to `go.mod`.
### Old way
We recommended using a dependency manager like [dep](https://golang.github.io/dep/)
and [semantic versioning](http://semver.org/) when including this library into an application.
For example, Jaeger backend imports this library like this:
@@ -39,15 +49,19 @@ make install
## Initialization
See tracer initialization examples in [godoc](https://godoc.org/github.com/uber/jaeger-client-go/config#pkg-examples)
See tracer initialization examples in [godoc](https://pkg.go.dev/github.com/uber/jaeger-client-go/config#pkg-examples)
and [config/example_test.go](./config/example_test.go).
There are two ways to create a tracer:
* Using [Configuration](https://pkg.go.dev/github.com/uber/jaeger-client-go/config#Configuration) struct that allows declarative configuration. For example, you can populate that struct from a YAML/JSON config, or ask it to initialize itself using environment variables (see next section).
* Using [NewTracer()](https://pkg.go.dev/github.com/uber/jaeger-client-go#NewTracer) function that allows for full programmatic control of configuring the tracer using TracerOptions.
### Environment variables
The tracer can be initialized with values coming from environment variables, if it is
[built from a config](https://pkg.go.dev/github.com/uber/jaeger-client-go/config?tab=doc#Configuration.NewTracer)
that was created via [FromEnv()](https://pkg.go.dev/github.com/uber/jaeger-client-go/config?tab=doc#FromEnv).
None of the env vars are required and all of them can be overridden via direct setting
None of the env vars are required and all of them can be overridden via direct setting
of the property on the configuration object.
Property| Description
@@ -70,6 +84,7 @@ JAEGER_SAMPLING_ENDPOINT | The URL for the sampling configuration server when us
JAEGER_SAMPLER_MAX_OPERATIONS | The maximum number of operations that the sampler will keep track of (default `2000`).
JAEGER_SAMPLER_REFRESH_INTERVAL | How often the `remote` sampler should poll the configuration server for the appropriate sampling strategy, e.g. "1m" or "30s" ([valid units][timeunits]; default `1m`).
JAEGER_TAGS | A comma separated list of `name=value` tracer-level tags, which get added to all reported spans. The value can also refer to an environment variable using the format `${envVarName:defaultValue}`.
JAEGER_TRACEID_128BIT | Whether to enable 128bit trace-id generation, `true` or `false`. If not enabled, the SDK defaults to 64bit trace-ids.
JAEGER_DISABLED | Whether the tracer is disabled or not. If `true`, the `opentracing.NoopTracer` is used (default `false`).
JAEGER_RPC_METRICS | Whether to store RPC metrics, `true` or `false` (default `false`).
@@ -194,7 +209,7 @@ Version 2.20 introduced the ability to delay sampling decisions in the life cycl
of the root span. It involves several features and architectural changes:
* **Shared sampling state**: the sampling state is shared across all local
(i.e. in-process) spans for a given trace.
* **New `SamplerV2` API** allows the sampler to be called at multiple points
* **New `SamplerV2` API** allows the sampler to be called at multiple points
in the life cycle of a span:
* on span creation
* on overwriting span operation name
@@ -311,8 +326,8 @@ defer span.Finish()
[Apache 2.0 License](LICENSE).
[doc-img]: https://godoc.org/github.com/uber/jaeger-client-go?status.svg
[doc]: https://godoc.org/github.com/uber/jaeger-client-go
[doc-img]: https://pkg.go.dev/badge/github.com/uber/jaeger-client-go.svg
[doc]: https://pkg.go.dev/github.com/uber/jaeger-client-go
[ci-img]: https://travis-ci.org/jaegertracing/jaeger-client-go.svg?branch=master
[ci]: https://travis-ci.org/jaegertracing/jaeger-client-go
[cov-img]: https://codecov.io/gh/jaegertracing/jaeger-client-go/branch/master/graph/badge.svg

2
vendor/github.com/uber/jaeger-client-go/config/config.go сгенерированный поставляемый
Просмотреть файл

@@ -420,7 +420,7 @@ func (rc *ReporterConfig) NewReporter(
jaeger.ReporterOptions.Logger(logger),
jaeger.ReporterOptions.Metrics(metrics))
if rc.LogSpans && logger != nil {
logger.Infof("Initializing logging reporter\n")
logger.Infof("Initializing logging reporter")
reporter = jaeger.NewCompositeReporter(jaeger.NewLoggingReporter(logger), reporter)
}
return reporter, err

2
vendor/github.com/uber/jaeger-client-go/constants.go сгенерированный поставляемый
Просмотреть файл

@@ -22,7 +22,7 @@ import (
const (
// JaegerClientVersion is the version of the client library reported as Span tag.
JaegerClientVersion = "Go-2.29.1"
JaegerClientVersion = "Go-2.30.0"
// JaegerClientVersionTagKey is the name of the tag used to report client version.
JaegerClientVersionTagKey = "jaeger.version"

2
vendor/github.com/uber/jaeger-client-go/doc.go сгенерированный поставляемый
Просмотреть файл

@@ -14,8 +14,6 @@
/*
Package jaeger implements an OpenTracing (http://opentracing.io) Tracer.
It is currently using Zipkin-compatible data model and can be directly
itegrated with Zipkin backend (http://zipkin.io).
For integration instructions please refer to the README:

2
vendor/github.com/uber/jaeger-client-go/span_allocator.go сгенерированный поставляемый
Просмотреть файл

@@ -16,7 +16,7 @@ package jaeger
import "sync"
// SpanAllocator abstraction of managign span allocations
// SpanAllocator abstraction of managing span allocations
type SpanAllocator interface {
Get() *Span
Put(*Span)

2
vendor/github.com/uber/jaeger-client-go/thrift/header_context.go сгенерированный поставляемый
Просмотреть файл

@@ -23,7 +23,7 @@ import (
"context"
)
// See https://godoc.org/context#WithValue on why do we need the unexported typedefs.
// See https://pkg.go.dev/context#WithValue on why do we need the unexported typedefs.
type (
headerKey string
headerKeyList int

2
vendor/github.com/uber/jaeger-client-go/thrift/response_helper.go сгенерированный поставляемый
Просмотреть файл

@@ -23,7 +23,7 @@ import (
"context"
)
// See https://godoc.org/context#WithValue on why do we need the unexported typedefs.
// See https://pkg.go.dev/context#WithValue on why do we need the unexported typedefs.
type responseHelperKey struct{}
// TResponseHelper defines a object with a set of helper functions that can be

68
vendor/github.com/uber/jaeger-client-go/tracer_options.go сгенерированный поставляемый
Просмотреть файл

@@ -27,27 +27,30 @@ import (
// TracerOption is a function that sets some option on the tracer
type TracerOption func(tracer *Tracer)
// TracerOptions is a factory for all available TracerOption's
var TracerOptions tracerOptions
// TracerOptions is a factory for all available TracerOption's.
var TracerOptions TracerOptionsFactory
type tracerOptions struct{}
// TracerOptionsFactory is a struct that defines functions for all available TracerOption's.
type TracerOptionsFactory struct{}
// Metrics creates a TracerOption that initializes Metrics on the tracer,
// which is used to emit statistics.
func (tracerOptions) Metrics(m *Metrics) TracerOption {
func (TracerOptionsFactory) Metrics(m *Metrics) TracerOption {
return func(tracer *Tracer) {
tracer.metrics = *m
}
}
// Logger creates a TracerOption that gives the tracer a Logger.
func (tracerOptions) Logger(logger Logger) TracerOption {
func (TracerOptionsFactory) Logger(logger Logger) TracerOption {
return func(tracer *Tracer) {
tracer.logger = log.DebugLogAdapter(logger)
}
}
func (tracerOptions) CustomHeaderKeys(headerKeys *HeadersConfig) TracerOption {
// CustomHeaderKeys allows to override default HTTP header keys used to propagate
// tracing context.
func (TracerOptionsFactory) CustomHeaderKeys(headerKeys *HeadersConfig) TracerOption {
return func(tracer *Tracer) {
if headerKeys == nil {
return
@@ -62,7 +65,7 @@ func (tracerOptions) CustomHeaderKeys(headerKeys *HeadersConfig) TracerOption {
// TimeNow creates a TracerOption that gives the tracer a function
// used to generate timestamps for spans.
func (tracerOptions) TimeNow(timeNow func() time.Time) TracerOption {
func (TracerOptionsFactory) TimeNow(timeNow func() time.Time) TracerOption {
return func(tracer *Tracer) {
tracer.timeNow = timeNow
}
@@ -70,7 +73,7 @@ func (tracerOptions) TimeNow(timeNow func() time.Time) TracerOption {
// RandomNumber creates a TracerOption that gives the tracer
// a thread-safe random number generator function for generating trace IDs.
func (tracerOptions) RandomNumber(randomNumber func() uint64) TracerOption {
func (TracerOptionsFactory) RandomNumber(randomNumber func() uint64) TracerOption {
return func(tracer *Tracer) {
tracer.randomNumber = randomNumber
}
@@ -80,7 +83,7 @@ func (tracerOptions) RandomNumber(randomNumber func() uint64) TracerOption {
// an object pool to minimize span allocations.
// This should be used with care, only if the service is not running any async tasks
// that can access parent spans after those spans have been finished.
func (tracerOptions) PoolSpans(poolSpans bool) TracerOption {
func (TracerOptionsFactory) PoolSpans(poolSpans bool) TracerOption {
return func(tracer *Tracer) {
if poolSpans {
tracer.spanAllocator = newSyncPollSpanAllocator()
@@ -90,56 +93,67 @@ func (tracerOptions) PoolSpans(poolSpans bool) TracerOption {
}
}
// Deprecated: HostIPv4 creates a TracerOption that identifies the current service/process.
// HostIPv4 creates a TracerOption that identifies the current service/process.
// If not set, the factory method will obtain the current IP address.
// The TracerOption is deprecated; the tracer will attempt to automatically detect the IP.
func (tracerOptions) HostIPv4(hostIPv4 uint32) TracerOption {
//
// Deprecated.
func (TracerOptionsFactory) HostIPv4(hostIPv4 uint32) TracerOption {
return func(tracer *Tracer) {
tracer.hostIPv4 = hostIPv4
}
}
func (tracerOptions) Injector(format interface{}, injector Injector) TracerOption {
// Injector registers a Injector for given format.
func (TracerOptionsFactory) Injector(format interface{}, injector Injector) TracerOption {
return func(tracer *Tracer) {
tracer.injectors[format] = injector
}
}
func (tracerOptions) Extractor(format interface{}, extractor Extractor) TracerOption {
// Extractor registers an Extractor for given format.
func (TracerOptionsFactory) Extractor(format interface{}, extractor Extractor) TracerOption {
return func(tracer *Tracer) {
tracer.extractors[format] = extractor
}
}
func (t tracerOptions) Observer(observer Observer) TracerOption {
// Observer registers an Observer.
func (t TracerOptionsFactory) Observer(observer Observer) TracerOption {
return t.ContribObserver(&oldObserver{obs: observer})
}
func (tracerOptions) ContribObserver(observer ContribObserver) TracerOption {
// ContribObserver registers a ContribObserver.
func (TracerOptionsFactory) ContribObserver(observer ContribObserver) TracerOption {
return func(tracer *Tracer) {
tracer.observer.append(observer)
}
}
func (tracerOptions) Gen128Bit(gen128Bit bool) TracerOption {
// Gen128Bit enables generation of 128bit trace IDs.
func (TracerOptionsFactory) Gen128Bit(gen128Bit bool) TracerOption {
return func(tracer *Tracer) {
tracer.options.gen128Bit = gen128Bit
}
}
func (tracerOptions) NoDebugFlagOnForcedSampling(noDebugFlagOnForcedSampling bool) TracerOption {
// NoDebugFlagOnForcedSampling turns off setting the debug flag in the trace context
// when the trace is force-started via sampling=1 span tag.
func (TracerOptionsFactory) NoDebugFlagOnForcedSampling(noDebugFlagOnForcedSampling bool) TracerOption {
return func(tracer *Tracer) {
tracer.options.noDebugFlagOnForcedSampling = noDebugFlagOnForcedSampling
}
}
func (tracerOptions) HighTraceIDGenerator(highTraceIDGenerator func() uint64) TracerOption {
// HighTraceIDGenerator allows to override define ID generator.
func (TracerOptionsFactory) HighTraceIDGenerator(highTraceIDGenerator func() uint64) TracerOption {
return func(tracer *Tracer) {
tracer.options.highTraceIDGenerator = highTraceIDGenerator
}
}
func (tracerOptions) MaxTagValueLength(maxTagValueLength int) TracerOption {
// MaxTagValueLength sets the limit on the max length of tag values.
func (TracerOptionsFactory) MaxTagValueLength(maxTagValueLength int) TracerOption {
return func(tracer *Tracer) {
tracer.options.maxTagValueLength = maxTagValueLength
}
@@ -151,31 +165,37 @@ func (tracerOptions) MaxTagValueLength(maxTagValueLength int) TracerOption {
//
// About half of the MaxLogsPerSpan logs kept are the oldest logs, and about
// half are the newest logs.
func (tracerOptions) MaxLogsPerSpan(maxLogsPerSpan int) TracerOption {
func (TracerOptionsFactory) MaxLogsPerSpan(maxLogsPerSpan int) TracerOption {
return func(tracer *Tracer) {
tracer.options.maxLogsPerSpan = maxLogsPerSpan
}
}
func (tracerOptions) ZipkinSharedRPCSpan(zipkinSharedRPCSpan bool) TracerOption {
// ZipkinSharedRPCSpan enables a mode where server-side span shares the span ID
// from the client span from the incoming request, for compatibility with Zipkin's
// "one span per RPC" model.
func (TracerOptionsFactory) ZipkinSharedRPCSpan(zipkinSharedRPCSpan bool) TracerOption {
return func(tracer *Tracer) {
tracer.options.zipkinSharedRPCSpan = zipkinSharedRPCSpan
}
}
func (tracerOptions) Tag(key string, value interface{}) TracerOption {
// Tag adds a tracer-level tag that will be added to all spans.
func (TracerOptionsFactory) Tag(key string, value interface{}) TracerOption {
return func(tracer *Tracer) {
tracer.tags = append(tracer.tags, Tag{key: key, value: value})
}
}
func (tracerOptions) BaggageRestrictionManager(mgr baggage.RestrictionManager) TracerOption {
// BaggageRestrictionManager registers BaggageRestrictionManager.
func (TracerOptionsFactory) BaggageRestrictionManager(mgr baggage.RestrictionManager) TracerOption {
return func(tracer *Tracer) {
tracer.baggageRestrictionManager = mgr
}
}
func (tracerOptions) DebugThrottler(throttler throttler.Throttler) TracerOption {
// DebugThrottler registers a Throttler for debug spans.
func (TracerOptionsFactory) DebugThrottler(throttler throttler.Throttler) TracerOption {
return func(tracer *Tracer) {
tracer.debugThrottler = throttler
}

2
vendor/github.com/uber/jaeger-client-go/zipkin/README.md сгенерированный поставляемый
Просмотреть файл

@@ -40,7 +40,7 @@ func main() {
}
```
If you'd like to follow the official guides from https://godoc.org/github.com/uber/jaeger-client-go/config#example-Configuration-InitGlobalTracer-Production, here is an example.
If you'd like to follow the official guides from https://pkg.go.dev/github.com/uber/jaeger-client-go/config#example-Configuration-InitGlobalTracer-Production, here is an example.
```go
import (

4
vendor/github.com/uber/jaeger-client-go/zipkin/propagation.go сгенерированный поставляемый
Просмотреть файл

@@ -61,9 +61,9 @@ func (p Propagator) Inject(
textMapWriter.Set("x-b3-traceid", sc.TraceID().String())
if sc.ParentID() != 0 {
textMapWriter.Set("x-b3-parentspanid", strconv.FormatUint(uint64(sc.ParentID()), 16))
textMapWriter.Set("x-b3-parentspanid", sc.ParentID().String())
}
textMapWriter.Set("x-b3-spanid", strconv.FormatUint(uint64(sc.SpanID()), 16))
textMapWriter.Set("x-b3-spanid", sc.SpanID().String())
if sc.IsSampled() {
textMapWriter.Set("x-b3-sampled", "1")
} else {