diff --git a/ci/resources/stemcell-version-bump/go.mod b/ci/resources/stemcell-version-bump/go.mod index 46e740c31..0b35bf432 100644 --- a/ci/resources/stemcell-version-bump/go.mod +++ b/ci/resources/stemcell-version-bump/go.mod @@ -39,11 +39,11 @@ require ( go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect - go.opentelemetry.io/otel v1.42.0 // indirect - go.opentelemetry.io/otel/metric v1.42.0 // indirect - go.opentelemetry.io/otel/sdk v1.42.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.42.0 // indirect - go.opentelemetry.io/otel/trace v1.42.0 // indirect + go.opentelemetry.io/otel v1.43.0 // indirect + go.opentelemetry.io/otel/metric v1.43.0 // indirect + go.opentelemetry.io/otel/sdk v1.43.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.43.0 // indirect + go.opentelemetry.io/otel/trace v1.43.0 // indirect golang.org/x/crypto v0.49.0 // indirect golang.org/x/net v0.52.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect diff --git a/ci/resources/stemcell-version-bump/go.sum b/ci/resources/stemcell-version-bump/go.sum index 389d403ee..73ef45603 100644 --- a/ci/resources/stemcell-version-bump/go.sum +++ b/ci/resources/stemcell-version-bump/go.sum @@ -87,18 +87,18 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q= -go.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho= -go.opentelemetry.io/otel v1.42.0/go.mod h1:lJNsdRMxCUIWuMlVJWzecSMuNjE7dOYyWlqOXWkdqCc= +go.opentelemetry.io/otel v1.43.0 h1:mYIM03dnh5zfN7HautFE4ieIig9amkNANT+xcVxAj9I= +go.opentelemetry.io/otel v1.43.0/go.mod h1:JuG+u74mvjvcm8vj8pI5XiHy1zDeoCS2LB1spIq7Ay0= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.42.0 h1:lSZHgNHfbmQTPfuTmWVkEu8J8qXaQwuV30pjCcAUvP8= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.42.0/go.mod h1:so9ounLcuoRDu033MW/E0AD4hhUjVqswrMF5FoZlBcw= -go.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4= -go.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI= -go.opentelemetry.io/otel/sdk v1.42.0 h1:LyC8+jqk6UJwdrI/8VydAq/hvkFKNHZVIWuslJXYsDo= -go.opentelemetry.io/otel/sdk v1.42.0/go.mod h1:rGHCAxd9DAph0joO4W6OPwxjNTYWghRWmkHuGbayMts= -go.opentelemetry.io/otel/sdk/metric v1.42.0 h1:D/1QR46Clz6ajyZ3G8SgNlTJKBdGp84q9RKCAZ3YGuA= -go.opentelemetry.io/otel/sdk/metric v1.42.0/go.mod h1:Ua6AAlDKdZ7tdvaQKfSmnFTdHx37+J4ba8MwVCYM5hc= -go.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY= -go.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc= +go.opentelemetry.io/otel/metric v1.43.0 h1:d7638QeInOnuwOONPp4JAOGfbCEpYb+K6DVWvdxGzgM= +go.opentelemetry.io/otel/metric v1.43.0/go.mod h1:RDnPtIxvqlgO8GRW18W6Z/4P462ldprJtfxHxyKd2PY= +go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg= +go.opentelemetry.io/otel/sdk v1.43.0/go.mod h1:P+IkVU3iWukmiit/Yf9AWvpyRDlUeBaRg6Y+C58QHzg= +go.opentelemetry.io/otel/sdk/metric v1.43.0 h1:S88dyqXjJkuBNLeMcVPRFXpRw2fuwdvfCGLEo89fDkw= +go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHStzb9zFlIEe85bhj6A= +go.opentelemetry.io/otel/trace v1.43.0 h1:BkNrHpup+4k4w+ZZ86CZoHHEkohws8AY+WTX09nk+3A= +go.opentelemetry.io/otel/trace v1.43.0/go.mod h1:/QJhyVBUUswCphDVxq+8mld+AvhXZLhe+8WVFxiFff0= golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/.golangci.yml b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/.golangci.yml index d12c8920a..db1f55101 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/.golangci.yml +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/.golangci.yml @@ -17,6 +17,7 @@ linters: - ineffassign - misspell - modernize + - noctx - perfsprint - revive - staticcheck @@ -88,6 +89,16 @@ linters: deny: - pkg: go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal desc: Do not use cross-module internal packages. + semconv: + list-mode: lax + files: + - "!**/semconv/**" + - "!**/exporters/zipkin/**" + deny: + - pkg: go.opentelemetry.io/otel/semconv + desc: "Use go.opentelemetry.io/otel/semconv/v1.40.0 instead. If a newer semconv version has been released, update the depguard rule." + allow: + - go.opentelemetry.io/otel/semconv/v1.40.0 gocritic: disabled-checks: - appendAssign diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/CHANGELOG.md index ab7263014..20edda441 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/CHANGELOG.md +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/CHANGELOG.md @@ -11,6 +11,49 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm +## [1.43.0/0.65.0/0.19.0] 2026-04-02 + +### Added + +- Add `IsRandom` and `WithRandom` on `TraceFlags`, and `IsRandom` on `SpanContext` in `go.opentelemetry.io/otel/trace` for [W3C Trace Context Level 2 Random Trace ID Flag](https://www.w3.org/TR/trace-context-2/#random-trace-id-flag) support. (#8012) +- Add service detection with `WithService` in `go.opentelemetry.io/otel/sdk/resource`. (#7642) +- Add `DefaultWithContext` and `EnvironmentWithContext` in `go.opentelemetry.io/otel/sdk/resource` to support plumbing `context.Context` through default and environment detectors. (#8051) +- Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`. (#8038) +- Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`. (#8038) +- Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. (#8038) +- Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#8038) +- Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#8038) +- Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#8038) +- Support attributes with empty value (`attribute.EMPTY`) in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest`. (#8038) +- Add support for per-series start time tracking for cumulative metrics in `go.opentelemetry.io/otel/sdk/metric`. + Set `OTEL_GO_X_PER_SERIES_START_TIMESTAMPS=true` to enable. (#8060) +- Add `WithCardinalityLimitSelector` for metric reader for configuring cardinality limits specific to the instrument kind. (#7855) + +### Changed + +- Introduce the `EMPTY` Type in `go.opentelemetry.io/otel/attribute` to reflect that an empty value is now a valid value, with `INVALID` remaining as a deprecated alias of `EMPTY`. (#8038) +- Improve slice handling in `go.opentelemetry.io/otel/attribute` to optimize short slice values with fixed-size fast paths. (#8039) +- Improve performance of span metric recording in `go.opentelemetry.io/otel/sdk/trace` by returning early if self-observability is not enabled. (#8067) +- Improve formatting of metric data diffs in `go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest`. (#8073) + +### Deprecated + +- Deprecate `INVALID` in `go.opentelemetry.io/otel/attribute`. Use `EMPTY` instead. (#8038) + +### Fixed + +- Return spec-compliant `TraceIdRatioBased` description. This is a breaking behavioral change, but it is necessary to + make the implementation [spec-compliant](https://opentelemetry.io/docs/specs/otel/trace/sdk/#traceidratiobased). (#8027) +- Fix a race condition in `go.opentelemetry.io/otel/sdk/metric` where the lastvalue aggregation could collect the value 0 even when no zero-value measurements were recorded. (#8056) +- Limit HTTP response body to 4 MiB in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` to mitigate excessive memory usage caused by a misconfigured or malicious server. + Responses exceeding the limit are treated as non-retryable errors. (#8108) +- Limit HTTP response body to 4 MiB in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` to mitigate excessive memory usage caused by a misconfigured or malicious server. + Responses exceeding the limit are treated as non-retryable errors. (#8108) +- Limit HTTP response body to 4 MiB in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` to mitigate excessive memory usage caused by a misconfigured or malicious server. + Responses exceeding the limit are treated as non-retryable errors. (#8108) +- `WithHostID` detector in `go.opentelemetry.io/otel/sdk/resource` to use full path for `kenv` command on BSD. (#8113) +- Fix missing `request.GetBody` in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` to correctly handle HTTP2 GOAWAY frame. (#8096) + ## [1.42.0/0.64.0/0.18.0/0.0.16] 2026-03-06 ### Added @@ -3576,7 +3619,8 @@ 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.42.0...HEAD +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.43.0...HEAD +[1.43.0/0.65.0/0.19.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.43.0 [1.42.0/0.64.0/0.18.0/0.0.16]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.42.0 [1.41.0/0.63.0/0.17.0/0.0.15]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.41.0 [1.40.0/0.62.0/0.16.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.40.0 diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/Makefile b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/Makefile index 9f6e6b511..42466f2d6 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/Makefile +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/Makefile @@ -38,10 +38,14 @@ CROSSLINK = $(TOOLS)/crosslink $(TOOLS)/crosslink: PACKAGE=go.opentelemetry.io/build-tools/crosslink SEMCONVKIT = $(TOOLS)/semconvkit +SEMCONVKIT_FILES := $(sort $(shell find $(TOOLS_MOD_DIR)/semconvkit -type f)) $(TOOLS)/semconvkit: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/semconvkit +$(TOOLS)/semconvkit: $(SEMCONVKIT_FILES) VERIFYREADMES = $(TOOLS)/verifyreadmes +VERIFYREADMES_FILES := $(sort $(shell find $(TOOLS_MOD_DIR)/verifyreadmes -type f)) $(TOOLS)/verifyreadmes: PACKAGE=go.opentelemetry.io/otel/$(TOOLS_MOD_DIR)/verifyreadmes +$(TOOLS)/verifyreadmes: $(VERIFYREADMES_FILES) GOLANGCI_LINT = $(TOOLS)/golangci-lint $(TOOLS)/golangci-lint: PACKAGE=github.com/golangci/golangci-lint/v2/cmd/golangci-lint diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/RELEASING.md b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/RELEASING.md index 861756fd7..6aff7548c 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/RELEASING.md +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/RELEASING.md @@ -4,7 +4,9 @@ Create a `Version Release` issue to track the release process. -## Semantic Convention Generation +## Semantic Convention Upgrade + +### Semantic Convention Generation New versions of the [OpenTelemetry Semantic Conventions] mean new versions of the `semconv` package need to be generated. The `semconv-generate` make target is used for this. @@ -22,6 +24,43 @@ make semconv-generate # Uses the exported TAG. This should create a new sub-package of [`semconv`](./semconv). Ensure things look correct before submitting a pull request to include the addition. +The `CHANGELOG.md` should also be updated to reflect the new changes: + +```md +- The `go.opentelemetry.io/otel/semconv/` package. The package contains semantic conventions from the `` version of the OpenTelemetry Semantic Conventions. See the [migration documentation](./semconv//MIGRATION.md) for information on how to upgrade from `go.opentelemetry.io/otel/semconv/`. (#PR_NUMBER) +``` + +> **Tip:** Change to the release and prior version to match the changes + +### Update semconv imports + +Once the new semconv module has been generated, update all semconv imports throughout the codebase to reference the new version: + +```go +// Before +semconv "go.opentelemetry.io/otel/semconv/v1.37.0" +"go.opentelemetry.io/otel/semconv/v1.37.0/otelconv" + + +// After +semconv "go.opentelemetry.io/otel/semconv/v1.39.0" +"go.opentelemetry.io/otel/semconv/v1.39.0/otelconv" +``` + +Once complete, run `make` to check for any compilation or test failures. + +#### Handling attribute changes + +Some semconv releases might add new attributes or impact attributes that are currently being used. Changes could stem from a simple renaming, to more complex changes like merging attributes and property values being changed. + +One should update the code to the new attributes that supersede the impacted ones, hence sticking to the semantic conventions. However, legacy attributes might still be emitted in accordance to the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable. + +For an example on how such migration might have to be tracked and performed, see issue [#7806](https://github.com/open-telemetry/opentelemetry-go/issues/7806). + +### Go contrib linter update + +Update [.golangci.yml](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/.golangci.yml) in [opentelemetry-go-contrib](https://github.com/open-telemetry/opentelemetry-go-contrib/) to mandate the new semconv version. + ## Breaking changes validation You can run `make gorelease` which runs [gorelease](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease) to ensure that there are no unwanted changes made in the public API. diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/encoder.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/encoder.go index 6cc1a1655..771dd69c5 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/encoder.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/encoder.go @@ -53,7 +53,7 @@ var ( _ Encoder = &defaultAttrEncoder{} // encoderIDCounter is for generating IDs for other attribute encoders. - encoderIDCounter uint64 + encoderIDCounter atomic.Uint64 defaultEncoderOnce sync.Once defaultEncoderID = NewEncoderID() @@ -64,7 +64,7 @@ var ( // once per each type of attribute encoder. Preferably in init() or in var // definition. func NewEncoderID() EncoderID { - return EncoderID{value: atomic.AddUint64(&encoderIDCounter, 1)} + return EncoderID{value: encoderIDCounter.Add(1)} } // DefaultEncoder returns an attribute encoder that encodes attributes in such diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/hash.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/hash.go index 6aa69aeae..b09caaa6d 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/hash.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/hash.go @@ -27,6 +27,7 @@ const ( int64SliceID uint64 = 3762322556277578591 // "_[]int64" (little endian) float64SliceID uint64 = 7308324551835016539 // "[]double" (little endian) stringSliceID uint64 = 7453010373645655387 // "[]string" (little endian) + emptyID uint64 = 7305809155345288421 // "__empty_" (little endian) ) // hashKVs returns a new xxHash64 hash of kvs. @@ -80,7 +81,8 @@ func hashKV(h xxhash.Hash, kv KeyValue) xxhash.Hash { for i := 0; i < rv.Len(); i++ { h = h.String(rv.Index(i).String()) } - case INVALID: + case EMPTY: + h = h.Uint64(emptyID) default: // Logging is an alternative, but using the internal logger here // causes an import cycle so it is not done. diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go index 7f5eae877..d9f51fa2d 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go @@ -11,80 +11,63 @@ import ( "reflect" ) -// BoolSliceValue converts a bool slice into an array with same elements as slice. -func BoolSliceValue(v []bool) any { - cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[bool]())).Elem() - reflect.Copy(cp, reflect.ValueOf(v)) - return cp.Interface() +// sliceElem is the exact set of element types stored in attribute slice values. +// Using a closed set prevents accidental instantiations for unsupported types. +type sliceElem interface { + bool | int64 | float64 | string } -// Int64SliceValue converts an int64 slice into an array with same elements as slice. -func Int64SliceValue(v []int64) any { - cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[int64]())).Elem() - reflect.Copy(cp, reflect.ValueOf(v)) - return cp.Interface() -} - -// Float64SliceValue converts a float64 slice into an array with same elements as slice. -func Float64SliceValue(v []float64) any { - cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[float64]())).Elem() - reflect.Copy(cp, reflect.ValueOf(v)) - return cp.Interface() -} +// SliceValue converts a slice into an array with the same elements. +func SliceValue[T sliceElem](v []T) any { + // Keep only the common tiny-slice cases out of reflection. Extending this + // much further increases code size for diminishing benefit while larger + // slices still need the generic reflective path to preserve comparability. + // This matches the short lengths that show up most often in local + // benchmarks and semantic convention examples while leaving larger, less + // predictable slices on the generic reflective path. + switch len(v) { + case 0: + return [0]T{} + case 1: + return [1]T{v[0]} + case 2: + return [2]T{v[0], v[1]} + case 3: + return [3]T{v[0], v[1], v[2]} + } -// StringSliceValue converts a string slice into an array with same elements as slice. -func StringSliceValue(v []string) any { - cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[string]())).Elem() - reflect.Copy(cp, reflect.ValueOf(v)) - return cp.Interface() + return sliceValueReflect(v) } -// AsBoolSlice converts a bool array into a slice into with same elements as array. -func AsBoolSlice(v any) []bool { - rv := reflect.ValueOf(v) - if rv.Type().Kind() != reflect.Array { - return nil +// AsSlice converts an array into a slice with the same elements. +func AsSlice[T sliceElem](v any) []T { + // Mirror the small fixed-array fast path used by SliceValue. + switch a := v.(type) { + case [0]T: + return []T{} + case [1]T: + return []T{a[0]} + case [2]T: + return []T{a[0], a[1]} + case [3]T: + return []T{a[0], a[1], a[2]} } - cpy := make([]bool, rv.Len()) - if len(cpy) > 0 { - _ = reflect.Copy(reflect.ValueOf(cpy), rv) - } - return cpy -} -// AsInt64Slice converts an int64 array into a slice into with same elements as array. -func AsInt64Slice(v any) []int64 { - rv := reflect.ValueOf(v) - if rv.Type().Kind() != reflect.Array { - return nil - } - cpy := make([]int64, rv.Len()) - if len(cpy) > 0 { - _ = reflect.Copy(reflect.ValueOf(cpy), rv) - } - return cpy + return asSliceReflect[T](v) } -// AsFloat64Slice converts a float64 array into a slice into with same elements as array. -func AsFloat64Slice(v any) []float64 { - rv := reflect.ValueOf(v) - if rv.Type().Kind() != reflect.Array { - return nil - } - cpy := make([]float64, rv.Len()) - if len(cpy) > 0 { - _ = reflect.Copy(reflect.ValueOf(cpy), rv) - } - return cpy +func sliceValueReflect[T sliceElem](v []T) any { + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[T]())).Elem() + reflect.Copy(cp, reflect.ValueOf(v)) + return cp.Interface() } -// AsStringSlice converts a string array into a slice into with same elements as array. -func AsStringSlice(v any) []string { +func asSliceReflect[T sliceElem](v any) []T { rv := reflect.ValueOf(v) - if rv.Type().Kind() != reflect.Array { + if !rv.IsValid() || rv.Kind() != reflect.Array || rv.Type().Elem() != reflect.TypeFor[T]() { return nil } - cpy := make([]string, rv.Len()) + cpy := make([]T, rv.Len()) if len(cpy) > 0 { _ = reflect.Copy(reflect.ValueOf(cpy), rv) } diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/kv.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/kv.go index 8c6928ca7..0cc368018 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/kv.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/kv.go @@ -15,7 +15,7 @@ type KeyValue struct { // Valid reports whether kv is a valid OpenTelemetry attribute. func (kv KeyValue) Valid() bool { - return kv.Key.Defined() && kv.Value.Type() != INVALID + return kv.Key.Defined() } // Bool creates a KeyValue with a BOOL Value type. diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/type_string.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/type_string.go index 24f1fa37d..6c04448d6 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/type_string.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/type_string.go @@ -8,7 +8,7 @@ func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} - _ = x[INVALID-0] + _ = x[EMPTY-0] _ = x[BOOL-1] _ = x[INT64-2] _ = x[FLOAT64-3] @@ -19,9 +19,9 @@ func _() { _ = x[STRINGSLICE-8] } -const _Type_name = "INVALIDBOOLINT64FLOAT64STRINGBOOLSLICEINT64SLICEFLOAT64SLICESTRINGSLICE" +const _Type_name = "EMPTYBOOLINT64FLOAT64STRINGBOOLSLICEINT64SLICEFLOAT64SLICESTRINGSLICE" -var _Type_index = [...]uint8{0, 7, 11, 16, 23, 29, 38, 48, 60, 71} +var _Type_index = [...]uint8{0, 5, 9, 14, 21, 27, 36, 46, 58, 69} func (i Type) String() string { idx := int(i) - 0 diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/value.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/value.go index 5931e7129..db04b1326 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/value.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/attribute/value.go @@ -6,7 +6,6 @@ package attribute // import "go.opentelemetry.io/otel/attribute" import ( "encoding/json" "fmt" - "reflect" "strconv" attribute "go.opentelemetry.io/otel/attribute/internal" @@ -18,6 +17,8 @@ import ( type Type int // nolint: revive // redefines builtin Type. // Value represents the value part in key-value pairs. +// +// Note that the zero value is a valid empty value. type Value struct { vtype Type numeric uint64 @@ -26,8 +27,8 @@ type Value struct { } const ( - // INVALID is used for a Value with no value set. - INVALID Type = iota + // EMPTY is used for a Value with no value set. + EMPTY Type = iota // BOOL is a boolean Type Value. BOOL // INT64 is a 64-bit signed integral Type Value. @@ -44,6 +45,10 @@ const ( FLOAT64SLICE // STRINGSLICE is a slice of strings Type Value. STRINGSLICE + // INVALID is used for a Value with no value set. + // + // Deprecated: Use EMPTY instead as an empty value is a valid value. + INVALID = EMPTY ) // BoolValue creates a BOOL Value. @@ -56,7 +61,7 @@ func BoolValue(v bool) Value { // BoolSliceValue creates a BOOLSLICE Value. func BoolSliceValue(v []bool) Value { - return Value{vtype: BOOLSLICE, slice: attribute.BoolSliceValue(v)} + return Value{vtype: BOOLSLICE, slice: attribute.SliceValue(v)} } // IntValue creates an INT64 Value. @@ -64,16 +69,30 @@ func IntValue(v int) Value { return Int64Value(int64(v)) } -// IntSliceValue creates an INTSLICE Value. +// IntSliceValue creates an INT64SLICE Value. func IntSliceValue(v []int) Value { - cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[int64]())) - for i, val := range v { - cp.Elem().Index(i).SetInt(int64(val)) - } - return Value{ - vtype: INT64SLICE, - slice: cp.Elem().Interface(), + val := Value{vtype: INT64SLICE} + + // Avoid the common tiny-slice cases from allocating a new slice. + switch len(v) { + case 0: + val.slice = [0]int64{} + case 1: + val.slice = [1]int64{int64(v[0])} + case 2: + val.slice = [2]int64{int64(v[0]), int64(v[1])} + case 3: + val.slice = [3]int64{int64(v[0]), int64(v[1]), int64(v[2])} + default: + // Fallback to a new slice for larger slices. + cp := make([]int64, len(v)) + for i, val := range v { + cp[i] = int64(val) + } + val.slice = attribute.SliceValue(cp) } + + return val } // Int64Value creates an INT64 Value. @@ -86,7 +105,7 @@ func Int64Value(v int64) Value { // Int64SliceValue creates an INT64SLICE Value. func Int64SliceValue(v []int64) Value { - return Value{vtype: INT64SLICE, slice: attribute.Int64SliceValue(v)} + return Value{vtype: INT64SLICE, slice: attribute.SliceValue(v)} } // Float64Value creates a FLOAT64 Value. @@ -99,7 +118,7 @@ func Float64Value(v float64) Value { // Float64SliceValue creates a FLOAT64SLICE Value. func Float64SliceValue(v []float64) Value { - return Value{vtype: FLOAT64SLICE, slice: attribute.Float64SliceValue(v)} + return Value{vtype: FLOAT64SLICE, slice: attribute.SliceValue(v)} } // StringValue creates a STRING Value. @@ -112,7 +131,7 @@ func StringValue(v string) Value { // StringSliceValue creates a STRINGSLICE Value. func StringSliceValue(v []string) Value { - return Value{vtype: STRINGSLICE, slice: attribute.StringSliceValue(v)} + return Value{vtype: STRINGSLICE, slice: attribute.SliceValue(v)} } // Type returns a type of the Value. @@ -136,7 +155,7 @@ func (v Value) AsBoolSlice() []bool { } func (v Value) asBoolSlice() []bool { - return attribute.AsBoolSlice(v.slice) + return attribute.AsSlice[bool](v.slice) } // AsInt64 returns the int64 value. Make sure that the Value's type is @@ -155,7 +174,7 @@ func (v Value) AsInt64Slice() []int64 { } func (v Value) asInt64Slice() []int64 { - return attribute.AsInt64Slice(v.slice) + return attribute.AsSlice[int64](v.slice) } // AsFloat64 returns the float64 value. Make sure that the Value's @@ -174,7 +193,7 @@ func (v Value) AsFloat64Slice() []float64 { } func (v Value) asFloat64Slice() []float64 { - return attribute.AsFloat64Slice(v.slice) + return attribute.AsSlice[float64](v.slice) } // AsString returns the string value. Make sure that the Value's type @@ -193,7 +212,7 @@ func (v Value) AsStringSlice() []string { } func (v Value) asStringSlice() []string { - return attribute.AsStringSlice(v.slice) + return attribute.AsSlice[string](v.slice) } type unknownValueType struct{} @@ -217,6 +236,8 @@ func (v Value) AsInterface() any { return v.stringly case STRINGSLICE: return v.asStringSlice() + case EMPTY: + return nil } return unknownValueType{} } @@ -252,6 +273,8 @@ func (v Value) Emit() string { return string(j) case STRING: return v.stringly + case EMPTY: + return "" default: return "unknown" } diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile index f0cc942ba..7a9b3c055 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/dependencies.Dockerfile @@ -1,4 +1,4 @@ # This is a renovate-friendly source of Docker images. FROM python:3.13.6-slim-bullseye@sha256:e98b521460ee75bca92175c16247bdf7275637a8faaeb2bcfa19d879ae5c4b9a AS python -FROM otel/weaver:v0.21.2@sha256:2401de985c38bdb98b43918e2f43aa36b2afed4aa5669ac1c1de0a17301cd36d AS weaver +FROM otel/weaver:v0.22.1@sha256:33ae522ae4b71c1c562563c1d81f46aa0f79f088a0873199143a1f11ac30e5c9 AS weaver FROM avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee AS markdown diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/internal/x/features.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/internal/x/features.go index bfeb73e81..694b64a31 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/internal/x/features.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/internal/x/features.go @@ -37,3 +37,18 @@ var Observability = newFeature( return "", false }, ) + +// PerSeriesStartTimestamps is an experimental feature flag that determines if the SDK +// uses the new Start Timestamps specification. +// +// To enable this feature set the OTEL_GO_X_PER_SERIES_START_TIMESTAMPS environment variable +// to the case-insensitive string value of "true". +var PerSeriesStartTimestamps = newFeature( + []string{"PER_SERIES_START_TIMESTAMPS"}, + func(v string) (bool, bool) { + if strings.EqualFold(v, "true") { + return true, true + } + return false, false + }, +) diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/config.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/config.go index c6440a134..306e5e3cd 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/config.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/config.go @@ -160,12 +160,14 @@ func WithExemplarFilter(filter exemplar.Filter) Option { }) } -// WithCardinalityLimit sets the cardinality limit for the MeterProvider. +// WithCardinalityLimit sets the global cardinality limit for the MeterProvider. // // The cardinality limit is the hard limit on the number of metric datapoints // that can be collected for a single instrument in a single collect cycle. // // Setting this to a zero or negative value means no limit is applied. +// This value applies to all instrument kinds, but can be overridden per kind by +// the reader's cardinality limit selector (see [WithCardinalityLimitSelector]). func WithCardinalityLimit(limit int) Option { // For backward compatibility, the environment variable `OTEL_GO_X_CARDINALITY_LIMIT` // can also be used to set this value. diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go index 2aeba4378..312d73c45 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/exponential_histogram.go @@ -8,10 +8,12 @@ import ( "errors" "math" "sync" + "sync/atomic" "time" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/internal/x" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) @@ -20,11 +22,6 @@ const ( expoMinScale = -10 smallestNonZeroNormalFloat64 = 0x1p-1022 - - // These redefine the Math constants with a type, so the compiler won't coerce - // them into an int on 32 bit platforms. - maxInt64 int64 = math.MaxInt64 - minInt64 int64 = math.MinInt64 ) // expoHistogramDataPoint is a single data point in an exponential histogram. @@ -32,19 +29,19 @@ type expoHistogramDataPoint[N int64 | float64] struct { attrs attribute.Set res FilteredExemplarReservoir[N] - min N - max N - sum N + minMax atomicMinMax[N] + sum atomicCounter[N] maxSize int noMinMax bool noSum bool - scale int32 + scale atomic.Int32 posBuckets expoBuckets negBuckets expoBuckets - zeroCount uint64 + zeroCount atomic.Uint64 + startTime time.Time } func newExpoHistogramDataPoint[N int64 | float64]( @@ -53,42 +50,30 @@ func newExpoHistogramDataPoint[N int64 | float64]( maxScale int32, noMinMax, noSum bool, ) *expoHistogramDataPoint[N] { // nolint:revive // we need this control flag - f := math.MaxFloat64 - ma := N(f) // if N is int64, max will overflow to -9223372036854775808 - mi := N(-f) - if N(maxInt64) > N(f) { - ma = N(maxInt64) - mi = N(minInt64) - } - return &expoHistogramDataPoint[N]{ - attrs: attrs, - min: ma, - max: mi, - maxSize: maxSize, - noMinMax: noMinMax, - noSum: noSum, - scale: maxScale, + dp := &expoHistogramDataPoint[N]{ + attrs: attrs, + maxSize: maxSize, + noMinMax: noMinMax, + noSum: noSum, + startTime: now(), } + dp.scale.Store(maxScale) + return dp } // record adds a new measurement to the histogram. It will rescale the buckets if needed. func (p *expoHistogramDataPoint[N]) record(v N) { if !p.noMinMax { - if v < p.min { - p.min = v - } - if v > p.max { - p.max = v - } + p.minMax.Update(v) } if !p.noSum { - p.sum += v + p.sum.add(v) } absV := math.Abs(float64(v)) if float64(absV) == 0.0 { - p.zeroCount++ + p.zeroCount.Add(1) return } @@ -102,14 +87,15 @@ func (p *expoHistogramDataPoint[N]) record(v N) { // If the new bin would make the counts larger than maxScale, we need to // downscale current measurements. if scaleDelta := p.scaleChange(bin, bucket.startBin, len(bucket.counts)); scaleDelta > 0 { - if p.scale-scaleDelta < expoMinScale { + currentScale := p.scale.Load() + if currentScale-scaleDelta < expoMinScale { // With a scale of -10 there is only two buckets for the whole range of float64 values. // This can only happen if there is a max size of 1. otel.Handle(errors.New("exponential histogram scale underflow")) return } // Downscale - p.scale -= scaleDelta + p.scale.Add(-scaleDelta) p.posBuckets.downscale(scaleDelta) p.negBuckets.downscale(scaleDelta) @@ -124,7 +110,8 @@ func (p *expoHistogramDataPoint[N]) getBin(v float64) int32 { frac, expInt := math.Frexp(v) // 11-bit exponential. exp := int32(expInt) // nolint: gosec - if p.scale <= 0 { + scale := p.scale.Load() + if scale <= 0 { // Because of the choice of fraction is always 1 power of two higher than we want. var correction int32 = 1 if frac == .5 { @@ -132,9 +119,9 @@ func (p *expoHistogramDataPoint[N]) getBin(v float64) int32 { // will be one higher than we want. correction = 2 } - return (exp - correction) >> (-p.scale) + return (exp - correction) >> (-scale) } - return exp<= b.startBin && int(bin) <= endBin { - b.counts[bin-b.startBin]++ + b.counts[bin-b.startBin].Add(1) return } // if the new bin is before the current start add spaces to the counts @@ -223,16 +211,22 @@ func (b *expoBuckets) record(bin int32) { shift := b.startBin - bin if newLength > cap(b.counts) { - b.counts = append(b.counts, make([]uint64, newLength-len(b.counts))...) + b.counts = append(b.counts, make([]atomic.Uint64, newLength-len(b.counts))...) } - copy(b.counts[shift:origLen+int(shift)], b.counts) b.counts = b.counts[:newLength] + + // Shift existing elements to the right. Go's copy() doesn't work for + // structs like atomic.Uint64. + for i := origLen - 1; i >= 0; i-- { + b.counts[i+int(shift)].Store(b.counts[i].Load()) + } + for i := 1; i < int(shift); i++ { - b.counts[i] = 0 + b.counts[i].Store(0) } b.startBin = bin - b.counts[0] = 1 + b.counts[0].Store(1) return } // if the new is after the end add spaces to the end @@ -240,15 +234,15 @@ func (b *expoBuckets) record(bin int32) { if int(bin-b.startBin) < cap(b.counts) { b.counts = b.counts[:bin-b.startBin+1] for i := endBin + 1 - int(b.startBin); i < len(b.counts); i++ { - b.counts[i] = 0 + b.counts[i].Store(0) } - b.counts[bin-b.startBin] = 1 + b.counts[bin-b.startBin].Store(1) return } - end := make([]uint64, int(bin-b.startBin)-len(b.counts)+1) + end := make([]atomic.Uint64, int(bin-b.startBin)-len(b.counts)+1) b.counts = append(b.counts, end...) - b.counts[bin-b.startBin] = 1 + b.counts[bin-b.startBin].Store(1) } } @@ -275,10 +269,10 @@ func (b *expoBuckets) downscale(delta int32) { for i := 1; i < len(b.counts); i++ { idx := i + int(offset) if idx%int(steps) == 0 { - b.counts[idx/int(steps)] = b.counts[i] + b.counts[idx/int(steps)].Store(b.counts[i].Load()) continue } - b.counts[idx/int(steps)] += b.counts[i] + b.counts[idx/int(steps)].Add(b.counts[i].Load()) } lastIdx := (len(b.counts) - 1 + int(offset)) / int(steps) @@ -288,8 +282,8 @@ func (b *expoBuckets) downscale(delta int32) { func (b *expoBuckets) count() uint64 { var total uint64 - for _, count := range b.counts { - total += count + for i := range b.counts { + total += b.counts[i].Load() } return total } @@ -386,8 +380,8 @@ func (e *expoHistogram[N]) delta( hDPts[i].StartTime = e.start hDPts[i].Time = t hDPts[i].Count = val.count() - hDPts[i].Scale = val.scale - hDPts[i].ZeroCount = val.zeroCount + hDPts[i].Scale = val.scale.Load() + hDPts[i].ZeroCount = val.zeroCount.Load() hDPts[i].ZeroThreshold = 0.0 hDPts[i].PositiveBucket.Offset = val.posBuckets.startBin @@ -396,7 +390,9 @@ func (e *expoHistogram[N]) delta( len(val.posBuckets.counts), len(val.posBuckets.counts), ) - copy(hDPts[i].PositiveBucket.Counts, val.posBuckets.counts) + for j := range val.posBuckets.counts { + hDPts[i].PositiveBucket.Counts[j] = val.posBuckets.counts[j].Load() + } hDPts[i].NegativeBucket.Offset = val.negBuckets.startBin hDPts[i].NegativeBucket.Counts = reset( @@ -404,14 +400,18 @@ func (e *expoHistogram[N]) delta( len(val.negBuckets.counts), len(val.negBuckets.counts), ) - copy(hDPts[i].NegativeBucket.Counts, val.negBuckets.counts) + for j := range val.negBuckets.counts { + hDPts[i].NegativeBucket.Counts[j] = val.negBuckets.counts[j].Load() + } if !e.noSum { - hDPts[i].Sum = val.sum + hDPts[i].Sum = val.sum.load() } if !e.noMinMax { - hDPts[i].Min = metricdata.NewExtrema(val.min) - hDPts[i].Max = metricdata.NewExtrema(val.max) + if val.minMax.set.Load() { + hDPts[i].Min = metricdata.NewExtrema(val.minMax.minimum.Load()) + hDPts[i].Max = metricdata.NewExtrema(val.minMax.maximum.Load()) + } } collectExemplars(&hDPts[i].Exemplars, val.res.Collect) @@ -443,14 +443,21 @@ func (e *expoHistogram[N]) cumulative( n := len(e.values) hDPts := reset(h.DataPoints, n, n) + perSeriesStartTimeEnabled := x.PerSeriesStartTimestamps.Enabled() + var i int for _, val := range e.values { hDPts[i].Attributes = val.attrs - hDPts[i].StartTime = e.start + + startTime := e.start + if perSeriesStartTimeEnabled { + startTime = val.startTime + } + hDPts[i].StartTime = startTime hDPts[i].Time = t hDPts[i].Count = val.count() - hDPts[i].Scale = val.scale - hDPts[i].ZeroCount = val.zeroCount + hDPts[i].Scale = val.scale.Load() + hDPts[i].ZeroCount = val.zeroCount.Load() hDPts[i].ZeroThreshold = 0.0 hDPts[i].PositiveBucket.Offset = val.posBuckets.startBin @@ -459,7 +466,9 @@ func (e *expoHistogram[N]) cumulative( len(val.posBuckets.counts), len(val.posBuckets.counts), ) - copy(hDPts[i].PositiveBucket.Counts, val.posBuckets.counts) + for j := range val.posBuckets.counts { + hDPts[i].PositiveBucket.Counts[j] = val.posBuckets.counts[j].Load() + } hDPts[i].NegativeBucket.Offset = val.negBuckets.startBin hDPts[i].NegativeBucket.Counts = reset( @@ -467,14 +476,18 @@ func (e *expoHistogram[N]) cumulative( len(val.negBuckets.counts), len(val.negBuckets.counts), ) - copy(hDPts[i].NegativeBucket.Counts, val.negBuckets.counts) + for j := range val.negBuckets.counts { + hDPts[i].NegativeBucket.Counts[j] = val.negBuckets.counts[j].Load() + } if !e.noSum { - hDPts[i].Sum = val.sum + hDPts[i].Sum = val.sum.load() } if !e.noMinMax { - hDPts[i].Min = metricdata.NewExtrema(val.min) - hDPts[i].Max = metricdata.NewExtrema(val.max) + if val.minMax.set.Load() { + hDPts[i].Min = metricdata.NewExtrema(val.minMax.minimum.Load()) + hDPts[i].Max = metricdata.NewExtrema(val.minMax.maximum.Load()) + } } collectExemplars(&hDPts[i].Exemplars, val.res.Collect) diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go index 421325fb7..83582c670 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/histogram.go @@ -11,6 +11,7 @@ import ( "time" "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/internal/x" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) @@ -27,8 +28,9 @@ type hotColdHistogramPoint[N int64 | float64] struct { hcwg hotColdWaitGroup hotColdPoint [2]histogramPointCounters[N] - attrs attribute.Set - res FilteredExemplarReservoir[N] + attrs attribute.Set + res FilteredExemplarReservoir[N] + startTime time.Time } // histogramPointCounters contains only the atomic counter data, and is used by @@ -298,6 +300,7 @@ func (s *cumulativeHistogram[N]) measure( counts: make([]atomic.Uint64, len(s.bounds)+1), }, }, + startTime: now(), } return hPt }).(*hotColdHistogramPoint[N]) @@ -339,16 +342,23 @@ func (s *cumulativeHistogram[N]) collect( // current length for capacity. hDPts := reset(h.DataPoints, 0, s.values.Len()) + perSeriesStartTimeEnabled := x.PerSeriesStartTimestamps.Enabled() + var i int s.values.Range(func(_, value any) bool { val := value.(*hotColdHistogramPoint[N]) + + startTime := s.start + if perSeriesStartTimeEnabled { + startTime = val.startTime + } // swap, observe, and clear the point readIdx := val.hcwg.swapHotAndWait() var bucketCounts []uint64 count := val.hotColdPoint[readIdx].loadCountsInto(&bucketCounts) newPt := metricdata.HistogramDataPoint[N]{ Attributes: val.attrs, - StartTime: s.start, + StartTime: startTime, Time: t, Count: count, Bounds: bounds, diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go index 4924d732c..4c004bc99 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/lastvalue.go @@ -8,14 +8,16 @@ import ( "time" "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/internal/x" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) // lastValuePoint is timestamped measurement data. type lastValuePoint[N int64 | float64] struct { - attrs attribute.Set - value atomicN[N] - res FilteredExemplarReservoir[N] + attrs attribute.Set + value atomicN[N] + res FilteredExemplarReservoir[N] + startTime time.Time } // lastValueMap summarizes a set of measurements as the last one made. @@ -31,10 +33,13 @@ func (s *lastValueMap[N]) measure( droppedAttr []attribute.KeyValue, ) { lv := s.values.LoadOrStoreAttr(fltrAttr, func(attr attribute.Set) any { - return &lastValuePoint[N]{ - res: s.newRes(attr), - attrs: attr, + p := &lastValuePoint[N]{ + res: s.newRes(attr), + attrs: attr, + startTime: now(), } + p.value.Store(value) + return p }).(*lastValuePoint[N]) lv.value.Store(value) @@ -156,12 +161,19 @@ func (s *cumulativeLastValue[N]) collect( // current length for capacity. dPts := reset(gData.DataPoints, 0, s.values.Len()) + perSeriesStartTimeEnabled := x.PerSeriesStartTimestamps.Enabled() + var i int s.values.Range(func(_, value any) bool { v := value.(*lastValuePoint[N]) + + startTime := s.start + if perSeriesStartTimeEnabled { + startTime = v.startTime + } newPt := metricdata.DataPoint[N]{ Attributes: v.attrs, - StartTime: s.start, + StartTime: startTime, Time: t, Value: v.value.Load(), } diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go index 66cb68085..3fe7c7cf0 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/internal/aggregate/sum.go @@ -8,13 +8,15 @@ import ( "time" "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/sdk/internal/x" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) type sumValue[N int64 | float64] struct { - n atomicCounter[N] - res FilteredExemplarReservoir[N] - attrs attribute.Set + n atomicCounter[N] + res FilteredExemplarReservoir[N] + attrs attribute.Set + startTime time.Time } type sumValueMap[N int64 | float64] struct { @@ -30,8 +32,9 @@ func (s *sumValueMap[N]) measure( ) { sv := s.values.LoadOrStoreAttr(fltrAttr, func(attr attribute.Set) any { return &sumValue[N]{ - res: s.newRes(attr), - attrs: attr, + res: s.newRes(attr), + attrs: attr, + startTime: now(), } }).(*sumValue[N]) sv.n.add(value) @@ -160,12 +163,19 @@ func (s *cumulativeSum[N]) collect( // current length for capacity. dPts := reset(sData.DataPoints, 0, s.values.Len()) + perSeriesStartTimeEnabled := x.PerSeriesStartTimestamps.Enabled() + var i int s.values.Range(func(_, value any) bool { val := value.(*sumValue[N]) + + startTime := s.start + if perSeriesStartTimeEnabled { + startTime = val.startTime + } newPt := metricdata.DataPoint[N]{ Attributes: val.attrs, - StartTime: s.start, + StartTime: startTime, Time: t, Value: val.n.load(), } diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go index 5b0630207..0357afd45 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go @@ -32,8 +32,9 @@ type ManualReader struct { isShutdown bool externalProducers atomic.Value - temporalitySelector TemporalitySelector - aggregationSelector AggregationSelector + temporalitySelector TemporalitySelector + aggregationSelector AggregationSelector + cardinalityLimitSelector CardinalityLimitSelector inst *observ.Instrumentation } @@ -45,8 +46,9 @@ var _ = map[Reader]struct{}{&ManualReader{}: {}} func NewManualReader(opts ...ManualReaderOption) *ManualReader { cfg := newManualReaderConfig(opts) r := &ManualReader{ - temporalitySelector: cfg.temporalitySelector, - aggregationSelector: cfg.aggregationSelector, + temporalitySelector: cfg.temporalitySelector, + aggregationSelector: cfg.aggregationSelector, + cardinalityLimitSelector: cfg.cardinalityLimitSelector, } r.externalProducers.Store(cfg.producers) @@ -89,6 +91,11 @@ func (mr *ManualReader) aggregation( return mr.aggregationSelector(kind) } +// cardinalityLimit returns the cardinality limit for kind. +func (mr *ManualReader) cardinalityLimit(kind InstrumentKind) (int, bool) { + return mr.cardinalityLimitSelector(kind) +} + // Shutdown closes any connections and frees any resources used by the reader. // // This method is safe to call concurrently. @@ -179,16 +186,18 @@ func (r *ManualReader) MarshalLog() any { // manualReaderConfig contains configuration options for a ManualReader. type manualReaderConfig struct { - temporalitySelector TemporalitySelector - aggregationSelector AggregationSelector - producers []Producer + temporalitySelector TemporalitySelector + aggregationSelector AggregationSelector + cardinalityLimitSelector CardinalityLimitSelector + producers []Producer } // newManualReaderConfig returns a manualReaderConfig configured with options. func newManualReaderConfig(opts []ManualReaderOption) manualReaderConfig { cfg := manualReaderConfig{ - temporalitySelector: DefaultTemporalitySelector, - aggregationSelector: DefaultAggregationSelector, + temporalitySelector: DefaultTemporalitySelector, + aggregationSelector: DefaultAggregationSelector, + cardinalityLimitSelector: defaultCardinalityLimitSelector, } for _, opt := range opts { cfg = opt.applyManual(cfg) diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go index 32a7e1932..d1efc9f37 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/periodic_reader.go @@ -26,17 +26,19 @@ const ( // periodicReaderConfig contains configuration options for a PeriodicReader. type periodicReaderConfig struct { - interval time.Duration - timeout time.Duration - producers []Producer + interval time.Duration + timeout time.Duration + producers []Producer + cardinalityLimitSelector CardinalityLimitSelector } // newPeriodicReaderConfig returns a periodicReaderConfig configured with // options. func newPeriodicReaderConfig(options []PeriodicReaderOption) periodicReaderConfig { c := periodicReaderConfig{ - interval: envDuration(envInterval, defaultInterval), - timeout: envDuration(envTimeout, defaultTimeout), + interval: envDuration(envInterval, defaultInterval), + timeout: envDuration(envTimeout, defaultTimeout), + cardinalityLimitSelector: defaultCardinalityLimitSelector, } for _, o := range options { c = o.applyPeriodic(c) @@ -111,12 +113,13 @@ func NewPeriodicReader(exporter Exporter, options ...PeriodicReaderOption) *Peri context.Background(), ) r := &PeriodicReader{ - interval: conf.interval, - timeout: conf.timeout, - exporter: exporter, - flushCh: make(chan chan error), - cancel: cancel, - done: make(chan struct{}), + interval: conf.interval, + timeout: conf.timeout, + exporter: exporter, + flushCh: make(chan chan error), + cancel: cancel, + done: make(chan struct{}), + cardinalityLimitSelector: conf.cardinalityLimitSelector, rmPool: sync.Pool{ New: func() any { return &metricdata.ResourceMetrics{} @@ -170,6 +173,8 @@ type PeriodicReader struct { rmPool sync.Pool + cardinalityLimitSelector CardinalityLimitSelector + inst *observ.Instrumentation } @@ -222,6 +227,11 @@ func (r *PeriodicReader) aggregation( return r.exporter.Aggregation(kind) } +// cardinalityLimit returns the cardinality limit for kind. +func (r *PeriodicReader) cardinalityLimit(kind InstrumentKind) (int, bool) { + return r.cardinalityLimitSelector(kind) +} + // collectAndExport gather all metric data related to the periodicReader r from // the SDK and exports it with r's exporter. func (r *PeriodicReader) collectAndExport(ctx context.Context) error { diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go index ab269cdfd..34300a786 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/pipeline.go @@ -301,7 +301,7 @@ func (i *inserter[N]) addCallback(cback func(context.Context) error) { i.pipeline.callbacks = append(i.pipeline.callbacks, cback) } -var aggIDCount uint64 +var aggIDCount atomic.Uint64 // aggVal is the cached value in an aggregators cache. type aggVal[N int64 | float64] struct { @@ -395,9 +395,7 @@ func (i *inserter[N]) cachedAggregator( b.Filter = stream.AttributeFilter // A value less than or equal to zero will disable the aggregation // limits for the builder (an all the created aggregates). - // cardinalityLimit will be 0 by default if unset (or - // unrecognized input). Use that value directly. - b.AggregationLimit = i.pipeline.cardinalityLimit + b.AggregationLimit = i.getCardinalityLimit(kind) in, out, err := i.aggregateFunc(b, stream.Aggregation, kind) if err != nil { return aggVal[N]{0, nil, err} @@ -413,12 +411,24 @@ func (i *inserter[N]) cachedAggregator( unit: stream.Unit, compAgg: out, }) - id := atomic.AddUint64(&aggIDCount, 1) + id := aggIDCount.Add(1) return aggVal[N]{id, in, err} }) return cv.Measure, cv.ID, cv.Err } +// getCardinalityLimit returns the cardinality limit for the given instrument kind. +// When the reader's selector returns fallback = true, the pipeline's global +// limit is used, then the default if global is unset. When fallback is false, +// the selector's limit is used (0 or less means unlimited). +func (i *inserter[N]) getCardinalityLimit(kind InstrumentKind) int { + limit, fallback := i.pipeline.reader.cardinalityLimit(kind) + if fallback { + return i.pipeline.cardinalityLimit + } + return limit +} + // logConflict validates if an instrument with the same case-insensitive name // as id has already been created. If that instrument conflicts with id, a // warning is logged. diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go index 7b205c736..99079dd27 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/reader.go @@ -59,6 +59,15 @@ type Reader interface { // Reader methods. aggregation(InstrumentKind) Aggregation // nolint:revive // import-shadow for method scoped by type. + // cardinalityLimit returns the cardinality limit for an instrument kind. + // When fallback is true, the pipeline falls back to the provider's global limit. + // When fallback is false, limit is used: 0 or less means no limit (unlimited), + // and a positive value is the limit for that kind. + // + // This method needs to be concurrent safe with itself and all the other + // Reader methods. + cardinalityLimit(InstrumentKind) (limit int, fallback bool) + // Collect gathers and returns all metric data related to the Reader from // the SDK and stores it in rm. An error is returned if this is called // after Shutdown or if rm is nil. @@ -192,6 +201,25 @@ func DefaultAggregationSelector(ik InstrumentKind) Aggregation { panic("unknown instrument kind") } +// CardinalityLimitSelector selects the cardinality limit to use based on the +// InstrumentKind. The cardinality limit is the maximum number of distinct +// attribute sets that can be recorded for a single instrument. +// +// The selector returns (limit, fallback). When fallback is true, the pipeline +// falls back to the provider's global cardinality limit. +// When fallback is false, the limit is applied: a value of 0 or less means +// no limit, and a positive value is the limit for that kind. +// To avoid overriding the provider's global limit, return (0, true). +type CardinalityLimitSelector func(InstrumentKind) (limit int, fallback bool) + +// defaultCardinalityLimitSelector is the default CardinalityLimitSelector used +// if WithCardinalityLimitSelector is not provided. It returns (0, true) for all +// instrument kinds, allowing the pipeline to fall back to the provider's global +// limit. +func defaultCardinalityLimitSelector(_ InstrumentKind) (int, bool) { + return 0, true +} + // ReaderOption is an option which can be applied to manual or Periodic // readers. type ReaderOption interface { @@ -220,3 +248,33 @@ func (o producerOption) applyPeriodic(c periodicReaderConfig) periodicReaderConf c.producers = append(c.producers, o.p) return c } + +// WithCardinalityLimitSelector sets the CardinalityLimitSelector a reader will +// use to determine the cardinality limit for an instrument based on its kind. +// If this option is not used, the reader will use the +// defaultCardinalityLimitSelector. +// +// The selector should return (limit, false) to set a positive limit, +// (0, false) to explicitly specify unlimited, or +// (0, true) to fall back to the provider's global limit. +// +// See [CardinalityLimitSelector] for more details. +func WithCardinalityLimitSelector(selector CardinalityLimitSelector) ReaderOption { + return cardinalityLimitSelectorOption{selector: selector} +} + +type cardinalityLimitSelectorOption struct { + selector CardinalityLimitSelector +} + +// applyManual returns a manualReaderConfig with option applied. +func (o cardinalityLimitSelectorOption) applyManual(c manualReaderConfig) manualReaderConfig { + c.cardinalityLimitSelector = o.selector + return c +} + +// applyPeriodic returns a periodicReaderConfig with option applied. +func (o cardinalityLimitSelectorOption) applyPeriodic(c periodicReaderConfig) periodicReaderConfig { + c.cardinalityLimitSelector = o.selector + return c +} diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/version.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/version.go index 6ea297f07..26752be7d 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/version.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/metric/version.go @@ -5,5 +5,5 @@ package metric // import "go.opentelemetry.io/otel/sdk/metric" // version is the current release version of the metric SDK in use. func version() string { - return "1.42.0" + return "1.43.0" } diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/config.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/config.go index 0d6e213d9..a3d647d92 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/config.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/config.go @@ -193,3 +193,11 @@ func WithContainer() Option { func WithContainerID() Option { return WithDetectors(cgroupContainerIDDetector{}) } + +// WithService adds all the Service attributes to the configured Resource. +func WithService() Option { + return WithDetectors( + defaultServiceInstanceIDDetector{}, + defaultServiceNameDetector{}, + ) +} diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go index 1a72b756a..755c08242 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go @@ -31,19 +31,19 @@ type hostIDReaderBSD struct { readFile fileReader } -// read attempts to read the machine-id from /etc/hostid. If not found it will -// execute `kenv -q smbios.system.uuid`. If neither location yields an id an -// error will be returned. +// read attempts to read the machine-id from /etc/hostid. +// If not found it will execute: /bin/kenv -q smbios.system.uuid. +// If neither location yields an id an error will be returned. func (r *hostIDReaderBSD) read() (string, error) { if result, err := r.readFile("/etc/hostid"); err == nil { return strings.TrimSpace(result), nil } - if result, err := r.execCommand("kenv", "-q", "smbios.system.uuid"); err == nil { + if result, err := r.execCommand("/bin/kenv", "-q", "smbios.system.uuid"); err == nil { return strings.TrimSpace(result), nil } - return "", errors.New("host id not found in: /etc/hostid or kenv") + return "", errors.New("host id not found in: /etc/hostid or /bin/kenv") } // hostIDReaderDarwin implements hostIDReader. diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go index 28e1e4f7e..f715be53e 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/resource/resource.go @@ -232,6 +232,15 @@ func Empty() *Resource { // Default returns an instance of Resource with a default // "service.name" and OpenTelemetrySDK attributes. func Default() *Resource { + return DefaultWithContext(context.Background()) +} + +// DefaultWithContext returns an instance of Resource with a default +// "service.name" and OpenTelemetrySDK attributes. +// +// If the default resource has already been initialized, the provided ctx +// is ignored and the cached resource is returned. +func DefaultWithContext(ctx context.Context) *Resource { defaultResourceOnce.Do(func() { var err error defaultDetectors := []Detector{ @@ -243,7 +252,7 @@ func Default() *Resource { defaultDetectors = append([]Detector{defaultServiceInstanceIDDetector{}}, defaultDetectors...) } defaultResource, err = Detect( - context.Background(), + ctx, defaultDetectors..., ) if err != nil { @@ -260,8 +269,14 @@ func Default() *Resource { // Environment returns an instance of Resource with attributes // extracted from the OTEL_RESOURCE_ATTRIBUTES environment variable. func Environment() *Resource { + return EnvironmentWithContext(context.Background()) +} + +// EnvironmentWithContext returns an instance of Resource with attributes +// extracted from the OTEL_RESOURCE_ATTRIBUTES environment variable. +func EnvironmentWithContext(ctx context.Context) *Resource { detector := &fromEnv{} - resource, err := detector.Detect(context.Background()) + resource, err := detector.Detect(ctx) if err != nil { otel.Handle(err) } diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/version.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/version.go index 96e0fc60f..766731dd2 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/version.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/sdk/version.go @@ -6,5 +6,5 @@ package sdk // import "go.opentelemetry.io/otel/sdk" // Version is the current release version of the OpenTelemetry SDK in use. func Version() string { - return "1.42.0" + return "1.43.0" } diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/trace/trace.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/trace/trace.go index 96c06ec32..e3d103c4b 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/trace/trace.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/trace/trace.go @@ -196,6 +196,20 @@ func (tf TraceFlags) WithSampled(sampled bool) TraceFlags { // nolint:revive // return tf &^ FlagsSampled } +// IsRandom reports whether the random bit is set in the TraceFlags. +func (tf TraceFlags) IsRandom() bool { + return tf&FlagsRandom == FlagsRandom +} + +// WithRandom sets the random bit in a new copy of the TraceFlags. +func (tf TraceFlags) WithRandom(random bool) TraceFlags { // nolint:revive // random is not a control flag. + if random { + return tf | FlagsRandom + } + + return tf &^ FlagsRandom +} + // MarshalJSON implements a custom marshal function to encode TraceFlags // as a hex string. func (tf TraceFlags) MarshalJSON() ([]byte, error) { @@ -322,6 +336,11 @@ func (sc SpanContext) IsSampled() bool { return sc.traceFlags.IsSampled() } +// IsRandom reports whether the random bit is set in the SpanContext's TraceFlags. +func (sc SpanContext) IsRandom() bool { + return sc.traceFlags.IsRandom() +} + // WithTraceFlags returns a new SpanContext with the TraceFlags replaced. func (sc SpanContext) WithTraceFlags(flags TraceFlags) SpanContext { return SpanContext{ diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/version.go b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/version.go index 2dae06f25..1db4f47e4 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/version.go +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/version.go @@ -5,5 +5,5 @@ package otel // import "go.opentelemetry.io/otel" // Version is the current release version of OpenTelemetry in use. func Version() string { - return "1.42.0" + return "1.43.0" } diff --git a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/versions.yaml b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/versions.yaml index 6c634ef31..bcc6ee78a 100644 --- a/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/versions.yaml +++ b/ci/resources/stemcell-version-bump/vendor/go.opentelemetry.io/otel/versions.yaml @@ -3,7 +3,7 @@ module-sets: stable-v1: - version: v1.42.0 + version: v1.43.0 modules: - go.opentelemetry.io/otel - go.opentelemetry.io/otel/bridge/opencensus @@ -22,11 +22,11 @@ module-sets: - go.opentelemetry.io/otel/sdk/metric - go.opentelemetry.io/otel/trace experimental-metrics: - version: v0.64.0 + version: v0.65.0 modules: - go.opentelemetry.io/otel/exporters/prometheus experimental-logs: - version: v0.18.0 + version: v0.19.0 modules: - go.opentelemetry.io/otel/log - go.opentelemetry.io/otel/log/logtest @@ -64,3 +64,6 @@ modules: go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp: version-refs: - ./internal/version.go + go.opentelemetry.io/otel/exporters/stdout/stdoutlog: + version-refs: + - ./internal/version.go diff --git a/ci/resources/stemcell-version-bump/vendor/modules.txt b/ci/resources/stemcell-version-bump/vendor/modules.txt index 3927713d7..a5260f87c 100644 --- a/ci/resources/stemcell-version-bump/vendor/modules.txt +++ b/ci/resources/stemcell-version-bump/vendor/modules.txt @@ -218,7 +218,7 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil -# go.opentelemetry.io/otel v1.42.0 +# go.opentelemetry.io/otel v1.43.0 ## explicit; go 1.25.0 go.opentelemetry.io/otel go.opentelemetry.io/otel/attribute @@ -236,18 +236,18 @@ go.opentelemetry.io/otel/semconv/v1.37.0 go.opentelemetry.io/otel/semconv/v1.37.0/rpcconv go.opentelemetry.io/otel/semconv/v1.40.0 go.opentelemetry.io/otel/semconv/v1.40.0/otelconv -# go.opentelemetry.io/otel/metric v1.42.0 +# go.opentelemetry.io/otel/metric v1.43.0 ## explicit; go 1.25.0 go.opentelemetry.io/otel/metric go.opentelemetry.io/otel/metric/embedded go.opentelemetry.io/otel/metric/noop -# go.opentelemetry.io/otel/sdk v1.42.0 +# go.opentelemetry.io/otel/sdk v1.43.0 ## explicit; go 1.25.0 go.opentelemetry.io/otel/sdk go.opentelemetry.io/otel/sdk/instrumentation go.opentelemetry.io/otel/sdk/internal/x go.opentelemetry.io/otel/sdk/resource -# go.opentelemetry.io/otel/sdk/metric v1.42.0 +# go.opentelemetry.io/otel/sdk/metric v1.43.0 ## explicit; go 1.25.0 go.opentelemetry.io/otel/sdk/metric go.opentelemetry.io/otel/sdk/metric/exemplar @@ -256,7 +256,7 @@ go.opentelemetry.io/otel/sdk/metric/internal/aggregate go.opentelemetry.io/otel/sdk/metric/internal/observ go.opentelemetry.io/otel/sdk/metric/internal/reservoir go.opentelemetry.io/otel/sdk/metric/metricdata -# go.opentelemetry.io/otel/trace v1.42.0 +# go.opentelemetry.io/otel/trace v1.43.0 ## explicit; go 1.25.0 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded