diff --git a/go.mod b/go.mod index a88ce3f73f..c2edbf49c3 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/spyzhov/ajson v0.9.6 github.com/stretchr/testify v1.12.1 go.opentelemetry.io/otel v1.47.0 - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.46.0 + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.47.0 go.opentelemetry.io/otel/metric v1.47.0 go.opentelemetry.io/otel/sdk v1.47.0 go.opentelemetry.io/otel/sdk/metric v1.47.0 @@ -172,7 +172,7 @@ require ( golang.org/x/tools v0.52.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/genproto v0.0.0-20260715232425-e75dac1f907d // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20261005182115-fad411399dd8 // indirect google.golang.org/grpc v1.84.0 // indirect google.golang.org/protobuf v1.36.12 // indirect diff --git a/go.sum b/go.sum index f7c5557151..b43483406f 100644 --- a/go.sum +++ b/go.sum @@ -356,8 +356,8 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 h1:LMuyCAy go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0/go.mod h1:085m8qbm4hgc8rZWGDEa4vmyyo2c3nPxUslYUKUIU04= go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.46.0 h1:qkDYCAFiZXLcs1L4aY+tP2wguQ4kURANqHOQMA2et2s= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.46.0/go.mod h1:tkipS4DRzmpAmvg+Gw4++O1IdDq6TVDnvnYU6cmbQVs= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.47.0 h1:LaLVGJtIzHcvHjVs2OftmKcc+M9mdOqS8vZ1fBD1Yes= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.47.0/go.mod h1:vF6H5sNDuQBJWgSX00iZgbIqk2MZZoVMH0ar5t5bOpw= go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= @@ -456,8 +456,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20260715232425-e75dac1f907d h1:C9v1o0/4quuhOAfmRXA2j+we0PqZIp8traLdeogF3Ms= google.golang.org/genproto v0.0.0-20260715232425-e75dac1f907d/go.mod h1:Wz2wFJntZFmLGo7pLDXZ3wYk5hyc0Mb+SkHhDDXT+lU= -google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= -google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= google.golang.org/genproto/googleapis/rpc v0.0.0-20261005182115-fad411399dd8 h1:0SXBqli5dnuCKMjI/X3FM226zEaEa0GUcSCJtN1vL2o= google.golang.org/genproto/googleapis/rpc v0.0.0-20261005182115-fad411399dd8/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/gen.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/gen.go index df08789be8..34ecb287f2 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/gen.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/gen.go @@ -18,8 +18,8 @@ package internal //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/envconfig.go.tmpl "--data={\"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/envconfig\"}" --out=oconf/envconfig.go //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/envconfig_test.go.tmpl "--data={}" --out=oconf/envconfig_test.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/options.go.tmpl "--data={\"retryImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/retry\"}" --out=oconf/options.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl "--data={\"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/envconfig\"}" --out=oconf/options_test.go +//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/options.go.tmpl "--data={\"isHTTP\": false, \"retryImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/retry\"}" --out=oconf/options.go +//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl "--data={\"isHTTP\": false, \"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/envconfig\"}" --out=oconf/options_test.go //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/optiontypes.go.tmpl "--data={}" --out=oconf/optiontypes.go //go:generate gotmpl --body=../../../../../internal/shared/otlp/otlpmetric/oconf/tls.go.tmpl "--data={}" --out=oconf/tls.go diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig.go index 700dc0d1c6..d79217e02b 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig.go @@ -121,11 +121,22 @@ func withEndpointForGRPC(u *url.URL) func(cfg Config) Config { return func(cfg Config) Config { // For OTLP/gRPC endpoints, this is the target to which the // exporter is going to send telemetry. - cfg.Metrics.Endpoint = path.Join(u.Host, u.Path) + cfg.Metrics.Endpoint = grpcEndpoint(u) return cfg } } +func grpcEndpoint(u *url.URL) string { + switch strings.ToLower(u.Scheme) { + case "http", "https": + return u.Host + case "": + return path.Join(u.Host, u.Path) + default: + return u.String() + } +} + // WithEnvCompression retrieves the specified config and passes it to ConfigFn as a Compression. func WithEnvCompression(n string, fn func(Compression)) func(e *envconfig.EnvOptionsReader) { return func(e *envconfig.EnvOptionsReader) { @@ -142,7 +153,7 @@ func WithEnvCompression(n string, fn func(Compression)) func(e *envconfig.EnvOpt func withEndpointScheme(u *url.URL) GenericOption { switch strings.ToLower(u.Scheme) { - case "http", "unix": + case "http", "unix", "unix-abstract": return WithInsecure() default: return WithSecure() diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/options.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/options.go index 4b4f164e1b..95c232ba7b 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/options.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/options.go @@ -51,6 +51,7 @@ type ( // This type is compatible with `http.Transport.Proxy` and can be used to set a custom proxy function to the OTLP HTTP client. HTTPTransportProxyFunc func(*http.Request) (*url.URL, error) + // SignalConfig holds the configuration for exporting a single signal. SignalConfig struct { Endpoint string Insecure bool @@ -72,6 +73,7 @@ type ( HTTPClient *http.Client } + // Config holds the configuration for an otlpmetric exporter. Config struct { // Signal specific configurations Metrics SignalConfig @@ -144,30 +146,36 @@ func NewGRPCConfig(opts ...GRPCOption) Config { cfg = opt.ApplyGRPCOption(cfg) } + // dialOptsPrefix holds the internally computed defaults. It is prepended + // to cfg.DialOptions so that a raw grpc.DialOption supplied via WithDialOption + // always takes precedence: grpc.DialOption values are opaque closures, so this code has no way to + // detect a conflicting user-supplied option and defer to it instead. + var dialOptsPrefix []grpc.DialOption if cfg.ServiceConfig != "" { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) } // Prioritize GRPCCredentials over Insecure (passing both is an error). if cfg.Metrics.GRPCCredentials != nil { //nolint:gocritic // if-else is clearer than switch - cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(cfg.Metrics.GRPCCredentials)) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithTransportCredentials(cfg.Metrics.GRPCCredentials)) } else if cfg.Metrics.Insecure { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(insecure.NewCredentials())) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithTransportCredentials(insecure.NewCredentials())) } else { // Default to using the host's root CA. creds := credentials.NewTLS(nil) cfg.Metrics.GRPCCredentials = creds - cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(creds)) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithTransportCredentials(creds)) } if cfg.Metrics.Compression == GzipCompression { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) } if cfg.ReconnectionPeriod != 0 { p := grpc.ConnectParams{ Backoff: backoff.DefaultConfig, MinConnectTimeout: cfg.ReconnectionPeriod, } - cfg.DialOptions = append(cfg.DialOptions, grpc.WithConnectParams(p)) + dialOptsPrefix = append(dialOptsPrefix, grpc.WithConnectParams(p)) } + cfg.DialOptions = append(dialOptsPrefix, cfg.DialOptions...) return cfg } @@ -257,6 +265,7 @@ func (h *httpOption) ApplyHTTPOption(cfg Config) Config { func (httpOption) private() {} +// NewHTTPOption creates an option that is only applied to the HTTP driver. func NewHTTPOption(fn func(cfg Config) Config) HTTPOption { return &httpOption{fn: fn} } @@ -272,12 +281,16 @@ func (h *grpcOption) ApplyGRPCOption(cfg Config) Config { func (grpcOption) private() {} +// NewGRPCOption creates an option that is only applied to the gRPC driver. func NewGRPCOption(fn func(cfg Config) Config) GRPCOption { return &grpcOption{fn: fn} } // Generic Options +// WithEndpoint configures the metrics host and port only; endpoint should +// resemble "example.com" or "localhost:4317". To configure the scheme and +// path, use WithEndpointURL. func WithEndpoint(endpoint string) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.Endpoint = endpoint @@ -285,6 +298,8 @@ func WithEndpoint(endpoint string) GenericOption { }) } +// WithEndpointURL configures the metrics scheme, host, port, and path; the +// provided value should resemble "https://example.com:4318/v1/metrics". func WithEndpointURL(v string) GenericOption { return newGenericOption(func(cfg Config) Config { u, err := url.Parse(v) @@ -306,6 +321,7 @@ func WithEndpointURL(v string) GenericOption { }) } +// WithCompression configures the compression used for exports. func WithCompression(compression Compression) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.Compression = compression @@ -313,6 +329,7 @@ func WithCompression(compression Compression) GenericOption { }) } +// WithURLPath configures the URL path the exporter sends requests to. func WithURLPath(urlPath string) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.URLPath = urlPath @@ -320,6 +337,7 @@ func WithURLPath(urlPath string) GenericOption { }) } +// WithRetry configures the retry policy used on failed exports. func WithRetry(rc retry.Config) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.RetryConfig = rc @@ -327,6 +345,8 @@ func WithRetry(rc retry.Config) GenericOption { }) } +// WithTLSClientConfig configures the TLS configuration used by the +// exporter's client. func WithTLSClientConfig(tlsCfg *tls.Config) GenericOption { return newSplitOption(func(cfg Config) Config { cfg.Metrics.TLSCfg = tlsCfg.Clone() @@ -337,6 +357,8 @@ func WithTLSClientConfig(tlsCfg *tls.Config) GenericOption { }) } +// WithInsecure disables client transport security for the exporter's +// connection. func WithInsecure() GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.Insecure = true @@ -344,6 +366,8 @@ func WithInsecure() GenericOption { }) } +// WithSecure enables client transport security for the exporter's +// connection. func WithSecure() GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.Insecure = false @@ -351,6 +375,7 @@ func WithSecure() GenericOption { }) } +// WithHeaders configures headers sent with every export request. func WithHeaders(headers map[string]string) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.Headers = headers @@ -358,6 +383,8 @@ func WithHeaders(headers map[string]string) GenericOption { }) } +// WithTimeout configures the max waiting time for the backend to process +// each export batch. func WithTimeout(duration time.Duration) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.Timeout = duration @@ -365,6 +392,8 @@ func WithTimeout(duration time.Duration) GenericOption { }) } +// WithMaxRequestSize configures the maximum size, in bytes, of a serialized +// export request, before compression. func WithMaxRequestSize(size int) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.MaxRequestSize = size @@ -372,6 +401,8 @@ func WithMaxRequestSize(size int) GenericOption { }) } +// WithTemporalitySelector configures the TemporalitySelector used to +// determine the temporality of exported metrics. func WithTemporalitySelector(selector metric.TemporalitySelector) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.TemporalitySelector = selector @@ -379,6 +410,8 @@ func WithTemporalitySelector(selector metric.TemporalitySelector) GenericOption }) } +// WithAggregationSelector configures the AggregationSelector used to +// determine the aggregation of exported metrics. func WithAggregationSelector(selector metric.AggregationSelector) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.AggregationSelector = selector @@ -386,6 +419,8 @@ func WithAggregationSelector(selector metric.AggregationSelector) GenericOption }) } +// WithProxy configures the proxy function used by the exporter's HTTP +// client. func WithProxy(pf HTTPTransportProxyFunc) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.Proxy = pf @@ -393,6 +428,7 @@ func WithProxy(pf HTTPTransportProxyFunc) GenericOption { }) } +// WithHTTPClient configures the HTTP client used to make requests. func WithHTTPClient(c *http.Client) GenericOption { return newGenericOption(func(cfg Config) Config { cfg.Metrics.HTTPClient = c diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/transform/metricdata.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/transform/metricdata.go index 6c07896a83..a72d899006 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/transform/metricdata.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/transform/metricdata.go @@ -235,6 +235,7 @@ func ExponentialHistogramDataPoints[N int64 | float64]( Sum: &sum, Scale: dPt.Scale, ZeroCount: dPt.ZeroCount, + ZeroThreshold: dPt.ZeroThreshold, Exemplars: Exemplars(dPt.Exemplars), Positive: ExponentialHistogramDataPointBuckets(dPt.PositiveBucket), diff --git a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/version.go b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/version.go index 143faa6366..c8c954a004 100644 --- a/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/version.go +++ b/vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/version.go @@ -5,5 +5,5 @@ package otlpmetricgrpc // Version is the current release version of the OpenTelemetry OTLP over gRPC metrics exporter in use. func Version() string { - return "1.46.0" + return "1.47.0" } diff --git a/vendor/modules.txt b/vendor/modules.txt index d0a9b92bf1..809ed6cca7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -552,8 +552,8 @@ go.opentelemetry.io/otel/semconv/v1.43.0 go.opentelemetry.io/otel/semconv/v1.43.0/httpconv go.opentelemetry.io/otel/semconv/v1.43.0/otelconv go.opentelemetry.io/otel/semconv/v1.43.0/rpcconv -# go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.46.0 -## explicit; go 1.25.0 +# go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.47.0 +## explicit; go 1.26.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/counter @@ -751,8 +751,8 @@ google.golang.org/genproto/googleapis/logging/type google.golang.org/genproto/googleapis/type/calendarperiod google.golang.org/genproto/googleapis/type/expr google.golang.org/genproto/googleapis/type/timeofday -# google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 -## explicit; go 1.25.0 +# google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc +## explicit; go 1.26.0 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/distribution