Bump helm.sh/helm/v3 from 3.10.3 to 3.11.1 (#5528)
This commit is contained in:
23
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
generated
vendored
23
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
generated
vendored
@@ -164,10 +164,10 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
var bw bodyWrapper
|
||||
// if request body is nil we don't want to mutate the body as it will affect
|
||||
// the identity of it in an unforeseeable way because we assert ReadCloser
|
||||
// fulfills a certain interface and it is indeed nil.
|
||||
if r.Body != nil {
|
||||
// if request body is nil or NoBody, we don't want to mutate the body as it
|
||||
// will affect the identity of it in an unforeseeable way because we assert
|
||||
// ReadCloser fulfills a certain interface and it is indeed nil or NoBody.
|
||||
if r.Body != nil && r.Body != http.NoBody {
|
||||
bw.ReadCloser = r.Body
|
||||
bw.record = readRecordFunc
|
||||
r.Body = &bw
|
||||
@@ -180,7 +180,13 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
rww := &respWriterWrapper{ResponseWriter: w, record: writeRecordFunc, ctx: ctx, props: h.propagators}
|
||||
rww := &respWriterWrapper{
|
||||
ResponseWriter: w,
|
||||
record: writeRecordFunc,
|
||||
ctx: ctx,
|
||||
props: h.propagators,
|
||||
statusCode: 200, // default status code in case the Handler doesn't write anything
|
||||
}
|
||||
|
||||
// Wrap w to use our ResponseWriter methods while also exposing
|
||||
// other interfaces that w may implement (http.CloseNotifier,
|
||||
@@ -230,10 +236,9 @@ func setAfterServeAttributes(span trace.Span, read, wrote int64, statusCode int,
|
||||
if wrote > 0 {
|
||||
attributes = append(attributes, WroteBytesKey.Int64(wrote))
|
||||
}
|
||||
if statusCode > 0 {
|
||||
attributes = append(attributes, semconv.HTTPAttributesFromHTTPStatusCode(statusCode)...)
|
||||
span.SetStatus(semconv.SpanStatusFromHTTPStatusCodeAndSpanKind(statusCode, trace.SpanKindServer))
|
||||
}
|
||||
attributes = append(attributes, semconv.HTTPAttributesFromHTTPStatusCode(statusCode)...)
|
||||
span.SetStatus(semconv.SpanStatusFromHTTPStatusCodeAndSpanKind(statusCode, trace.SpanKindServer))
|
||||
|
||||
if werr != nil && werr != io.EOF {
|
||||
attributes = append(attributes, WriteErrorKey.String(werr.Error()))
|
||||
}
|
||||
|
||||
2
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
generated
vendored
2
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
generated
vendored
@@ -16,7 +16,7 @@ package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http
|
||||
|
||||
// Version is the current release version of the otelhttp instrumentation.
|
||||
func Version() string {
|
||||
return "0.35.0"
|
||||
return "0.37.0"
|
||||
// This string is updated by the pre_release.sh script during release
|
||||
}
|
||||
|
||||
|
||||
6
vendor/go.opentelemetry.io/otel/.golangci.yml
generated
vendored
6
vendor/go.opentelemetry.io/otel/.golangci.yml
generated
vendored
@@ -9,7 +9,6 @@ linters:
|
||||
disable-all: true
|
||||
# Specifically enable linters we want to use.
|
||||
enable:
|
||||
- deadcode
|
||||
- depguard
|
||||
- errcheck
|
||||
- godot
|
||||
@@ -21,10 +20,8 @@ linters:
|
||||
- misspell
|
||||
- revive
|
||||
- staticcheck
|
||||
- structcheck
|
||||
- typecheck
|
||||
- unused
|
||||
- varcheck
|
||||
|
||||
issues:
|
||||
# Maximum issues count per one linter.
|
||||
@@ -114,8 +111,9 @@ linters-settings:
|
||||
- name: constant-logical-expr
|
||||
disabled: false
|
||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-as-argument
|
||||
# TODO (#3372) reenable linter when it is compatible. https://github.com/golangci/golangci-lint/issues/3280
|
||||
- name: context-as-argument
|
||||
disabled: false
|
||||
disabled: true
|
||||
arguments:
|
||||
allowTypesBefore: "*testing.T"
|
||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#context-keys-type
|
||||
|
||||
190
vendor/go.opentelemetry.io/otel/CHANGELOG.md
generated
vendored
190
vendor/go.opentelemetry.io/otel/CHANGELOG.md
generated
vendored
@@ -8,6 +8,186 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.11.2/0.34.0] 2022-12-05
|
||||
|
||||
### Added
|
||||
|
||||
- The `WithView` `Option` is added to the `go.opentelemetry.io/otel/sdk/metric` package.
|
||||
This option is used to configure the view(s) a `MeterProvider` will use for all `Reader`s that are registered with it. (#3387)
|
||||
- Add Instrumentation Scope and Version as info metric and label in Prometheus exporter.
|
||||
This can be disabled using the `WithoutScopeInfo()` option added to that package.(#3273, #3357)
|
||||
- OTLP exporters now recognize: (#3363)
|
||||
- `OTEL_EXPORTER_OTLP_INSECURE`
|
||||
- `OTEL_EXPORTER_OTLP_TRACES_INSECURE`
|
||||
- `OTEL_EXPORTER_OTLP_METRICS_INSECURE`
|
||||
- `OTEL_EXPORTER_OTLP_CLIENT_KEY`
|
||||
- `OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY`
|
||||
- `OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY`
|
||||
- `OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE`
|
||||
- `OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE`
|
||||
- `OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE`
|
||||
- The `View` type and related `NewView` function to create a view according to the OpenTelemetry specification are added to `go.opentelemetry.io/otel/sdk/metric`.
|
||||
These additions are replacements for the `View` type and `New` function from `go.opentelemetry.io/otel/sdk/metric/view`. (#3459)
|
||||
- The `Instrument` and `InstrumentKind` type are added to `go.opentelemetry.io/otel/sdk/metric`.
|
||||
These additions are replacements for the `Instrument` and `InstrumentKind` types from `go.opentelemetry.io/otel/sdk/metric/view`. (#3459)
|
||||
- The `Stream` type is added to `go.opentelemetry.io/otel/sdk/metric` to define a metric data stream a view will produce. (#3459)
|
||||
- The `AssertHasAttributes` allows instrument authors to test that datapoints returned have appropriate attributes. (#3487)
|
||||
|
||||
### Changed
|
||||
|
||||
- The `"go.opentelemetry.io/otel/sdk/metric".WithReader` option no longer accepts views to associate with the `Reader`.
|
||||
Instead, views are now registered directly with the `MeterProvider` via the new `WithView` option.
|
||||
The views registered with the `MeterProvider` apply to all `Reader`s. (#3387)
|
||||
- The `Temporality(view.InstrumentKind) metricdata.Temporality` and `Aggregation(view.InstrumentKind) aggregation.Aggregation` methods are added to the `"go.opentelemetry.io/otel/sdk/metric".Exporter` interface. (#3260)
|
||||
- The `Temporality(view.InstrumentKind) metricdata.Temporality` and `Aggregation(view.InstrumentKind) aggregation.Aggregation` methods are added to the `"go.opentelemetry.io/otel/exporters/otlp/otlpmetric".Client` interface. (#3260)
|
||||
- The `WithTemporalitySelector` and `WithAggregationSelector` `ReaderOption`s have been changed to `ManualReaderOption`s in the `go.opentelemetry.io/otel/sdk/metric` package. (#3260)
|
||||
- The periodic reader in the `go.opentelemetry.io/otel/sdk/metric` package now uses the temporality and aggregation selectors from its configured exporter instead of accepting them as options. (#3260)
|
||||
|
||||
### Fixed
|
||||
|
||||
- The `go.opentelemetry.io/otel/exporters/prometheus` exporter fixes duplicated `_total` suffixes. (#3369)
|
||||
- Remove comparable requirement for `Reader`s. (#3387)
|
||||
- Cumulative metrics from the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) are defined as monotonic sums, instead of non-monotonic. (#3389)
|
||||
- Asynchronous counters (`Counter` and `UpDownCounter`) from the metric SDK now produce delta sums when configured with delta temporality. (#3398)
|
||||
- Exported `Status` codes in the `go.opentelemetry.io/otel/exporters/zipkin` exporter are now exported as all upper case values. (#3340)
|
||||
- `Aggregation`s from `go.opentelemetry.io/otel/sdk/metric` with no data are not exported. (#3394, #3436)
|
||||
- Reenabled Attribute Filters in the Metric SDK. (#3396)
|
||||
- Asynchronous callbacks are only called if they are registered with at least one instrument that does not use drop aggragation. (#3408)
|
||||
- Do not report empty partial-success responses in the `go.opentelemetry.io/otel/exporters/otlp` exporters. (#3438, #3432)
|
||||
- Handle partial success responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` exporters. (#3162, #3440)
|
||||
- Prevent duplicate Prometheus description, unit, and type. (#3469)
|
||||
- Prevents panic when using incorrect `attribute.Value.As[Type]Slice()`. (#3489)
|
||||
|
||||
## Removed
|
||||
|
||||
- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.Client` interface is removed. (#3486)
|
||||
- The `go.opentelemetry.io/otel/exporters/otlp/otlpmetric.New` function is removed. Use the `otlpmetric[http|grpc].New` directly. (#3486)
|
||||
|
||||
### Deprecated
|
||||
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/view` package is deprecated.
|
||||
Use `Instrument`, `InstrumentKind`, `View`, and `NewView` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3476)
|
||||
|
||||
## [1.11.1/0.33.0] 2022-10-19
|
||||
|
||||
### Added
|
||||
|
||||
- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` registers with a Prometheus registerer on creation.
|
||||
By default, it will register with the default Prometheus registerer.
|
||||
A non-default registerer can be used by passing the `WithRegisterer` option. (#3239)
|
||||
- Added the `WithAggregationSelector` option to the `go.opentelemetry.io/otel/exporters/prometheus` package to change the default `AggregationSelector` used. (#3341)
|
||||
- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` converts the `Resource` associated with metric exports into a `target_info` metric. (#3285)
|
||||
|
||||
### Changed
|
||||
|
||||
- The `"go.opentelemetry.io/otel/exporters/prometheus".New` function is updated to return an error.
|
||||
It will return an error if the exporter fails to register with Prometheus. (#3239)
|
||||
|
||||
### Fixed
|
||||
|
||||
- The URL-encoded values from the `OTEL_RESOURCE_ATTRIBUTES` environment variable are decoded. (#2963)
|
||||
- The `baggage.NewMember` function decodes the `value` parameter instead of directly using it.
|
||||
This fixes the implementation to be compliant with the W3C specification. (#3226)
|
||||
- Slice attributes of the `attribute` package are now comparable based on their value, not instance. (#3108 #3252)
|
||||
- The `Shutdown` and `ForceFlush` methods of the `"go.opentelemetry.io/otel/sdk/trace".TraceProvider` no longer return an error when no processor is registered. (#3268)
|
||||
- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` cumulatively sums histogram buckets. (#3281)
|
||||
- The sum of each histogram data point is now uniquely exported by the `go.opentelemetry.io/otel/exporters/otlpmetric` exporters. (#3284, #3293)
|
||||
- Recorded values for asynchronous counters (`Counter` and `UpDownCounter`) are interpreted as exact, not incremental, sum values by the metric SDK. (#3350, #3278)
|
||||
- `UpDownCounters` are now correctly output as Prometheus gauges in the `go.opentelemetry.io/otel/exporters/prometheus` exporter. (#3358)
|
||||
- The Prometheus exporter in `go.opentelemetry.io/otel/exporters/prometheus` no longer describes the metrics it will send to Prometheus on startup.
|
||||
Instead the exporter is defined as an "unchecked" collector for Prometheus.
|
||||
This fixes the `reader is not registered` warning currently emitted on startup. (#3291 #3342)
|
||||
- The `go.opentelemetry.io/otel/exporters/prometheus` exporter now correctly adds `_total` suffixes to counter metrics. (#3360)
|
||||
- The `go.opentelemetry.io/otel/exporters/prometheus` exporter now adds a unit suffix to metric names.
|
||||
This can be disabled using the `WithoutUnits()` option added to that package. (#3352)
|
||||
|
||||
## [1.11.0/0.32.3] 2022-10-12
|
||||
|
||||
### Added
|
||||
|
||||
- Add default User-Agent header to OTLP exporter requests (`go.opentelemetry.io/otel/exporters/otlptrace/otlptracegrpc` and `go.opentelemetry.io/otel/exporters/otlptrace/otlptracehttp`). (#3261)
|
||||
|
||||
### Changed
|
||||
|
||||
- `span.SetStatus` has been updated such that calls that lower the status are now no-ops. (#3214)
|
||||
- Upgrade `golang.org/x/sys/unix` from `v0.0.0-20210423185535-09eb48e85fd7` to `v0.0.0-20220919091848-fb04ddd9f9c8`.
|
||||
This addresses [GO-2022-0493](https://pkg.go.dev/vuln/GO-2022-0493). (#3235)
|
||||
|
||||
## [0.32.2] Metric SDK (Alpha) - 2022-10-11
|
||||
|
||||
### Added
|
||||
|
||||
- Added an example of using metric views to customize instruments. (#3177)
|
||||
- Add default User-Agent header to OTLP exporter requests (`go.opentelemetry.io/otel/exporters/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlpmetric/otlpmetrichttp`). (#3261)
|
||||
|
||||
### Changed
|
||||
|
||||
- Flush pending measurements with the `PeriodicReader` in the `go.opentelemetry.io/otel/sdk/metric` when `ForceFlush` or `Shutdown` are called. (#3220)
|
||||
- Update histogram default bounds to match the requirements of the latest specification. (#3222)
|
||||
- Encode the HTTP status code in the OpenTracing bridge (`go.opentelemetry.io/otel/bridge/opentracing`) as an integer. (#3265)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Use default view if instrument does not match any registered view of a reader. (#3224, #3237)
|
||||
- Return the same instrument every time a user makes the exact same instrument creation call. (#3229, #3251)
|
||||
- Return the existing instrument when a view transforms a creation call to match an existing instrument. (#3240, #3251)
|
||||
- Log a warning when a conflicting instrument (e.g. description, unit, data-type) is created instead of returning an error. (#3251)
|
||||
- The OpenCensus bridge no longer sends empty batches of metrics. (#3263)
|
||||
|
||||
## [0.32.1] Metric SDK (Alpha) - 2022-09-22
|
||||
|
||||
### Changed
|
||||
|
||||
- The Prometheus exporter sanitizes OpenTelemetry instrument names when exporting.
|
||||
Invalid characters are replaced with `_`. (#3212)
|
||||
|
||||
### Added
|
||||
|
||||
- The metric portion of the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) has been reintroduced. (#3192)
|
||||
- The OpenCensus bridge example (`go.opentelemetry.io/otel/example/opencensus`) has been reintroduced. (#3206)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Updated go.mods to point to valid versions of the sdk. (#3216)
|
||||
- Set the `MeterProvider` resource on all exported metric data. (#3218)
|
||||
|
||||
## [0.32.0] Revised Metric SDK (Alpha) - 2022-09-18
|
||||
|
||||
### Changed
|
||||
|
||||
- The metric SDK in `go.opentelemetry.io/otel/sdk/metric` is completely refactored to comply with the OpenTelemetry specification.
|
||||
Please see the package documentation for how the new SDK is initialized and configured. (#3175)
|
||||
- Update the minimum supported go version to go1.18. Removes support for go1.17 (#3179)
|
||||
|
||||
### Removed
|
||||
|
||||
- The metric portion of the OpenCensus bridge (`go.opentelemetry.io/otel/bridge/opencensus`) has been removed.
|
||||
A new bridge compliant with the revised metric SDK will be added back in a future release. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/aggregator/histogram` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/aggregator/sum` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/aggregator` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/controller/basic` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/controller/controllertest` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/controller/time` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/export/aggregation` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/export` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/metrictest` package is removed.
|
||||
A replacement package that supports the new metric SDK will be added back in a future release. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/number` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/processor/basic` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/processor/processortest` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/processor/reducer` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/registry` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/sdkapi` package is removed, see the new metric SDK. (#3175)
|
||||
- The `go.opentelemetry.io/otel/sdk/metric/selector/simple` package is removed, see the new metric SDK. (#3175)
|
||||
- The `"go.opentelemetry.io/otel/sdk/metric".ErrUninitializedInstrument` variable was removed. (#3175)
|
||||
- The `"go.opentelemetry.io/otel/sdk/metric".ErrBadInstrument` variable was removed. (#3175)
|
||||
- The `"go.opentelemetry.io/otel/sdk/metric".Accumulator` type was removed, see the `MeterProvider`in the new metric SDK. (#3175)
|
||||
- The `"go.opentelemetry.io/otel/sdk/metric".NewAccumulator` function was removed, see `NewMeterProvider`in the new metric SDK. (#3175)
|
||||
- The deprecated `"go.opentelemetry.io/otel/sdk/metric".AtomicFieldOffsets` function was removed. (#3175)
|
||||
|
||||
## [1.10.0] - 2022-09-09
|
||||
|
||||
### Added
|
||||
@@ -191,7 +371,7 @@ Code instrumented with the `go.opentelemetry.io/otel/metric` will need to be mod
|
||||
- `OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT`
|
||||
- `OTEL_SPAN_LINK_COUNT_LIMIT`
|
||||
- `OTEL_LINK_ATTRIBUTE_COUNT_LIMIT`
|
||||
|
||||
|
||||
If the provided environment variables are invalid (negative), the default values would be used.
|
||||
- Rename the `gc` runtime name to `go` (#2560)
|
||||
- Add resource container ID detection. (#2418)
|
||||
@@ -1907,7 +2087,13 @@ It contains api and sdk for trace and meter.
|
||||
- CircleCI build CI manifest files.
|
||||
- CODEOWNERS file to track owners of this project.
|
||||
|
||||
[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.10.0...HEAD
|
||||
[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.11.2...HEAD
|
||||
[1.11.2/0.34.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.2
|
||||
[1.11.1/0.33.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.1
|
||||
[1.11.0/0.32.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.11.0
|
||||
[0.32.2]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.2
|
||||
[0.32.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.1
|
||||
[0.32.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/sdk/metric/v0.32.0
|
||||
[1.10.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.10.0
|
||||
[1.9.0/0.0.3]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.9.0
|
||||
[1.8.0/0.31.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.8.0
|
||||
|
||||
4
vendor/go.opentelemetry.io/otel/Makefile
generated
vendored
4
vendor/go.opentelemetry.io/otel/Makefile
generated
vendored
@@ -17,7 +17,7 @@ TOOLS_MOD_DIR := ./internal/tools
|
||||
ALL_DOCS := $(shell find . -name '*.md' -type f | sort)
|
||||
ALL_GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
|
||||
OTEL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR), $(ALL_GO_MOD_DIRS))
|
||||
ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | egrep -v '^./example|^$(TOOLS_MOD_DIR)' | sort)
|
||||
ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | grep -E -v '^./example|^$(TOOLS_MOD_DIR)' | sort)
|
||||
|
||||
GO = go
|
||||
TIMEOUT = 60
|
||||
@@ -156,7 +156,7 @@ go-mod-tidy/%: DIR=$*
|
||||
go-mod-tidy/%: | crosslink
|
||||
@echo "$(GO) mod tidy in $(DIR)" \
|
||||
&& cd $(DIR) \
|
||||
&& $(GO) mod tidy -compat=1.17
|
||||
&& $(GO) mod tidy -compat=1.18
|
||||
|
||||
.PHONY: lint-modules
|
||||
lint-modules: go-mod-tidy
|
||||
|
||||
5
vendor/go.opentelemetry.io/otel/README.md
generated
vendored
5
vendor/go.opentelemetry.io/otel/README.md
generated
vendored
@@ -52,19 +52,14 @@ Currently, this project supports the following environments.
|
||||
| ------- | ---------- | ------------ |
|
||||
| Ubuntu | 1.19 | amd64 |
|
||||
| Ubuntu | 1.18 | amd64 |
|
||||
| Ubuntu | 1.17 | amd64 |
|
||||
| Ubuntu | 1.19 | 386 |
|
||||
| Ubuntu | 1.18 | 386 |
|
||||
| Ubuntu | 1.17 | 386 |
|
||||
| MacOS | 1.19 | amd64 |
|
||||
| MacOS | 1.18 | amd64 |
|
||||
| MacOS | 1.17 | amd64 |
|
||||
| Windows | 1.19 | amd64 |
|
||||
| Windows | 1.18 | amd64 |
|
||||
| Windows | 1.17 | amd64 |
|
||||
| Windows | 1.19 | 386 |
|
||||
| Windows | 1.18 | 386 |
|
||||
| Windows | 1.17 | 386 |
|
||||
|
||||
While this project should work for other systems, no compatibility guarantees
|
||||
are made for those systems currently.
|
||||
|
||||
95
vendor/go.opentelemetry.io/otel/attribute/value.go
generated
vendored
95
vendor/go.opentelemetry.io/otel/attribute/value.go
generated
vendored
@@ -17,9 +17,11 @@ package attribute // import "go.opentelemetry.io/otel/attribute"
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strconv"
|
||||
|
||||
"go.opentelemetry.io/otel/internal"
|
||||
"go.opentelemetry.io/otel/internal/attribute"
|
||||
)
|
||||
|
||||
//go:generate stringer -type=Type
|
||||
@@ -66,12 +68,7 @@ func BoolValue(v bool) Value {
|
||||
|
||||
// BoolSliceValue creates a BOOLSLICE Value.
|
||||
func BoolSliceValue(v []bool) Value {
|
||||
cp := make([]bool, len(v))
|
||||
copy(cp, v)
|
||||
return Value{
|
||||
vtype: BOOLSLICE,
|
||||
slice: &cp,
|
||||
}
|
||||
return Value{vtype: BOOLSLICE, slice: attribute.SliceValue(v)}
|
||||
}
|
||||
|
||||
// IntValue creates an INT64 Value.
|
||||
@@ -81,13 +78,14 @@ func IntValue(v int) Value {
|
||||
|
||||
// IntSliceValue creates an INTSLICE Value.
|
||||
func IntSliceValue(v []int) Value {
|
||||
cp := make([]int64, 0, len(v))
|
||||
for _, i := range v {
|
||||
cp = append(cp, int64(i))
|
||||
var int64Val int64
|
||||
cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(int64Val)))
|
||||
for i, val := range v {
|
||||
cp.Elem().Index(i).SetInt(int64(val))
|
||||
}
|
||||
return Value{
|
||||
vtype: INT64SLICE,
|
||||
slice: &cp,
|
||||
slice: cp.Elem().Interface(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,12 +99,7 @@ func Int64Value(v int64) Value {
|
||||
|
||||
// Int64SliceValue creates an INT64SLICE Value.
|
||||
func Int64SliceValue(v []int64) Value {
|
||||
cp := make([]int64, len(v))
|
||||
copy(cp, v)
|
||||
return Value{
|
||||
vtype: INT64SLICE,
|
||||
slice: &cp,
|
||||
}
|
||||
return Value{vtype: INT64SLICE, slice: attribute.SliceValue(v)}
|
||||
}
|
||||
|
||||
// Float64Value creates a FLOAT64 Value.
|
||||
@@ -119,12 +112,7 @@ func Float64Value(v float64) Value {
|
||||
|
||||
// Float64SliceValue creates a FLOAT64SLICE Value.
|
||||
func Float64SliceValue(v []float64) Value {
|
||||
cp := make([]float64, len(v))
|
||||
copy(cp, v)
|
||||
return Value{
|
||||
vtype: FLOAT64SLICE,
|
||||
slice: &cp,
|
||||
}
|
||||
return Value{vtype: FLOAT64SLICE, slice: attribute.SliceValue(v)}
|
||||
}
|
||||
|
||||
// StringValue creates a STRING Value.
|
||||
@@ -137,12 +125,7 @@ func StringValue(v string) Value {
|
||||
|
||||
// StringSliceValue creates a STRINGSLICE Value.
|
||||
func StringSliceValue(v []string) Value {
|
||||
cp := make([]string, len(v))
|
||||
copy(cp, v)
|
||||
return Value{
|
||||
vtype: STRINGSLICE,
|
||||
slice: &cp,
|
||||
}
|
||||
return Value{vtype: STRINGSLICE, slice: attribute.SliceValue(v)}
|
||||
}
|
||||
|
||||
// Type returns a type of the Value.
|
||||
@@ -159,10 +142,14 @@ func (v Value) AsBool() bool {
|
||||
// AsBoolSlice returns the []bool value. Make sure that the Value's type is
|
||||
// BOOLSLICE.
|
||||
func (v Value) AsBoolSlice() []bool {
|
||||
if s, ok := v.slice.(*[]bool); ok {
|
||||
return *s
|
||||
if v.vtype != BOOLSLICE {
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
return v.asBoolSlice()
|
||||
}
|
||||
|
||||
func (v Value) asBoolSlice() []bool {
|
||||
return attribute.AsSlice[bool](v.slice)
|
||||
}
|
||||
|
||||
// AsInt64 returns the int64 value. Make sure that the Value's type is
|
||||
@@ -174,10 +161,14 @@ func (v Value) AsInt64() int64 {
|
||||
// AsInt64Slice returns the []int64 value. Make sure that the Value's type is
|
||||
// INT64SLICE.
|
||||
func (v Value) AsInt64Slice() []int64 {
|
||||
if s, ok := v.slice.(*[]int64); ok {
|
||||
return *s
|
||||
if v.vtype != INT64SLICE {
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
return v.asInt64Slice()
|
||||
}
|
||||
|
||||
func (v Value) asInt64Slice() []int64 {
|
||||
return attribute.AsSlice[int64](v.slice)
|
||||
}
|
||||
|
||||
// AsFloat64 returns the float64 value. Make sure that the Value's
|
||||
@@ -189,10 +180,14 @@ func (v Value) AsFloat64() float64 {
|
||||
// AsFloat64Slice returns the []float64 value. Make sure that the Value's type is
|
||||
// FLOAT64SLICE.
|
||||
func (v Value) AsFloat64Slice() []float64 {
|
||||
if s, ok := v.slice.(*[]float64); ok {
|
||||
return *s
|
||||
if v.vtype != FLOAT64SLICE {
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
return v.asFloat64Slice()
|
||||
}
|
||||
|
||||
func (v Value) asFloat64Slice() []float64 {
|
||||
return attribute.AsSlice[float64](v.slice)
|
||||
}
|
||||
|
||||
// AsString returns the string value. Make sure that the Value's type
|
||||
@@ -204,10 +199,14 @@ func (v Value) AsString() string {
|
||||
// AsStringSlice returns the []string value. Make sure that the Value's type is
|
||||
// STRINGSLICE.
|
||||
func (v Value) AsStringSlice() []string {
|
||||
if s, ok := v.slice.(*[]string); ok {
|
||||
return *s
|
||||
if v.vtype != STRINGSLICE {
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
return v.asStringSlice()
|
||||
}
|
||||
|
||||
func (v Value) asStringSlice() []string {
|
||||
return attribute.AsSlice[string](v.slice)
|
||||
}
|
||||
|
||||
type unknownValueType struct{}
|
||||
@@ -218,19 +217,19 @@ func (v Value) AsInterface() interface{} {
|
||||
case BOOL:
|
||||
return v.AsBool()
|
||||
case BOOLSLICE:
|
||||
return v.AsBoolSlice()
|
||||
return v.asBoolSlice()
|
||||
case INT64:
|
||||
return v.AsInt64()
|
||||
case INT64SLICE:
|
||||
return v.AsInt64Slice()
|
||||
return v.asInt64Slice()
|
||||
case FLOAT64:
|
||||
return v.AsFloat64()
|
||||
case FLOAT64SLICE:
|
||||
return v.AsFloat64Slice()
|
||||
return v.asFloat64Slice()
|
||||
case STRING:
|
||||
return v.stringly
|
||||
case STRINGSLICE:
|
||||
return v.AsStringSlice()
|
||||
return v.asStringSlice()
|
||||
}
|
||||
return unknownValueType{}
|
||||
}
|
||||
@@ -239,19 +238,19 @@ func (v Value) AsInterface() interface{} {
|
||||
func (v Value) Emit() string {
|
||||
switch v.Type() {
|
||||
case BOOLSLICE:
|
||||
return fmt.Sprint(*(v.slice.(*[]bool)))
|
||||
return fmt.Sprint(v.asBoolSlice())
|
||||
case BOOL:
|
||||
return strconv.FormatBool(v.AsBool())
|
||||
case INT64SLICE:
|
||||
return fmt.Sprint(*(v.slice.(*[]int64)))
|
||||
return fmt.Sprint(v.asInt64Slice())
|
||||
case INT64:
|
||||
return strconv.FormatInt(v.AsInt64(), 10)
|
||||
case FLOAT64SLICE:
|
||||
return fmt.Sprint(*(v.slice.(*[]float64)))
|
||||
return fmt.Sprint(v.asFloat64Slice())
|
||||
case FLOAT64:
|
||||
return fmt.Sprint(v.AsFloat64())
|
||||
case STRINGSLICE:
|
||||
return fmt.Sprint(*(v.slice.(*[]string)))
|
||||
return fmt.Sprint(v.asStringSlice())
|
||||
case STRING:
|
||||
return v.stringly
|
||||
default:
|
||||
|
||||
18
vendor/go.opentelemetry.io/otel/baggage/baggage.go
generated
vendored
18
vendor/go.opentelemetry.io/otel/baggage/baggage.go
generated
vendored
@@ -250,8 +250,9 @@ type Member struct {
|
||||
hasData bool
|
||||
}
|
||||
|
||||
// NewMember returns a new Member from the passed arguments. An error is
|
||||
// returned if the created Member would be invalid according to the W3C
|
||||
// NewMember returns a new Member from the passed arguments. The key will be
|
||||
// used directly while the value will be url decoded after validation. An error
|
||||
// is returned if the created Member would be invalid according to the W3C
|
||||
// Baggage specification.
|
||||
func NewMember(key, value string, props ...Property) (Member, error) {
|
||||
m := Member{
|
||||
@@ -263,7 +264,11 @@ func NewMember(key, value string, props ...Property) (Member, error) {
|
||||
if err := m.validate(); err != nil {
|
||||
return newInvalidMember(), err
|
||||
}
|
||||
|
||||
decodedValue, err := url.QueryUnescape(value)
|
||||
if err != nil {
|
||||
return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
|
||||
}
|
||||
m.value = decodedValue
|
||||
return m, nil
|
||||
}
|
||||
|
||||
@@ -328,8 +333,9 @@ func parseMember(member string) (Member, error) {
|
||||
return Member{key: key, value: value, properties: props, hasData: true}, nil
|
||||
}
|
||||
|
||||
// validate ensures m conforms to the W3C Baggage specification, returning an
|
||||
// error otherwise.
|
||||
// validate ensures m conforms to the W3C Baggage specification.
|
||||
// A key is just an ASCII string, but a value must be URL encoded UTF-8,
|
||||
// returning an error otherwise.
|
||||
func (m Member) validate() error {
|
||||
if !m.hasData {
|
||||
return fmt.Errorf("%w: %q", errInvalidMember, m)
|
||||
@@ -465,6 +471,7 @@ func (b Baggage) Member(key string) Member {
|
||||
key: key,
|
||||
value: v.Value,
|
||||
properties: fromInternalProperties(v.Properties),
|
||||
hasData: true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -484,6 +491,7 @@ func (b Baggage) Members() []Member {
|
||||
key: k,
|
||||
value: v.Value,
|
||||
properties: fromInternalProperties(v.Properties),
|
||||
hasData: true,
|
||||
})
|
||||
}
|
||||
return members
|
||||
|
||||
10
vendor/go.opentelemetry.io/otel/codes/codes.go
generated
vendored
10
vendor/go.opentelemetry.io/otel/codes/codes.go
generated
vendored
@@ -23,10 +23,20 @@ import (
|
||||
const (
|
||||
// Unset is the default status code.
|
||||
Unset Code = 0
|
||||
|
||||
// Error indicates the operation contains an error.
|
||||
//
|
||||
// NOTE: The error code in OTLP is 2.
|
||||
// The value of this enum is only relevant to the internals
|
||||
// of the Go SDK.
|
||||
Error Code = 1
|
||||
|
||||
// Ok indicates operation has been validated by an Application developers
|
||||
// or Operator to have completed successfully, or contain no error.
|
||||
//
|
||||
// NOTE: The Ok code in OTLP is 1.
|
||||
// The value of this enum is only relevant to the internals
|
||||
// of the Go SDK.
|
||||
Ok Code = 2
|
||||
|
||||
maxCode = 3
|
||||
|
||||
81
vendor/go.opentelemetry.io/otel/exporters/otlp/internal/envconfig/envconfig.go
generated
vendored
81
vendor/go.opentelemetry.io/otel/exporters/otlp/internal/envconfig/envconfig.go
generated
vendored
@@ -23,6 +23,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go.opentelemetry.io/otel/internal/global"
|
||||
)
|
||||
|
||||
// ConfigFn is the generic function used to set a config.
|
||||
@@ -59,13 +61,26 @@ func WithString(n string, fn func(string)) func(e *EnvOptionsReader) {
|
||||
}
|
||||
}
|
||||
|
||||
// WithBool returns a ConfigFn that reads the environment variable n and if it exists passes its parsed bool value to fn.
|
||||
func WithBool(n string, fn func(bool)) ConfigFn {
|
||||
return func(e *EnvOptionsReader) {
|
||||
if v, ok := e.GetEnvValue(n); ok {
|
||||
b := strings.ToLower(v) == "true"
|
||||
fn(b)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithDuration retrieves the specified config and passes it to ConfigFn as a duration.
|
||||
func WithDuration(n string, fn func(time.Duration)) func(e *EnvOptionsReader) {
|
||||
return func(e *EnvOptionsReader) {
|
||||
if v, ok := e.GetEnvValue(n); ok {
|
||||
if d, err := strconv.Atoi(v); err == nil {
|
||||
fn(time.Duration(d) * time.Millisecond)
|
||||
d, err := strconv.Atoi(v)
|
||||
if err != nil {
|
||||
global.Error(err, "parse duration", "input", v)
|
||||
return
|
||||
}
|
||||
fn(time.Duration(d) * time.Millisecond)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,26 +98,62 @@ func WithHeaders(n string, fn func(map[string]string)) func(e *EnvOptionsReader)
|
||||
func WithURL(n string, fn func(*url.URL)) func(e *EnvOptionsReader) {
|
||||
return func(e *EnvOptionsReader) {
|
||||
if v, ok := e.GetEnvValue(n); ok {
|
||||
if u, err := url.Parse(v); err == nil {
|
||||
fn(u)
|
||||
u, err := url.Parse(v)
|
||||
if err != nil {
|
||||
global.Error(err, "parse url", "input", v)
|
||||
return
|
||||
}
|
||||
fn(u)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithTLSConfig retrieves the specified config and passes it to ConfigFn as a crypto/tls.Config.
|
||||
func WithTLSConfig(n string, fn func(*tls.Config)) func(e *EnvOptionsReader) {
|
||||
// WithCertPool returns a ConfigFn that reads the environment variable n as a filepath to a TLS certificate pool. If it exists, it is parsed as a crypto/x509.CertPool and it is passed to fn.
|
||||
func WithCertPool(n string, fn func(*x509.CertPool)) ConfigFn {
|
||||
return func(e *EnvOptionsReader) {
|
||||
if v, ok := e.GetEnvValue(n); ok {
|
||||
if b, err := e.ReadFile(v); err == nil {
|
||||
if c, err := createTLSConfig(b); err == nil {
|
||||
fn(c)
|
||||
}
|
||||
b, err := e.ReadFile(v)
|
||||
if err != nil {
|
||||
global.Error(err, "read tls ca cert file", "file", v)
|
||||
return
|
||||
}
|
||||
c, err := createCertPool(b)
|
||||
if err != nil {
|
||||
global.Error(err, "create tls cert pool")
|
||||
return
|
||||
}
|
||||
fn(c)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithClientCert returns a ConfigFn that reads the environment variable nc and nk as filepaths to a client certificate and key pair. If they exists, they are parsed as a crypto/tls.Certificate and it is passed to fn.
|
||||
func WithClientCert(nc, nk string, fn func(tls.Certificate)) ConfigFn {
|
||||
return func(e *EnvOptionsReader) {
|
||||
vc, okc := e.GetEnvValue(nc)
|
||||
vk, okk := e.GetEnvValue(nk)
|
||||
if !okc || !okk {
|
||||
return
|
||||
}
|
||||
cert, err := e.ReadFile(vc)
|
||||
if err != nil {
|
||||
global.Error(err, "read tls client cert", "file", vc)
|
||||
return
|
||||
}
|
||||
key, err := e.ReadFile(vk)
|
||||
if err != nil {
|
||||
global.Error(err, "read tls client key", "file", vk)
|
||||
return
|
||||
}
|
||||
crt, err := tls.X509KeyPair(cert, key)
|
||||
if err != nil {
|
||||
global.Error(err, "create tls client key pair")
|
||||
return
|
||||
}
|
||||
fn(crt)
|
||||
}
|
||||
}
|
||||
|
||||
func keyWithNamespace(ns, key string) string {
|
||||
if ns == "" {
|
||||
return key
|
||||
@@ -117,15 +168,18 @@ func stringToHeader(value string) map[string]string {
|
||||
for _, header := range headersPairs {
|
||||
nameValue := strings.SplitN(header, "=", 2)
|
||||
if len(nameValue) < 2 {
|
||||
global.Error(errors.New("missing '="), "parse headers", "input", nameValue)
|
||||
continue
|
||||
}
|
||||
name, err := url.QueryUnescape(nameValue[0])
|
||||
if err != nil {
|
||||
global.Error(err, "escape header key", "key", nameValue[0])
|
||||
continue
|
||||
}
|
||||
trimmedName := strings.TrimSpace(name)
|
||||
value, err := url.QueryUnescape(nameValue[1])
|
||||
if err != nil {
|
||||
global.Error(err, "escape header value", "value", nameValue[1])
|
||||
continue
|
||||
}
|
||||
trimmedValue := strings.TrimSpace(value)
|
||||
@@ -136,13 +190,10 @@ func stringToHeader(value string) map[string]string {
|
||||
return headers
|
||||
}
|
||||
|
||||
func createTLSConfig(certBytes []byte) (*tls.Config, error) {
|
||||
func createCertPool(certBytes []byte) (*x509.CertPool, error) {
|
||||
cp := x509.NewCertPool()
|
||||
if ok := cp.AppendCertsFromPEM(certBytes); !ok {
|
||||
return nil, errors.New("failed to append certificate to the cert pool")
|
||||
}
|
||||
|
||||
return &tls.Config{
|
||||
RootCAs: cp,
|
||||
}, nil
|
||||
return cp, nil
|
||||
}
|
||||
|
||||
24
vendor/go.opentelemetry.io/otel/exporters/otlp/internal/header.go
generated
vendored
Normal file
24
vendor/go.opentelemetry.io/otel/exporters/otlp/internal/header.go
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright The OpenTelemetry Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package internal contains common functionality for all OTLP exporters.
|
||||
package internal // import "go.opentelemetry.io/otel/exporters/otlp/internal"
|
||||
|
||||
import "go.opentelemetry.io/otel"
|
||||
|
||||
// GetUserAgentHeader return an OTLP header value form "OTel OTLP Exporter Go/{{ .Version }}"
|
||||
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#user-agent
|
||||
func GetUserAgentHeader() string {
|
||||
return "OTel OTLP Exporter Go/" + otel.Version()
|
||||
}
|
||||
34
vendor/go.opentelemetry.io/otel/exporters/otlp/internal/partialsuccess.go
generated
vendored
34
vendor/go.opentelemetry.io/otel/exporters/otlp/internal/partialsuccess.go
generated
vendored
@@ -16,19 +16,6 @@ package internal // import "go.opentelemetry.io/otel/exporters/otlp/internal"
|
||||
|
||||
import "fmt"
|
||||
|
||||
// PartialSuccessDropKind indicates the kind of partial success error
|
||||
// received by an OTLP exporter, which corresponds with the signal
|
||||
// being exported.
|
||||
type PartialSuccessDropKind string
|
||||
|
||||
const (
|
||||
// TracingPartialSuccess indicates that some spans were rejected.
|
||||
TracingPartialSuccess PartialSuccessDropKind = "spans"
|
||||
|
||||
// MetricsPartialSuccess indicates that some metric data points were rejected.
|
||||
MetricsPartialSuccess PartialSuccessDropKind = "metric data points"
|
||||
)
|
||||
|
||||
// PartialSuccess represents the underlying error for all handling
|
||||
// OTLP partial success messages. Use `errors.Is(err,
|
||||
// PartialSuccess{})` to test whether an error passed to the OTel
|
||||
@@ -36,7 +23,7 @@ const (
|
||||
type PartialSuccess struct {
|
||||
ErrorMessage string
|
||||
RejectedItems int64
|
||||
RejectedKind PartialSuccessDropKind
|
||||
RejectedKind string
|
||||
}
|
||||
|
||||
var _ error = PartialSuccess{}
|
||||
@@ -56,13 +43,22 @@ func (ps PartialSuccess) Is(err error) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
// PartialSuccessToError produces an error suitable for passing to
|
||||
// `otel.Handle()` out of the fields in a partial success response,
|
||||
// independent of which signal produced the outcome.
|
||||
func PartialSuccessToError(kind PartialSuccessDropKind, itemsRejected int64, errorMessage string) error {
|
||||
// TracePartialSuccessError returns an error describing a partial success
|
||||
// response for the trace signal.
|
||||
func TracePartialSuccessError(itemsRejected int64, errorMessage string) error {
|
||||
return PartialSuccess{
|
||||
ErrorMessage: errorMessage,
|
||||
RejectedItems: itemsRejected,
|
||||
RejectedKind: kind,
|
||||
RejectedKind: "spans",
|
||||
}
|
||||
}
|
||||
|
||||
// MetricPartialSuccessError returns an error describing a partial success
|
||||
// response for the metric signal.
|
||||
func MetricPartialSuccessError(itemsRejected int64, errorMessage string) error {
|
||||
return PartialSuccess{
|
||||
ErrorMessage: errorMessage,
|
||||
RejectedItems: itemsRejected,
|
||||
RejectedKind: "metric data points",
|
||||
}
|
||||
}
|
||||
|
||||
4
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md
generated
vendored
4
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md
generated
vendored
@@ -12,8 +12,8 @@ go get -u go.opentelemetry.io/otel/exporters/otlp/otlptrace
|
||||
|
||||
## Examples
|
||||
|
||||
- [Exporter setup and examples](./otlptracehttp/example_test.go)
|
||||
- [Full example sending telemetry to a local collector](../../../example/otel-collector)
|
||||
- [HTTP Exporter setup and examples](./otlptracehttp/example_test.go)
|
||||
- [Full example of gRPC Exporter sending telemetry to a local collector](../../../example/otel-collector)
|
||||
|
||||
## [`otlptrace`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace)
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
@@ -53,6 +54,7 @@ func ApplyHTTPEnvConfigs(cfg Config) Config {
|
||||
func getOptionsFromEnv() []GenericOption {
|
||||
opts := []GenericOption{}
|
||||
|
||||
tlsConf := &tls.Config{}
|
||||
DefaultEnvOptionsReader.Apply(
|
||||
envconfig.WithURL("ENDPOINT", func(u *url.URL) {
|
||||
opts = append(opts, withEndpointScheme(u))
|
||||
@@ -81,8 +83,13 @@ func getOptionsFromEnv() []GenericOption {
|
||||
return cfg
|
||||
}, withEndpointForGRPC(u)))
|
||||
}),
|
||||
envconfig.WithTLSConfig("CERTIFICATE", func(c *tls.Config) { opts = append(opts, WithTLSClientConfig(c)) }),
|
||||
envconfig.WithTLSConfig("TRACES_CERTIFICATE", func(c *tls.Config) { opts = append(opts, WithTLSClientConfig(c)) }),
|
||||
envconfig.WithCertPool("CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }),
|
||||
envconfig.WithCertPool("TRACES_CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }),
|
||||
envconfig.WithClientCert("CLIENT_CERTIFICATE", "CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }),
|
||||
envconfig.WithClientCert("TRACES_CLIENT_CERTIFICATE", "TRACES_CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }),
|
||||
withTLSConfig(tlsConf, func(c *tls.Config) { opts = append(opts, WithTLSClientConfig(c)) }),
|
||||
envconfig.WithBool("INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }),
|
||||
envconfig.WithBool("TRACES_INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }),
|
||||
envconfig.WithHeaders("HEADERS", func(h map[string]string) { opts = append(opts, WithHeaders(h)) }),
|
||||
envconfig.WithHeaders("TRACES_HEADERS", func(h map[string]string) { opts = append(opts, WithHeaders(h)) }),
|
||||
WithEnvCompression("COMPRESSION", func(c Compression) { opts = append(opts, WithCompression(c)) }),
|
||||
@@ -125,3 +132,19 @@ func WithEnvCompression(n string, fn func(Compression)) func(e *envconfig.EnvOpt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// revive:disable-next-line:flag-parameter
|
||||
func withInsecure(b bool) GenericOption {
|
||||
if b {
|
||||
return WithInsecure()
|
||||
}
|
||||
return WithSecure()
|
||||
}
|
||||
|
||||
func withTLSConfig(c *tls.Config, fn func(*tls.Config)) func(e *envconfig.EnvOptionsReader) {
|
||||
return func(e *envconfig.EnvOptionsReader) {
|
||||
if c.RootCAs != nil || len(c.Certificates) > 0 {
|
||||
fn(c)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +97,7 @@ func NewGRPCConfig(opts ...GRPCOption) Config {
|
||||
Timeout: DefaultTimeout,
|
||||
},
|
||||
RetryConfig: retry.DefaultConfig,
|
||||
DialOptions: []grpc.DialOption{grpc.WithUserAgent(internal.GetUserAgentHeader())},
|
||||
}
|
||||
cfg = ApplyGRPCEnvConfigs(cfg)
|
||||
for _, opt := range opts {
|
||||
|
||||
11
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go
generated
vendored
11
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go
generated
vendored
@@ -202,11 +202,12 @@ func (c *client) UploadTraces(ctx context.Context, protoSpans []*tracepb.Resourc
|
||||
ResourceSpans: protoSpans,
|
||||
})
|
||||
if resp != nil && resp.PartialSuccess != nil {
|
||||
otel.Handle(internal.PartialSuccessToError(
|
||||
internal.TracingPartialSuccess,
|
||||
resp.PartialSuccess.RejectedSpans,
|
||||
resp.PartialSuccess.ErrorMessage,
|
||||
))
|
||||
msg := resp.PartialSuccess.GetErrorMessage()
|
||||
n := resp.PartialSuccess.GetRejectedSpans()
|
||||
if n != 0 || msg != "" {
|
||||
err := internal.TracePartialSuccessError(n, msg)
|
||||
otel.Handle(err)
|
||||
}
|
||||
}
|
||||
// nil is converted to OK.
|
||||
if status.Code(err) == codes.OK {
|
||||
|
||||
45
vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
generated
vendored
Normal file
45
vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright The OpenTelemetry Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*
|
||||
Package attribute provide several helper functions for some commonly used
|
||||
logic of processing attributes.
|
||||
*/
|
||||
package attribute // import "go.opentelemetry.io/otel/internal/attribute"
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// SliceValue convert a slice into an array with same elements as slice.
|
||||
func SliceValue[T bool | int64 | float64 | string](v []T) any {
|
||||
var zero T
|
||||
cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero)))
|
||||
copy(cp.Elem().Slice(0, len(v)).Interface().([]T), v)
|
||||
return cp.Elem().Interface()
|
||||
}
|
||||
|
||||
// AsSlice convert an array into a slice into with same elements as array.
|
||||
func AsSlice[T bool | int64 | float64 | string](v any) []T {
|
||||
rv := reflect.ValueOf(v)
|
||||
if rv.Type().Kind() != reflect.Array {
|
||||
return nil
|
||||
}
|
||||
var zero T
|
||||
correctLen := rv.Len()
|
||||
correctType := reflect.ArrayOf(correctLen, reflect.TypeOf(zero))
|
||||
cpy := reflect.New(correctType)
|
||||
_ = reflect.Copy(cpy.Elem(), rv)
|
||||
return cpy.Elem().Slice(0, correctLen).Interface().([]T)
|
||||
}
|
||||
16
vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64/asyncfloat64.go
generated
vendored
16
vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64/asyncfloat64.go
generated
vendored
@@ -22,6 +22,8 @@ import (
|
||||
)
|
||||
|
||||
// InstrumentProvider provides access to individual instruments.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type InstrumentProvider interface {
|
||||
// Counter creates an instrument for recording increasing values.
|
||||
Counter(name string, opts ...instrument.Option) (Counter, error)
|
||||
@@ -34,8 +36,11 @@ type InstrumentProvider interface {
|
||||
}
|
||||
|
||||
// Counter is an instrument that records increasing values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Counter interface {
|
||||
// Observe records the state of the instrument.
|
||||
// Observe records the state of the instrument to be x. Implementations
|
||||
// will assume x to be the cumulative sum of the count.
|
||||
//
|
||||
// It is only valid to call this within a callback. If called outside of the
|
||||
// registered callback it should have no effect on the instrument, and an
|
||||
@@ -46,8 +51,11 @@ type Counter interface {
|
||||
}
|
||||
|
||||
// UpDownCounter is an instrument that records increasing or decreasing values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type UpDownCounter interface {
|
||||
// Observe records the state of the instrument.
|
||||
// Observe records the state of the instrument to be x. Implementations
|
||||
// will assume x to be the cumulative sum of the count.
|
||||
//
|
||||
// It is only valid to call this within a callback. If called outside of the
|
||||
// registered callback it should have no effect on the instrument, and an
|
||||
@@ -58,8 +66,10 @@ type UpDownCounter interface {
|
||||
}
|
||||
|
||||
// Gauge is an instrument that records independent readings.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Gauge interface {
|
||||
// Observe records the state of the instrument.
|
||||
// Observe records the state of the instrument to be x.
|
||||
//
|
||||
// It is only valid to call this within a callback. If called outside of the
|
||||
// registered callback it should have no effect on the instrument, and an
|
||||
|
||||
16
vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64/asyncint64.go
generated
vendored
16
vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64/asyncint64.go
generated
vendored
@@ -22,6 +22,8 @@ import (
|
||||
)
|
||||
|
||||
// InstrumentProvider provides access to individual instruments.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type InstrumentProvider interface {
|
||||
// Counter creates an instrument for recording increasing values.
|
||||
Counter(name string, opts ...instrument.Option) (Counter, error)
|
||||
@@ -34,8 +36,11 @@ type InstrumentProvider interface {
|
||||
}
|
||||
|
||||
// Counter is an instrument that records increasing values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Counter interface {
|
||||
// Observe records the state of the instrument.
|
||||
// Observe records the state of the instrument to be x. Implementations
|
||||
// will assume x to be the cumulative sum of the count.
|
||||
//
|
||||
// It is only valid to call this within a callback. If called outside of the
|
||||
// registered callback it should have no effect on the instrument, and an
|
||||
@@ -46,8 +51,11 @@ type Counter interface {
|
||||
}
|
||||
|
||||
// UpDownCounter is an instrument that records increasing or decreasing values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type UpDownCounter interface {
|
||||
// Observe records the state of the instrument.
|
||||
// Observe records the state of the instrument to be x. Implementations
|
||||
// will assume x to be the cumulative sum of the count.
|
||||
//
|
||||
// It is only valid to call this within a callback. If called outside of the
|
||||
// registered callback it should have no effect on the instrument, and an
|
||||
@@ -58,8 +66,10 @@ type UpDownCounter interface {
|
||||
}
|
||||
|
||||
// Gauge is an instrument that records independent readings.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Gauge interface {
|
||||
// Observe records the state of the instrument.
|
||||
// Observe records the state of the instrument to be x.
|
||||
//
|
||||
// It is only valid to call this within a callback. If called outside of the
|
||||
// registered callback it should have no effect on the instrument, and an
|
||||
|
||||
8
vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64/syncfloat64.go
generated
vendored
8
vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64/syncfloat64.go
generated
vendored
@@ -22,6 +22,8 @@ import (
|
||||
)
|
||||
|
||||
// InstrumentProvider provides access to individual instruments.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type InstrumentProvider interface {
|
||||
// Counter creates an instrument for recording increasing values.
|
||||
Counter(name string, opts ...instrument.Option) (Counter, error)
|
||||
@@ -32,6 +34,8 @@ type InstrumentProvider interface {
|
||||
}
|
||||
|
||||
// Counter is an instrument that records increasing values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Counter interface {
|
||||
// Add records a change to the counter.
|
||||
Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
|
||||
@@ -40,6 +44,8 @@ type Counter interface {
|
||||
}
|
||||
|
||||
// UpDownCounter is an instrument that records increasing or decreasing values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type UpDownCounter interface {
|
||||
// Add records a change to the counter.
|
||||
Add(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
|
||||
@@ -48,6 +54,8 @@ type UpDownCounter interface {
|
||||
}
|
||||
|
||||
// Histogram is an instrument that records a distribution of values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Histogram interface {
|
||||
// Record adds an additional value to the distribution.
|
||||
Record(ctx context.Context, incr float64, attrs ...attribute.KeyValue)
|
||||
|
||||
8
vendor/go.opentelemetry.io/otel/metric/instrument/syncint64/syncint64.go
generated
vendored
8
vendor/go.opentelemetry.io/otel/metric/instrument/syncint64/syncint64.go
generated
vendored
@@ -22,6 +22,8 @@ import (
|
||||
)
|
||||
|
||||
// InstrumentProvider provides access to individual instruments.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type InstrumentProvider interface {
|
||||
// Counter creates an instrument for recording increasing values.
|
||||
Counter(name string, opts ...instrument.Option) (Counter, error)
|
||||
@@ -32,6 +34,8 @@ type InstrumentProvider interface {
|
||||
}
|
||||
|
||||
// Counter is an instrument that records increasing values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Counter interface {
|
||||
// Add records a change to the counter.
|
||||
Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
|
||||
@@ -40,6 +44,8 @@ type Counter interface {
|
||||
}
|
||||
|
||||
// UpDownCounter is an instrument that records increasing or decreasing values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type UpDownCounter interface {
|
||||
// Add records a change to the counter.
|
||||
Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
|
||||
@@ -48,6 +54,8 @@ type UpDownCounter interface {
|
||||
}
|
||||
|
||||
// Histogram is an instrument that records a distribution of values.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Histogram interface {
|
||||
// Record adds an additional value to the distribution.
|
||||
Record(ctx context.Context, incr int64, attrs ...attribute.KeyValue)
|
||||
|
||||
2
vendor/go.opentelemetry.io/otel/metric/internal/global/instruments.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/metric/internal/global/instruments.go
generated
vendored
@@ -214,7 +214,7 @@ func (i *aiGauge) unwrap() instrument.Asynchronous {
|
||||
return nil
|
||||
}
|
||||
|
||||
//Sync Instruments.
|
||||
// Sync Instruments.
|
||||
type sfCounter struct {
|
||||
name string
|
||||
opts []instrument.Option
|
||||
|
||||
4
vendor/go.opentelemetry.io/otel/metric/meter.go
generated
vendored
4
vendor/go.opentelemetry.io/otel/metric/meter.go
generated
vendored
@@ -26,6 +26,8 @@ import (
|
||||
|
||||
// MeterProvider provides access to named Meter instances, for instrumenting
|
||||
// an application or library.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type MeterProvider interface {
|
||||
// Meter creates an instance of a `Meter` interface. The instrumentationName
|
||||
// must be the name of the library providing instrumentation. This name may
|
||||
@@ -36,6 +38,8 @@ type MeterProvider interface {
|
||||
}
|
||||
|
||||
// Meter provides access to instrument instances for recording metrics.
|
||||
//
|
||||
// Warning: methods may be added to this interface in minor releases.
|
||||
type Meter interface {
|
||||
// AsyncInt64 is the namespace for the Asynchronous Integer instruments.
|
||||
//
|
||||
|
||||
11
vendor/go.opentelemetry.io/otel/sdk/resource/env.go
generated
vendored
11
vendor/go.opentelemetry.io/otel/sdk/resource/env.go
generated
vendored
@@ -17,9 +17,11 @@ package resource // import "go.opentelemetry.io/otel/sdk/resource"
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
|
||||
)
|
||||
@@ -88,7 +90,14 @@ func constructOTResources(s string) (*Resource, error) {
|
||||
invalid = append(invalid, p)
|
||||
continue
|
||||
}
|
||||
k, v := strings.TrimSpace(field[0]), strings.TrimSpace(field[1])
|
||||
k := strings.TrimSpace(field[0])
|
||||
v, err := url.QueryUnescape(strings.TrimSpace(field[1]))
|
||||
if err != nil {
|
||||
// Retain original value if decoding fails, otherwise it will be
|
||||
// an empty string.
|
||||
v = field[1]
|
||||
otel.Handle(err)
|
||||
}
|
||||
attrs = append(attrs, attribute.String(k, v))
|
||||
}
|
||||
var err error
|
||||
|
||||
41
vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
generated
vendored
41
vendor/go.opentelemetry.io/otel/sdk/trace/provider.go
generated
vendored
@@ -116,12 +116,13 @@ func NewTracerProvider(opts ...TracerProviderOption) *TracerProvider {
|
||||
spanLimits: o.spanLimits,
|
||||
resource: o.resource,
|
||||
}
|
||||
|
||||
global.Info("TracerProvider created", "config", o)
|
||||
|
||||
spss := spanProcessorStates{}
|
||||
for _, sp := range o.processors {
|
||||
tp.RegisterSpanProcessor(sp)
|
||||
spss = append(spss, newSpanProcessorState(sp))
|
||||
}
|
||||
tp.spanProcessors.Store(spss)
|
||||
|
||||
return tp
|
||||
}
|
||||
@@ -159,44 +160,38 @@ func (p *TracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.T
|
||||
}
|
||||
|
||||
// RegisterSpanProcessor adds the given SpanProcessor to the list of SpanProcessors.
|
||||
func (p *TracerProvider) RegisterSpanProcessor(s SpanProcessor) {
|
||||
func (p *TracerProvider) RegisterSpanProcessor(sp SpanProcessor) {
|
||||
p.mu.Lock()
|
||||
defer p.mu.Unlock()
|
||||
newSPS := spanProcessorStates{}
|
||||
if old, ok := p.spanProcessors.Load().(spanProcessorStates); ok {
|
||||
newSPS = append(newSPS, old...)
|
||||
}
|
||||
newSpanSync := &spanProcessorState{
|
||||
sp: s,
|
||||
state: &sync.Once{},
|
||||
}
|
||||
newSPS = append(newSPS, newSpanSync)
|
||||
newSPS = append(newSPS, p.spanProcessors.Load().(spanProcessorStates)...)
|
||||
newSPS = append(newSPS, newSpanProcessorState(sp))
|
||||
p.spanProcessors.Store(newSPS)
|
||||
}
|
||||
|
||||
// UnregisterSpanProcessor removes the given SpanProcessor from the list of SpanProcessors.
|
||||
func (p *TracerProvider) UnregisterSpanProcessor(s SpanProcessor) {
|
||||
func (p *TracerProvider) UnregisterSpanProcessor(sp SpanProcessor) {
|
||||
p.mu.Lock()
|
||||
defer p.mu.Unlock()
|
||||
spss := spanProcessorStates{}
|
||||
old, ok := p.spanProcessors.Load().(spanProcessorStates)
|
||||
if !ok || len(old) == 0 {
|
||||
old := p.spanProcessors.Load().(spanProcessorStates)
|
||||
if len(old) == 0 {
|
||||
return
|
||||
}
|
||||
spss := spanProcessorStates{}
|
||||
spss = append(spss, old...)
|
||||
|
||||
// stop the span processor if it is started and remove it from the list
|
||||
var stopOnce *spanProcessorState
|
||||
var idx int
|
||||
for i, sps := range spss {
|
||||
if sps.sp == s {
|
||||
if sps.sp == sp {
|
||||
stopOnce = sps
|
||||
idx = i
|
||||
}
|
||||
}
|
||||
if stopOnce != nil {
|
||||
stopOnce.state.Do(func() {
|
||||
if err := s.Shutdown(context.Background()); err != nil {
|
||||
if err := sp.Shutdown(context.Background()); err != nil {
|
||||
otel.Handle(err)
|
||||
}
|
||||
})
|
||||
@@ -213,10 +208,7 @@ func (p *TracerProvider) UnregisterSpanProcessor(s SpanProcessor) {
|
||||
// ForceFlush immediately exports all spans that have not yet been exported for
|
||||
// all the registered span processors.
|
||||
func (p *TracerProvider) ForceFlush(ctx context.Context) error {
|
||||
spss, ok := p.spanProcessors.Load().(spanProcessorStates)
|
||||
if !ok {
|
||||
return fmt.Errorf("failed to load span processors")
|
||||
}
|
||||
spss := p.spanProcessors.Load().(spanProcessorStates)
|
||||
if len(spss) == 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -237,10 +229,11 @@ func (p *TracerProvider) ForceFlush(ctx context.Context) error {
|
||||
|
||||
// Shutdown shuts down the span processors in the order they were registered.
|
||||
func (p *TracerProvider) Shutdown(ctx context.Context) error {
|
||||
spss, ok := p.spanProcessors.Load().(spanProcessorStates)
|
||||
if !ok {
|
||||
return fmt.Errorf("failed to load span processors")
|
||||
spss := p.spanProcessors.Load().(spanProcessorStates)
|
||||
if len(spss) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
var retErr error
|
||||
for _, sps := range spss {
|
||||
select {
|
||||
|
||||
39
vendor/go.opentelemetry.io/otel/sdk/trace/span.go
generated
vendored
39
vendor/go.opentelemetry.io/otel/sdk/trace/span.go
generated
vendored
@@ -189,15 +189,18 @@ func (s *recordingSpan) SetStatus(code codes.Code, description string) {
|
||||
if !s.IsRecording() {
|
||||
return
|
||||
}
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if s.status.Code > code {
|
||||
return
|
||||
}
|
||||
|
||||
status := Status{Code: code}
|
||||
if code == codes.Error {
|
||||
status.Description = description
|
||||
}
|
||||
|
||||
s.mu.Lock()
|
||||
s.status = status
|
||||
s.mu.Unlock()
|
||||
}
|
||||
|
||||
// SetAttributes sets attributes of this span.
|
||||
@@ -310,26 +313,13 @@ func truncateAttr(limit int, attr attribute.KeyValue) attribute.KeyValue {
|
||||
return attr.Key.String(safeTruncate(v, limit))
|
||||
}
|
||||
case attribute.STRINGSLICE:
|
||||
// Do no mutate the original, make a copy.
|
||||
trucated := attr.Key.StringSlice(attr.Value.AsStringSlice())
|
||||
// Do not do this.
|
||||
//
|
||||
// v := trucated.Value.AsStringSlice()
|
||||
// cp := make([]string, len(v))
|
||||
// /* Copy and truncate values to cp ... */
|
||||
// trucated.Value = attribute.StringSliceValue(cp)
|
||||
//
|
||||
// Copying the []string and then assigning it back as a new value with
|
||||
// attribute.StringSliceValue will copy the data twice. Instead, we
|
||||
// already made a copy above that only this function owns, update the
|
||||
// underlying slice data of our copy.
|
||||
v := trucated.Value.AsStringSlice()
|
||||
v := attr.Value.AsStringSlice()
|
||||
for i := range v {
|
||||
if len(v[i]) > limit {
|
||||
v[i] = safeTruncate(v[i], limit)
|
||||
}
|
||||
}
|
||||
return trucated
|
||||
return attr.Key.StringSlice(v)
|
||||
}
|
||||
return attr
|
||||
}
|
||||
@@ -420,14 +410,13 @@ func (s *recordingSpan) End(options ...trace.SpanEndOption) {
|
||||
}
|
||||
s.mu.Unlock()
|
||||
|
||||
if sps, ok := s.tracer.provider.spanProcessors.Load().(spanProcessorStates); ok {
|
||||
if len(sps) == 0 {
|
||||
return
|
||||
}
|
||||
snap := s.snapshot()
|
||||
for _, sp := range sps {
|
||||
sp.sp.OnEnd(snap)
|
||||
}
|
||||
sps := s.tracer.provider.spanProcessors.Load().(spanProcessorStates)
|
||||
if len(sps) == 0 {
|
||||
return
|
||||
}
|
||||
snap := s.snapshot()
|
||||
for _, sp := range sps {
|
||||
sp.sp.OnEnd(snap)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
5
vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go
generated
vendored
5
vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go
generated
vendored
@@ -64,4 +64,9 @@ type spanProcessorState struct {
|
||||
sp SpanProcessor
|
||||
state *sync.Once
|
||||
}
|
||||
|
||||
func newSpanProcessorState(sp SpanProcessor) *spanProcessorState {
|
||||
return &spanProcessorState{sp: sp, state: &sync.Once{}}
|
||||
}
|
||||
|
||||
type spanProcessorStates []*spanProcessorState
|
||||
|
||||
2
vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go
generated
vendored
@@ -51,7 +51,7 @@ func (tr *tracer) Start(ctx context.Context, name string, options ...trace.SpanS
|
||||
|
||||
s := tr.newSpan(ctx, name, &config)
|
||||
if rw, ok := s.(ReadWriteSpan); ok && s.IsRecording() {
|
||||
sps, _ := tr.provider.spanProcessors.Load().(spanProcessorStates)
|
||||
sps := tr.provider.spanProcessors.Load().(spanProcessorStates)
|
||||
for _, sp := range sps {
|
||||
sp.sp.OnStart(ctx, rw)
|
||||
}
|
||||
|
||||
2
vendor/go.opentelemetry.io/otel/trace/doc.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/trace/doc.go
generated
vendored
@@ -17,7 +17,7 @@ Package trace provides an implementation of the tracing part of the
|
||||
OpenTelemetry API.
|
||||
|
||||
To participate in distributed traces a Span needs to be created for the
|
||||
operation being performed as part of a traced workflow. It its simplest form:
|
||||
operation being performed as part of a traced workflow. In its simplest form:
|
||||
|
||||
var tracer trace.Tracer
|
||||
|
||||
|
||||
5
vendor/go.opentelemetry.io/otel/trace/trace.go
generated
vendored
5
vendor/go.opentelemetry.io/otel/trace/trace.go
generated
vendored
@@ -364,8 +364,9 @@ type Span interface {
|
||||
SpanContext() SpanContext
|
||||
|
||||
// SetStatus sets the status of the Span in the form of a code and a
|
||||
// description, overriding previous values set. The description is only
|
||||
// included in a status when the code is for an error.
|
||||
// description, provided the status hasn't already been set to a higher
|
||||
// value before (OK > Error > Unset). The description is only included in a
|
||||
// status when the code is for an error.
|
||||
SetStatus(code codes.Code, description string)
|
||||
|
||||
// SetName sets the Span name.
|
||||
|
||||
2
vendor/go.opentelemetry.io/otel/version.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/version.go
generated
vendored
@@ -16,5 +16,5 @@ package otel // import "go.opentelemetry.io/otel"
|
||||
|
||||
// Version is the current release version of OpenTelemetry in use.
|
||||
func Version() string {
|
||||
return "1.10.0"
|
||||
return "1.11.2"
|
||||
}
|
||||
|
||||
14
vendor/go.opentelemetry.io/otel/versions.yaml
generated
vendored
14
vendor/go.opentelemetry.io/otel/versions.yaml
generated
vendored
@@ -14,7 +14,7 @@
|
||||
|
||||
module-sets:
|
||||
stable-v1:
|
||||
version: v1.10.0
|
||||
version: v1.11.2
|
||||
modules:
|
||||
- go.opentelemetry.io/otel
|
||||
- go.opentelemetry.io/otel/bridge/opentracing
|
||||
@@ -34,8 +34,9 @@ module-sets:
|
||||
- go.opentelemetry.io/otel/trace
|
||||
- go.opentelemetry.io/otel/sdk
|
||||
experimental-metrics:
|
||||
version: v0.31.0
|
||||
version: v0.34.0
|
||||
modules:
|
||||
- go.opentelemetry.io/otel/example/opencensus
|
||||
- go.opentelemetry.io/otel/example/prometheus
|
||||
- go.opentelemetry.io/otel/exporters/otlp/otlpmetric
|
||||
- go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
|
||||
@@ -44,15 +45,12 @@ module-sets:
|
||||
- go.opentelemetry.io/otel/exporters/stdout/stdoutmetric
|
||||
- go.opentelemetry.io/otel/metric
|
||||
- go.opentelemetry.io/otel/sdk/metric
|
||||
- go.opentelemetry.io/otel/bridge/opencensus
|
||||
- go.opentelemetry.io/otel/bridge/opencensus/test
|
||||
- go.opentelemetry.io/otel/example/view
|
||||
experimental-schema:
|
||||
version: v0.0.3
|
||||
modules:
|
||||
- go.opentelemetry.io/otel/schema
|
||||
bridge:
|
||||
version: v0.31.0
|
||||
modules:
|
||||
- go.opentelemetry.io/otel/bridge/opencensus
|
||||
- go.opentelemetry.io/otel/bridge/opencensus/test
|
||||
- go.opentelemetry.io/otel/example/opencensus
|
||||
excluded-modules:
|
||||
- go.opentelemetry.io/otel/internal/tools
|
||||
|
||||
Reference in New Issue
Block a user