mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 04:52:24 -05:00
[chore] update dependencies (#4196)
- go.opentelemetry.io/contrib/exporters/autoexport v0.60.0 -> v0.61.0 - go.opentelemetry.io/contrib/instrumentation/runtime v0.60.0 -> v0.61.0 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4196 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
311d9a1697
commit
143febb318
152 changed files with 2635 additions and 1688 deletions
2
vendor/go.opentelemetry.io/contrib/bridges/prometheus/BENCHMARKS.md
generated
vendored
2
vendor/go.opentelemetry.io/contrib/bridges/prometheus/BENCHMARKS.md
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
## Summary
|
||||
# Prometheus Benchmarks
|
||||
|
||||
Using the Prometheus bridge and the OTLP exporter adds roughly ~50% to the CPU and memory overhead of an application compared to serving a Prometheus HTTP endpoint for metrics.
|
||||
|
||||
|
|
|
|||
9
vendor/go.opentelemetry.io/contrib/instrumentation/runtime/version.go
generated
vendored
9
vendor/go.opentelemetry.io/contrib/instrumentation/runtime/version.go
generated
vendored
|
|
@ -5,13 +5,6 @@ package runtime // import "go.opentelemetry.io/contrib/instrumentation/runtime"
|
|||
|
||||
// Version is the current release version of the runtime instrumentation.
|
||||
func Version() string {
|
||||
return "0.60.0"
|
||||
return "0.61.0"
|
||||
// This string is updated by the pre_release.sh script during release
|
||||
}
|
||||
|
||||
// SemVersion is the semantic version to be supplied to tracer/meter creation.
|
||||
//
|
||||
// Deprecated: Use [Version] instead.
|
||||
func SemVersion() string {
|
||||
return Version()
|
||||
}
|
||||
|
|
|
|||
33
vendor/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/config.go
generated
vendored
33
vendor/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/config.go
generated
vendored
|
|
@ -13,6 +13,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
|
|
@ -359,8 +360,9 @@ func WithTimeout(duration time.Duration) Option {
|
|||
// explicitly returns a backoff time in the response, that time will take
|
||||
// precedence over these settings.
|
||||
//
|
||||
// These settings do not define any network retry strategy. That is entirely
|
||||
// handled by the gRPC ClientConn.
|
||||
// These settings define the retry strategy implemented by the exporter.
|
||||
// These settings do not define any network retry strategy.
|
||||
// That is handled by the gRPC ClientConn.
|
||||
//
|
||||
// If unset, the default retry policy will be used. It will retry the export
|
||||
// 5 seconds after receiving a retryable error and increase exponentially
|
||||
|
|
@ -442,13 +444,15 @@ func convHeaders(s string) (map[string]string, error) {
|
|||
continue
|
||||
}
|
||||
|
||||
escKey, e := url.PathUnescape(rawKey)
|
||||
if e != nil {
|
||||
key := strings.TrimSpace(rawKey)
|
||||
|
||||
// Validate the key.
|
||||
if !isValidHeaderKey(key) {
|
||||
err = errors.Join(err, fmt.Errorf("invalid header key: %s", rawKey))
|
||||
continue
|
||||
}
|
||||
key := strings.TrimSpace(escKey)
|
||||
|
||||
// Only decode the value.
|
||||
escVal, e := url.PathUnescape(rawVal)
|
||||
if e != nil {
|
||||
err = errors.Join(err, fmt.Errorf("invalid header value: %s", rawVal))
|
||||
|
|
@ -651,3 +655,22 @@ func fallback[T any](val T) resolver[T] {
|
|||
return s
|
||||
}
|
||||
}
|
||||
|
||||
func isValidHeaderKey(key string) bool {
|
||||
if key == "" {
|
||||
return false
|
||||
}
|
||||
for _, c := range key {
|
||||
if !isTokenChar(c) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func isTokenChar(c rune) bool {
|
||||
return c <= unicode.MaxASCII && (unicode.IsLetter(c) ||
|
||||
unicode.IsDigit(c) ||
|
||||
c == '!' || c == '#' || c == '$' || c == '%' || c == '&' || c == '\'' || c == '*' ||
|
||||
c == '+' || c == '-' || c == '.' || c == '^' || c == '_' || c == '`' || c == '|' || c == '~')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/retry/retry.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -14,7 +14,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/cenkalti/backoff/v5"
|
||||
)
|
||||
|
||||
// DefaultConfig are the recommended defaults to use.
|
||||
|
|
@ -77,12 +77,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
RandomizationFactor: backoff.DefaultRandomizationFactor,
|
||||
Multiplier: backoff.DefaultMultiplier,
|
||||
MaxInterval: c.MaxInterval,
|
||||
MaxElapsedTime: c.MaxElapsedTime,
|
||||
Stop: backoff.Stop,
|
||||
Clock: backoff.SystemClock,
|
||||
}
|
||||
b.Reset()
|
||||
|
||||
maxElapsedTime := c.MaxElapsedTime
|
||||
startTime := time.Now()
|
||||
|
||||
for {
|
||||
err := fn(ctx)
|
||||
if err == nil {
|
||||
|
|
@ -94,21 +94,17 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
return err
|
||||
}
|
||||
|
||||
bOff := b.NextBackOff()
|
||||
if bOff == backoff.Stop {
|
||||
if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time elapsed: %w", err)
|
||||
}
|
||||
|
||||
// Wait for the greater of the backoff or throttle delay.
|
||||
var delay time.Duration
|
||||
if bOff > throttle {
|
||||
delay = bOff
|
||||
} else {
|
||||
elapsed := b.GetElapsedTime()
|
||||
if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
delay = throttle
|
||||
bOff := b.NextBackOff()
|
||||
delay := max(throttle, bOff)
|
||||
|
||||
elapsed := time.Since(startTime)
|
||||
if maxElapsedTime != 0 && elapsed+throttle > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
|
||||
if ctxErr := waitFunc(ctx, delay); ctxErr != nil {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlplog/transform/log.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -257,7 +257,7 @@ func stringSliceValues(vals []string) []*cpb.AnyValue {
|
|||
return converted
|
||||
}
|
||||
|
||||
// Attrs transforms a slice of [api.KeyValue] into OTLP key-values.
|
||||
// LogAttrs transforms a slice of [api.KeyValue] into OTLP key-values.
|
||||
func LogAttrs(attrs []api.KeyValue) []*cpb.KeyValue {
|
||||
if len(attrs) == 0 {
|
||||
return nil
|
||||
|
|
|
|||
2
vendor/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/version.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc/version.go
generated
vendored
|
|
@ -5,5 +5,5 @@ package otlploggrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlplog/o
|
|||
|
||||
// Version is the current release version of the OpenTelemetry OTLP over gRPC logs exporter in use.
|
||||
func Version() string {
|
||||
return "0.11.0"
|
||||
return "0.12.2"
|
||||
}
|
||||
|
|
|
|||
29
vendor/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp/client.go
generated
vendored
29
vendor/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp/client.go
generated
vendored
|
|
@ -44,20 +44,23 @@ func newNoopClient() *client {
|
|||
|
||||
// newHTTPClient creates a new HTTP log client.
|
||||
func newHTTPClient(cfg config) (*client, error) {
|
||||
hc := &http.Client{
|
||||
Transport: ourTransport,
|
||||
Timeout: cfg.timeout.Value,
|
||||
}
|
||||
|
||||
if cfg.tlsCfg.Value != nil || cfg.proxy.Value != nil {
|
||||
clonedTransport := ourTransport.Clone()
|
||||
hc.Transport = clonedTransport
|
||||
|
||||
if cfg.tlsCfg.Value != nil {
|
||||
clonedTransport.TLSClientConfig = cfg.tlsCfg.Value
|
||||
hc := cfg.httpClient
|
||||
if hc == nil {
|
||||
hc = &http.Client{
|
||||
Transport: ourTransport,
|
||||
Timeout: cfg.timeout.Value,
|
||||
}
|
||||
if cfg.proxy.Value != nil {
|
||||
clonedTransport.Proxy = cfg.proxy.Value
|
||||
|
||||
if cfg.tlsCfg.Value != nil || cfg.proxy.Value != nil {
|
||||
clonedTransport := ourTransport.Clone()
|
||||
hc.Transport = clonedTransport
|
||||
|
||||
if cfg.tlsCfg.Value != nil {
|
||||
clonedTransport.TLSClientConfig = cfg.tlsCfg.Value
|
||||
}
|
||||
if cfg.proxy.Value != nil {
|
||||
clonedTransport.Proxy = cfg.proxy.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
48
vendor/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp/config.go
generated
vendored
48
vendor/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp/config.go
generated
vendored
|
|
@ -14,6 +14,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp/internal/retry"
|
||||
|
|
@ -94,6 +95,7 @@ type config struct {
|
|||
timeout setting[time.Duration]
|
||||
proxy setting[HTTPTransportProxyFunc]
|
||||
retryCfg setting[retry.Config]
|
||||
httpClient *http.Client
|
||||
}
|
||||
|
||||
func newConfig(options []Option) config {
|
||||
|
|
@ -343,6 +345,25 @@ func WithProxy(pf HTTPTransportProxyFunc) Option {
|
|||
})
|
||||
}
|
||||
|
||||
// WithHTTPClient sets the HTTP client to used by the exporter.
|
||||
//
|
||||
// This option will take precedence over [WithProxy], [WithTimeout],
|
||||
// [WithTLSClientConfig] options as well as OTEL_EXPORTER_OTLP_CERTIFICATE,
|
||||
// OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE, OTEL_EXPORTER_OTLP_TIMEOUT,
|
||||
// OTEL_EXPORTER_OTLP_LOGS_TIMEOUT environment variables.
|
||||
//
|
||||
// Timeout and all other fields of the passed [http.Client] are left intact.
|
||||
//
|
||||
// Be aware that passing an HTTP client with transport like
|
||||
// [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.NewTransport] can
|
||||
// cause the client to be instrumented twice and cause infinite recursion.
|
||||
func WithHTTPClient(c *http.Client) Option {
|
||||
return fnOpt(func(cfg config) config {
|
||||
cfg.httpClient = c
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
||||
// setting is a configuration setting value.
|
||||
type setting[T any] struct {
|
||||
Value T
|
||||
|
|
@ -544,13 +565,15 @@ func convHeaders(s string) (map[string]string, error) {
|
|||
continue
|
||||
}
|
||||
|
||||
escKey, e := url.PathUnescape(rawKey)
|
||||
if e != nil {
|
||||
key := strings.TrimSpace(rawKey)
|
||||
|
||||
// Validate the key.
|
||||
if !isValidHeaderKey(key) {
|
||||
err = errors.Join(err, fmt.Errorf("invalid header key: %s", rawKey))
|
||||
continue
|
||||
}
|
||||
key := strings.TrimSpace(escKey)
|
||||
|
||||
// Only decode the value.
|
||||
escVal, e := url.PathUnescape(rawVal)
|
||||
if e != nil {
|
||||
err = errors.Join(err, fmt.Errorf("invalid header value: %s", rawVal))
|
||||
|
|
@ -600,3 +623,22 @@ func fallback[T any](val T) resolver[T] {
|
|||
return s
|
||||
}
|
||||
}
|
||||
|
||||
func isValidHeaderKey(key string) bool {
|
||||
if key == "" {
|
||||
return false
|
||||
}
|
||||
for _, c := range key {
|
||||
if !isTokenChar(c) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func isTokenChar(c rune) bool {
|
||||
return c <= unicode.MaxASCII && (unicode.IsLetter(c) ||
|
||||
unicode.IsDigit(c) ||
|
||||
c == '!' || c == '#' || c == '$' || c == '%' || c == '&' || c == '\'' || c == '*' ||
|
||||
c == '+' || c == '-' || c == '.' || c == '^' || c == '_' || c == '`' || c == '|' || c == '~')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/retry/retry.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -14,7 +14,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/cenkalti/backoff/v5"
|
||||
)
|
||||
|
||||
// DefaultConfig are the recommended defaults to use.
|
||||
|
|
@ -77,12 +77,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
RandomizationFactor: backoff.DefaultRandomizationFactor,
|
||||
Multiplier: backoff.DefaultMultiplier,
|
||||
MaxInterval: c.MaxInterval,
|
||||
MaxElapsedTime: c.MaxElapsedTime,
|
||||
Stop: backoff.Stop,
|
||||
Clock: backoff.SystemClock,
|
||||
}
|
||||
b.Reset()
|
||||
|
||||
maxElapsedTime := c.MaxElapsedTime
|
||||
startTime := time.Now()
|
||||
|
||||
for {
|
||||
err := fn(ctx)
|
||||
if err == nil {
|
||||
|
|
@ -94,21 +94,17 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
return err
|
||||
}
|
||||
|
||||
bOff := b.NextBackOff()
|
||||
if bOff == backoff.Stop {
|
||||
if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time elapsed: %w", err)
|
||||
}
|
||||
|
||||
// Wait for the greater of the backoff or throttle delay.
|
||||
var delay time.Duration
|
||||
if bOff > throttle {
|
||||
delay = bOff
|
||||
} else {
|
||||
elapsed := b.GetElapsedTime()
|
||||
if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
delay = throttle
|
||||
bOff := b.NextBackOff()
|
||||
delay := max(throttle, bOff)
|
||||
|
||||
elapsed := time.Since(startTime)
|
||||
if maxElapsedTime != 0 && elapsed+throttle > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
|
||||
if ctxErr := waitFunc(ctx, delay); ctxErr != nil {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlplog/transform/log.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -257,7 +257,7 @@ func stringSliceValues(vals []string) []*cpb.AnyValue {
|
|||
return converted
|
||||
}
|
||||
|
||||
// Attrs transforms a slice of [api.KeyValue] into OTLP key-values.
|
||||
// LogAttrs transforms a slice of [api.KeyValue] into OTLP key-values.
|
||||
func LogAttrs(attrs []api.KeyValue) []*cpb.KeyValue {
|
||||
if len(attrs) == 0 {
|
||||
return nil
|
||||
|
|
|
|||
2
vendor/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp/version.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp/version.go
generated
vendored
|
|
@ -5,5 +5,5 @@ package otlploghttp // import "go.opentelemetry.io/otel/exporters/otlp/otlplog/o
|
|||
|
||||
// Version is the current release version of the OpenTelemetry OTLP over HTTP/protobuf logs exporter in use.
|
||||
func Version() string {
|
||||
return "0.11.0"
|
||||
return "0.12.2"
|
||||
}
|
||||
|
|
|
|||
5
vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/config.go
generated
vendored
5
vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/config.go
generated
vendored
|
|
@ -238,8 +238,9 @@ func WithTimeout(duration time.Duration) Option {
|
|||
// explicitly returns a backoff time in the response, that time will take
|
||||
// precedence over these settings.
|
||||
//
|
||||
// These settings do not define any network retry strategy. That is entirely
|
||||
// handled by the gRPC ClientConn.
|
||||
// These settings define the retry strategy implemented by the exporter.
|
||||
// These settings do not define any network retry strategy.
|
||||
// That is handled by the gRPC ClientConn.
|
||||
//
|
||||
// If unset, the default retry policy will be used. It will retry the export
|
||||
// 5 seconds after receiving a retryable error and increase exponentially
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/envconfig/envconfig.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package envconfig provides functionality to parse configuration from
|
||||
// environment variables.
|
||||
package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/envconfig"
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package internal provides internal functionally for the otlpmetricgrpc package.
|
||||
package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal"
|
||||
|
||||
//go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess.go.tmpl "--data={}" --out=partialsuccess.go
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/oconf/envconfig.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -80,8 +80,16 @@ func getOptionsFromEnv() []GenericOption {
|
|||
}),
|
||||
envconfig.WithCertPool("CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }),
|
||||
envconfig.WithCertPool("METRICS_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("METRICS_CLIENT_CERTIFICATE", "METRICS_CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }),
|
||||
envconfig.WithClientCert(
|
||||
"CLIENT_CERTIFICATE",
|
||||
"CLIENT_KEY",
|
||||
func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} },
|
||||
),
|
||||
envconfig.WithClientCert(
|
||||
"METRICS_CLIENT_CERTIFICATE",
|
||||
"METRICS_CLIENT_KEY",
|
||||
func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} },
|
||||
),
|
||||
envconfig.WithBool("INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }),
|
||||
envconfig.WithBool("METRICS_INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }),
|
||||
withTLSConfig(tlsConf, func(c *tls.Config) { opts = append(opts, WithTLSClientConfig(c)) }),
|
||||
|
|
@ -91,8 +99,14 @@ func getOptionsFromEnv() []GenericOption {
|
|||
WithEnvCompression("METRICS_COMPRESSION", func(c Compression) { opts = append(opts, WithCompression(c)) }),
|
||||
envconfig.WithDuration("TIMEOUT", func(d time.Duration) { opts = append(opts, WithTimeout(d)) }),
|
||||
envconfig.WithDuration("METRICS_TIMEOUT", func(d time.Duration) { opts = append(opts, WithTimeout(d)) }),
|
||||
withEnvTemporalityPreference("METRICS_TEMPORALITY_PREFERENCE", func(t metric.TemporalitySelector) { opts = append(opts, WithTemporalitySelector(t)) }),
|
||||
withEnvAggPreference("METRICS_DEFAULT_HISTOGRAM_AGGREGATION", func(a metric.AggregationSelector) { opts = append(opts, WithAggregationSelector(a)) }),
|
||||
withEnvTemporalityPreference(
|
||||
"METRICS_TEMPORALITY_PREFERENCE",
|
||||
func(t metric.TemporalitySelector) { opts = append(opts, WithTemporalitySelector(t)) },
|
||||
),
|
||||
withEnvAggPreference(
|
||||
"METRICS_DEFAULT_HISTOGRAM_AGGREGATION",
|
||||
func(a metric.AggregationSelector) { opts = append(opts, WithAggregationSelector(a)) },
|
||||
),
|
||||
)
|
||||
|
||||
return opts
|
||||
|
|
@ -157,7 +171,11 @@ func withEnvTemporalityPreference(n string, fn func(metric.TemporalitySelector))
|
|||
case "lowmemory":
|
||||
fn(lowMemory)
|
||||
default:
|
||||
global.Warn("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to an invalid value, ignoring.", "value", s)
|
||||
global.Warn(
|
||||
"OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to an invalid value, ignoring.",
|
||||
"value",
|
||||
s,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -203,7 +221,11 @@ func withEnvAggPreference(n string, fn func(metric.AggregationSelector)) func(e
|
|||
return metric.DefaultAggregationSelector(kind)
|
||||
})
|
||||
default:
|
||||
global.Warn("OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION is set to an invalid value, ignoring.", "value", s)
|
||||
global.Warn(
|
||||
"OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION is set to an invalid value, ignoring.",
|
||||
"value",
|
||||
s,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/oconf/options.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package oconf provides configuration for the otlpmetric exporters.
|
||||
package oconf // import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf"
|
||||
|
||||
import (
|
||||
|
|
@ -56,13 +57,15 @@ type (
|
|||
Timeout time.Duration
|
||||
URLPath string
|
||||
|
||||
// gRPC configurations
|
||||
GRPCCredentials credentials.TransportCredentials
|
||||
|
||||
TemporalitySelector metric.TemporalitySelector
|
||||
AggregationSelector metric.AggregationSelector
|
||||
|
||||
Proxy HTTPTransportProxyFunc
|
||||
// gRPC configurations
|
||||
GRPCCredentials credentials.TransportCredentials
|
||||
|
||||
// HTTP configurations
|
||||
Proxy HTTPTransportProxyFunc
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
Config struct {
|
||||
|
|
@ -372,3 +375,10 @@ func WithProxy(pf HTTPTransportProxyFunc) GenericOption {
|
|||
return cfg
|
||||
})
|
||||
}
|
||||
|
||||
func WithHTTPClient(c *http.Client) GenericOption {
|
||||
return newGenericOption(func(cfg Config) Config {
|
||||
cfg.Metrics.HTTPClient = c
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/oconf/optiontypes.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/oconf/tls.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/partialsuccess.go
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/retry/retry.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -14,7 +14,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/cenkalti/backoff/v5"
|
||||
)
|
||||
|
||||
// DefaultConfig are the recommended defaults to use.
|
||||
|
|
@ -77,12 +77,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
RandomizationFactor: backoff.DefaultRandomizationFactor,
|
||||
Multiplier: backoff.DefaultMultiplier,
|
||||
MaxInterval: c.MaxInterval,
|
||||
MaxElapsedTime: c.MaxElapsedTime,
|
||||
Stop: backoff.Stop,
|
||||
Clock: backoff.SystemClock,
|
||||
}
|
||||
b.Reset()
|
||||
|
||||
maxElapsedTime := c.MaxElapsedTime
|
||||
startTime := time.Now()
|
||||
|
||||
for {
|
||||
err := fn(ctx)
|
||||
if err == nil {
|
||||
|
|
@ -94,21 +94,17 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
return err
|
||||
}
|
||||
|
||||
bOff := b.NextBackOff()
|
||||
if bOff == backoff.Stop {
|
||||
if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time elapsed: %w", err)
|
||||
}
|
||||
|
||||
// Wait for the greater of the backoff or throttle delay.
|
||||
var delay time.Duration
|
||||
if bOff > throttle {
|
||||
delay = bOff
|
||||
} else {
|
||||
elapsed := b.GetElapsedTime()
|
||||
if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
delay = throttle
|
||||
bOff := b.NextBackOff()
|
||||
delay := max(throttle, bOff)
|
||||
|
||||
elapsed := time.Since(startTime)
|
||||
if maxElapsedTime != 0 && elapsed+throttle > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
|
||||
if ctxErr := waitFunc(ctx, delay); ctxErr != nil {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/transform/attribute.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/transform/error.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/transform/metricdata.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -203,7 +203,9 @@ func HistogramDataPoints[N int64 | float64](dPts []metricdata.HistogramDataPoint
|
|||
|
||||
// ExponentialHistogram returns an OTLP Metric_ExponentialHistogram generated from h. An error is
|
||||
// returned if the temporality of h is unknown.
|
||||
func ExponentialHistogram[N int64 | float64](h metricdata.ExponentialHistogram[N]) (*mpb.Metric_ExponentialHistogram, error) {
|
||||
func ExponentialHistogram[N int64 | float64](
|
||||
h metricdata.ExponentialHistogram[N],
|
||||
) (*mpb.Metric_ExponentialHistogram, error) {
|
||||
t, err := Temporality(h.Temporality)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -218,7 +220,9 @@ func ExponentialHistogram[N int64 | float64](h metricdata.ExponentialHistogram[N
|
|||
|
||||
// ExponentialHistogramDataPoints returns a slice of OTLP ExponentialHistogramDataPoint generated
|
||||
// from dPts.
|
||||
func ExponentialHistogramDataPoints[N int64 | float64](dPts []metricdata.ExponentialHistogramDataPoint[N]) []*mpb.ExponentialHistogramDataPoint {
|
||||
func ExponentialHistogramDataPoints[N int64 | float64](
|
||||
dPts []metricdata.ExponentialHistogramDataPoint[N],
|
||||
) []*mpb.ExponentialHistogramDataPoint {
|
||||
out := make([]*mpb.ExponentialHistogramDataPoint, 0, len(dPts))
|
||||
for _, dPt := range dPts {
|
||||
sum := float64(dPt.Sum)
|
||||
|
|
@ -250,7 +254,9 @@ func ExponentialHistogramDataPoints[N int64 | float64](dPts []metricdata.Exponen
|
|||
|
||||
// ExponentialHistogramDataPointBuckets returns an OTLP ExponentialHistogramDataPoint_Buckets generated
|
||||
// from bucket.
|
||||
func ExponentialHistogramDataPointBuckets(bucket metricdata.ExponentialBucket) *mpb.ExponentialHistogramDataPoint_Buckets {
|
||||
func ExponentialHistogramDataPointBuckets(
|
||||
bucket metricdata.ExponentialBucket,
|
||||
) *mpb.ExponentialHistogramDataPoint_Buckets {
|
||||
return &mpb.ExponentialHistogramDataPoint_Buckets{
|
||||
Offset: bucket.Offset,
|
||||
BucketCounts: bucket.Counts,
|
||||
|
|
|
|||
2
vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/version.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc/version.go
generated
vendored
|
|
@ -5,5 +5,5 @@ package otlpmetricgrpc // import "go.opentelemetry.io/otel/exporters/otlp/otlpme
|
|||
|
||||
// Version is the current release version of the OpenTelemetry OTLP over gRPC metrics exporter in use.
|
||||
func Version() string {
|
||||
return "1.35.0"
|
||||
return "1.36.0"
|
||||
}
|
||||
|
|
|
|||
31
vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/client.go
generated
vendored
31
vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/client.go
generated
vendored
|
|
@ -55,20 +55,23 @@ var ourTransport = &http.Transport{
|
|||
|
||||
// newClient creates a new HTTP metric client.
|
||||
func newClient(cfg oconf.Config) (*client, error) {
|
||||
httpClient := &http.Client{
|
||||
Transport: ourTransport,
|
||||
Timeout: cfg.Metrics.Timeout,
|
||||
}
|
||||
|
||||
if cfg.Metrics.TLSCfg != nil || cfg.Metrics.Proxy != nil {
|
||||
clonedTransport := ourTransport.Clone()
|
||||
httpClient.Transport = clonedTransport
|
||||
|
||||
if cfg.Metrics.TLSCfg != nil {
|
||||
clonedTransport.TLSClientConfig = cfg.Metrics.TLSCfg
|
||||
httpClient := cfg.Metrics.HTTPClient
|
||||
if httpClient == nil {
|
||||
httpClient = &http.Client{
|
||||
Transport: ourTransport,
|
||||
Timeout: cfg.Metrics.Timeout,
|
||||
}
|
||||
if cfg.Metrics.Proxy != nil {
|
||||
clonedTransport.Proxy = cfg.Metrics.Proxy
|
||||
|
||||
if cfg.Metrics.TLSCfg != nil || cfg.Metrics.Proxy != nil {
|
||||
clonedTransport := ourTransport.Clone()
|
||||
httpClient.Transport = clonedTransport
|
||||
|
||||
if cfg.Metrics.TLSCfg != nil {
|
||||
clonedTransport.TLSClientConfig = cfg.Metrics.TLSCfg
|
||||
}
|
||||
if cfg.Metrics.Proxy != nil {
|
||||
clonedTransport.Proxy = cfg.Metrics.Proxy
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -277,7 +280,7 @@ type request struct {
|
|||
// reset reinitializes the request Body and uses ctx for the request.
|
||||
func (r *request) reset(ctx context.Context) {
|
||||
r.Body = r.bodyReader()
|
||||
r.Request = r.Request.WithContext(ctx)
|
||||
r.Request = r.WithContext(ctx)
|
||||
}
|
||||
|
||||
// retryableError represents a request failure that can be retried.
|
||||
|
|
|
|||
16
vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/config.go
generated
vendored
16
vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/config.go
generated
vendored
|
|
@ -222,3 +222,19 @@ func WithAggregationSelector(selector metric.AggregationSelector) Option {
|
|||
func WithProxy(pf HTTPTransportProxyFunc) Option {
|
||||
return wrappedOption{oconf.WithProxy(oconf.HTTPTransportProxyFunc(pf))}
|
||||
}
|
||||
|
||||
// WithHTTPClient sets the HTTP client to used by the exporter.
|
||||
//
|
||||
// This option will take precedence over [WithProxy], [WithTimeout],
|
||||
// [WithTLSClientConfig] options as well as OTEL_EXPORTER_OTLP_CERTIFICATE,
|
||||
// OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE, OTEL_EXPORTER_OTLP_TIMEOUT,
|
||||
// OTEL_EXPORTER_OTLP_METRICS_TIMEOUT environment variables.
|
||||
//
|
||||
// Timeout and all other fields of the passed [http.Client] are left intact.
|
||||
//
|
||||
// Be aware that passing an HTTP client with transport like
|
||||
// [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.NewTransport] can
|
||||
// cause the client to be instrumented twice and cause infinite recursion.
|
||||
func WithHTTPClient(c *http.Client) Option {
|
||||
return wrappedOption{oconf.WithHTTPClient(c)}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/envconfig/envconfig.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package envconfig provides functionality to parse configuration from
|
||||
// environment variables.
|
||||
package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/envconfig"
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package internal provides internal functionally for the otlpmetrichttp package.
|
||||
package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal"
|
||||
|
||||
//go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess.go.tmpl "--data={}" --out=partialsuccess.go
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/oconf/envconfig.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -80,8 +80,16 @@ func getOptionsFromEnv() []GenericOption {
|
|||
}),
|
||||
envconfig.WithCertPool("CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }),
|
||||
envconfig.WithCertPool("METRICS_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("METRICS_CLIENT_CERTIFICATE", "METRICS_CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }),
|
||||
envconfig.WithClientCert(
|
||||
"CLIENT_CERTIFICATE",
|
||||
"CLIENT_KEY",
|
||||
func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} },
|
||||
),
|
||||
envconfig.WithClientCert(
|
||||
"METRICS_CLIENT_CERTIFICATE",
|
||||
"METRICS_CLIENT_KEY",
|
||||
func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} },
|
||||
),
|
||||
envconfig.WithBool("INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }),
|
||||
envconfig.WithBool("METRICS_INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }),
|
||||
withTLSConfig(tlsConf, func(c *tls.Config) { opts = append(opts, WithTLSClientConfig(c)) }),
|
||||
|
|
@ -91,8 +99,14 @@ func getOptionsFromEnv() []GenericOption {
|
|||
WithEnvCompression("METRICS_COMPRESSION", func(c Compression) { opts = append(opts, WithCompression(c)) }),
|
||||
envconfig.WithDuration("TIMEOUT", func(d time.Duration) { opts = append(opts, WithTimeout(d)) }),
|
||||
envconfig.WithDuration("METRICS_TIMEOUT", func(d time.Duration) { opts = append(opts, WithTimeout(d)) }),
|
||||
withEnvTemporalityPreference("METRICS_TEMPORALITY_PREFERENCE", func(t metric.TemporalitySelector) { opts = append(opts, WithTemporalitySelector(t)) }),
|
||||
withEnvAggPreference("METRICS_DEFAULT_HISTOGRAM_AGGREGATION", func(a metric.AggregationSelector) { opts = append(opts, WithAggregationSelector(a)) }),
|
||||
withEnvTemporalityPreference(
|
||||
"METRICS_TEMPORALITY_PREFERENCE",
|
||||
func(t metric.TemporalitySelector) { opts = append(opts, WithTemporalitySelector(t)) },
|
||||
),
|
||||
withEnvAggPreference(
|
||||
"METRICS_DEFAULT_HISTOGRAM_AGGREGATION",
|
||||
func(a metric.AggregationSelector) { opts = append(opts, WithAggregationSelector(a)) },
|
||||
),
|
||||
)
|
||||
|
||||
return opts
|
||||
|
|
@ -157,7 +171,11 @@ func withEnvTemporalityPreference(n string, fn func(metric.TemporalitySelector))
|
|||
case "lowmemory":
|
||||
fn(lowMemory)
|
||||
default:
|
||||
global.Warn("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to an invalid value, ignoring.", "value", s)
|
||||
global.Warn(
|
||||
"OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to an invalid value, ignoring.",
|
||||
"value",
|
||||
s,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -203,7 +221,11 @@ func withEnvAggPreference(n string, fn func(metric.AggregationSelector)) func(e
|
|||
return metric.DefaultAggregationSelector(kind)
|
||||
})
|
||||
default:
|
||||
global.Warn("OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION is set to an invalid value, ignoring.", "value", s)
|
||||
global.Warn(
|
||||
"OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION is set to an invalid value, ignoring.",
|
||||
"value",
|
||||
s,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/oconf/options.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package oconf provides configuration for the otlpmetric exporters.
|
||||
package oconf // import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf"
|
||||
|
||||
import (
|
||||
|
|
@ -56,13 +57,15 @@ type (
|
|||
Timeout time.Duration
|
||||
URLPath string
|
||||
|
||||
// gRPC configurations
|
||||
GRPCCredentials credentials.TransportCredentials
|
||||
|
||||
TemporalitySelector metric.TemporalitySelector
|
||||
AggregationSelector metric.AggregationSelector
|
||||
|
||||
Proxy HTTPTransportProxyFunc
|
||||
// gRPC configurations
|
||||
GRPCCredentials credentials.TransportCredentials
|
||||
|
||||
// HTTP configurations
|
||||
Proxy HTTPTransportProxyFunc
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
Config struct {
|
||||
|
|
@ -372,3 +375,10 @@ func WithProxy(pf HTTPTransportProxyFunc) GenericOption {
|
|||
return cfg
|
||||
})
|
||||
}
|
||||
|
||||
func WithHTTPClient(c *http.Client) GenericOption {
|
||||
return newGenericOption(func(cfg Config) Config {
|
||||
cfg.Metrics.HTTPClient = c
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/oconf/optiontypes.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/oconf/tls.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/partialsuccess.go
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/retry/retry.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -14,7 +14,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/cenkalti/backoff/v5"
|
||||
)
|
||||
|
||||
// DefaultConfig are the recommended defaults to use.
|
||||
|
|
@ -77,12 +77,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
RandomizationFactor: backoff.DefaultRandomizationFactor,
|
||||
Multiplier: backoff.DefaultMultiplier,
|
||||
MaxInterval: c.MaxInterval,
|
||||
MaxElapsedTime: c.MaxElapsedTime,
|
||||
Stop: backoff.Stop,
|
||||
Clock: backoff.SystemClock,
|
||||
}
|
||||
b.Reset()
|
||||
|
||||
maxElapsedTime := c.MaxElapsedTime
|
||||
startTime := time.Now()
|
||||
|
||||
for {
|
||||
err := fn(ctx)
|
||||
if err == nil {
|
||||
|
|
@ -94,21 +94,17 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
return err
|
||||
}
|
||||
|
||||
bOff := b.NextBackOff()
|
||||
if bOff == backoff.Stop {
|
||||
if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time elapsed: %w", err)
|
||||
}
|
||||
|
||||
// Wait for the greater of the backoff or throttle delay.
|
||||
var delay time.Duration
|
||||
if bOff > throttle {
|
||||
delay = bOff
|
||||
} else {
|
||||
elapsed := b.GetElapsedTime()
|
||||
if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
delay = throttle
|
||||
bOff := b.NextBackOff()
|
||||
delay := max(throttle, bOff)
|
||||
|
||||
elapsed := time.Since(startTime)
|
||||
if maxElapsedTime != 0 && elapsed+throttle > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
|
||||
if ctxErr := waitFunc(ctx, delay); ctxErr != nil {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/transform/attribute.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/transform/error.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlpmetric/transform/metricdata.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -203,7 +203,9 @@ func HistogramDataPoints[N int64 | float64](dPts []metricdata.HistogramDataPoint
|
|||
|
||||
// ExponentialHistogram returns an OTLP Metric_ExponentialHistogram generated from h. An error is
|
||||
// returned if the temporality of h is unknown.
|
||||
func ExponentialHistogram[N int64 | float64](h metricdata.ExponentialHistogram[N]) (*mpb.Metric_ExponentialHistogram, error) {
|
||||
func ExponentialHistogram[N int64 | float64](
|
||||
h metricdata.ExponentialHistogram[N],
|
||||
) (*mpb.Metric_ExponentialHistogram, error) {
|
||||
t, err := Temporality(h.Temporality)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -218,7 +220,9 @@ func ExponentialHistogram[N int64 | float64](h metricdata.ExponentialHistogram[N
|
|||
|
||||
// ExponentialHistogramDataPoints returns a slice of OTLP ExponentialHistogramDataPoint generated
|
||||
// from dPts.
|
||||
func ExponentialHistogramDataPoints[N int64 | float64](dPts []metricdata.ExponentialHistogramDataPoint[N]) []*mpb.ExponentialHistogramDataPoint {
|
||||
func ExponentialHistogramDataPoints[N int64 | float64](
|
||||
dPts []metricdata.ExponentialHistogramDataPoint[N],
|
||||
) []*mpb.ExponentialHistogramDataPoint {
|
||||
out := make([]*mpb.ExponentialHistogramDataPoint, 0, len(dPts))
|
||||
for _, dPt := range dPts {
|
||||
sum := float64(dPt.Sum)
|
||||
|
|
@ -250,7 +254,9 @@ func ExponentialHistogramDataPoints[N int64 | float64](dPts []metricdata.Exponen
|
|||
|
||||
// ExponentialHistogramDataPointBuckets returns an OTLP ExponentialHistogramDataPoint_Buckets generated
|
||||
// from bucket.
|
||||
func ExponentialHistogramDataPointBuckets(bucket metricdata.ExponentialBucket) *mpb.ExponentialHistogramDataPoint_Buckets {
|
||||
func ExponentialHistogramDataPointBuckets(
|
||||
bucket metricdata.ExponentialBucket,
|
||||
) *mpb.ExponentialHistogramDataPoint_Buckets {
|
||||
return &mpb.ExponentialHistogramDataPoint_Buckets{
|
||||
Offset: bucket.Offset,
|
||||
BucketCounts: bucket.Counts,
|
||||
|
|
|
|||
2
vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/version.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/version.go
generated
vendored
|
|
@ -5,5 +5,5 @@ package otlpmetrichttp // import "go.opentelemetry.io/otel/exporters/otlp/otlpme
|
|||
|
||||
// Version is the current release version of the OpenTelemetry OTLP over HTTP/protobuf metrics exporter in use.
|
||||
func Version() string {
|
||||
return "1.35.0"
|
||||
return "1.36.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package tracetransform provides conversion functionality for the otlptrace
|
||||
// exporters.
|
||||
package tracetransform // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform"
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/envconfig/envconfig.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package envconfig provides functionality to parse configuration from
|
||||
// environment variables.
|
||||
package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig"
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package internal provides internal functionally for the otlptracegrpc package.
|
||||
package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal"
|
||||
|
||||
//go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess.go.tmpl "--data={}" --out=partialsuccess.go
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -77,8 +77,16 @@ func getOptionsFromEnv() []GenericOption {
|
|||
}),
|
||||
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} }),
|
||||
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)) }),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package otlpconfig provides configuration for the otlptrace exporters.
|
||||
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig"
|
||||
|
||||
import (
|
||||
|
|
@ -52,7 +53,9 @@ type (
|
|||
// gRPC configurations
|
||||
GRPCCredentials credentials.TransportCredentials
|
||||
|
||||
Proxy HTTPTransportProxyFunc
|
||||
// HTTP configurations
|
||||
Proxy HTTPTransportProxyFunc
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
Config struct {
|
||||
|
|
@ -349,3 +352,10 @@ func WithProxy(pf HTTPTransportProxyFunc) GenericOption {
|
|||
return cfg
|
||||
})
|
||||
}
|
||||
|
||||
func WithHTTPClient(c *http.Client) GenericOption {
|
||||
return newGenericOption(func(cfg Config) Config {
|
||||
cfg.Traces.HTTPClient = c
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/partialsuccess.go
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/retry/retry.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -14,7 +14,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/cenkalti/backoff/v5"
|
||||
)
|
||||
|
||||
// DefaultConfig are the recommended defaults to use.
|
||||
|
|
@ -77,12 +77,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
RandomizationFactor: backoff.DefaultRandomizationFactor,
|
||||
Multiplier: backoff.DefaultMultiplier,
|
||||
MaxInterval: c.MaxInterval,
|
||||
MaxElapsedTime: c.MaxElapsedTime,
|
||||
Stop: backoff.Stop,
|
||||
Clock: backoff.SystemClock,
|
||||
}
|
||||
b.Reset()
|
||||
|
||||
maxElapsedTime := c.MaxElapsedTime
|
||||
startTime := time.Now()
|
||||
|
||||
for {
|
||||
err := fn(ctx)
|
||||
if err == nil {
|
||||
|
|
@ -94,21 +94,17 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
return err
|
||||
}
|
||||
|
||||
bOff := b.NextBackOff()
|
||||
if bOff == backoff.Stop {
|
||||
if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time elapsed: %w", err)
|
||||
}
|
||||
|
||||
// Wait for the greater of the backoff or throttle delay.
|
||||
var delay time.Duration
|
||||
if bOff > throttle {
|
||||
delay = bOff
|
||||
} else {
|
||||
elapsed := b.GetElapsedTime()
|
||||
if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
delay = throttle
|
||||
bOff := b.NextBackOff()
|
||||
delay := max(throttle, bOff)
|
||||
|
||||
elapsed := time.Since(startTime)
|
||||
if maxElapsedTime != 0 && elapsed+throttle > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
|
||||
if ctxErr := waitFunc(ctx, delay); ctxErr != nil {
|
||||
|
|
|
|||
5
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go
generated
vendored
5
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go
generated
vendored
|
|
@ -199,8 +199,9 @@ func WithTimeout(duration time.Duration) Option {
|
|||
// explicitly returns a backoff time in the response. That time will take
|
||||
// precedence over these settings.
|
||||
//
|
||||
// These settings do not define any network retry strategy. That is entirely
|
||||
// handled by the gRPC ClientConn.
|
||||
// These settings define the retry strategy implemented by the exporter.
|
||||
// These settings do not define any network retry strategy.
|
||||
// That is handled by the gRPC ClientConn.
|
||||
//
|
||||
// If unset, the default retry policy will be used. It will retry the export
|
||||
// 5 seconds after receiving a retryable error and increase exponentially
|
||||
|
|
|
|||
30
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client.go
generated
vendored
30
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client.go
generated
vendored
|
|
@ -71,20 +71,24 @@ var _ otlptrace.Client = (*client)(nil)
|
|||
func NewClient(opts ...Option) otlptrace.Client {
|
||||
cfg := otlpconfig.NewHTTPConfig(asHTTPOptions(opts)...)
|
||||
|
||||
httpClient := &http.Client{
|
||||
Transport: ourTransport,
|
||||
Timeout: cfg.Traces.Timeout,
|
||||
}
|
||||
httpClient := cfg.Traces.HTTPClient
|
||||
|
||||
if cfg.Traces.TLSCfg != nil || cfg.Traces.Proxy != nil {
|
||||
clonedTransport := ourTransport.Clone()
|
||||
httpClient.Transport = clonedTransport
|
||||
|
||||
if cfg.Traces.TLSCfg != nil {
|
||||
clonedTransport.TLSClientConfig = cfg.Traces.TLSCfg
|
||||
if httpClient == nil {
|
||||
httpClient = &http.Client{
|
||||
Transport: ourTransport,
|
||||
Timeout: cfg.Traces.Timeout,
|
||||
}
|
||||
if cfg.Traces.Proxy != nil {
|
||||
clonedTransport.Proxy = cfg.Traces.Proxy
|
||||
|
||||
if cfg.Traces.TLSCfg != nil || cfg.Traces.Proxy != nil {
|
||||
clonedTransport := ourTransport.Clone()
|
||||
httpClient.Transport = clonedTransport
|
||||
|
||||
if cfg.Traces.TLSCfg != nil {
|
||||
clonedTransport.TLSClientConfig = cfg.Traces.TLSCfg
|
||||
}
|
||||
if cfg.Traces.Proxy != nil {
|
||||
clonedTransport.Proxy = cfg.Traces.Proxy
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -300,7 +304,7 @@ type request struct {
|
|||
// reset reinitializes the request Body and uses ctx for the request.
|
||||
func (r *request) reset(ctx context.Context) {
|
||||
r.Body = r.bodyReader()
|
||||
r.Request = r.Request.WithContext(ctx)
|
||||
r.Request = r.WithContext(ctx)
|
||||
}
|
||||
|
||||
// retryableError represents a request failure that can be retried.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/envconfig/envconfig.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package envconfig provides functionality to parse configuration from
|
||||
// environment variables.
|
||||
package envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig"
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package internal provides internal functionally for the otlptracehttp package.
|
||||
package internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal"
|
||||
|
||||
//go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess.go.tmpl "--data={}" --out=partialsuccess.go
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -77,8 +77,16 @@ func getOptionsFromEnv() []GenericOption {
|
|||
}),
|
||||
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} }),
|
||||
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)) }),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package otlpconfig provides configuration for the otlptrace exporters.
|
||||
package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig"
|
||||
|
||||
import (
|
||||
|
|
@ -52,7 +53,9 @@ type (
|
|||
// gRPC configurations
|
||||
GRPCCredentials credentials.TransportCredentials
|
||||
|
||||
Proxy HTTPTransportProxyFunc
|
||||
// HTTP configurations
|
||||
Proxy HTTPTransportProxyFunc
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
Config struct {
|
||||
|
|
@ -349,3 +352,10 @@ func WithProxy(pf HTTPTransportProxyFunc) GenericOption {
|
|||
return cfg
|
||||
})
|
||||
}
|
||||
|
||||
func WithHTTPClient(c *http.Client) GenericOption {
|
||||
return newGenericOption(func(cfg Config) Config {
|
||||
cfg.Traces.HTTPClient = c
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/partialsuccess.go
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code created by gotmpl. DO NOT MODIFY.
|
||||
// Code generated by gotmpl. DO NOT MODIFY.
|
||||
// source: internal/shared/otlp/retry/retry.go.tmpl
|
||||
|
||||
// Copyright The OpenTelemetry Authors
|
||||
|
|
@ -14,7 +14,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/cenkalti/backoff/v5"
|
||||
)
|
||||
|
||||
// DefaultConfig are the recommended defaults to use.
|
||||
|
|
@ -77,12 +77,12 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
RandomizationFactor: backoff.DefaultRandomizationFactor,
|
||||
Multiplier: backoff.DefaultMultiplier,
|
||||
MaxInterval: c.MaxInterval,
|
||||
MaxElapsedTime: c.MaxElapsedTime,
|
||||
Stop: backoff.Stop,
|
||||
Clock: backoff.SystemClock,
|
||||
}
|
||||
b.Reset()
|
||||
|
||||
maxElapsedTime := c.MaxElapsedTime
|
||||
startTime := time.Now()
|
||||
|
||||
for {
|
||||
err := fn(ctx)
|
||||
if err == nil {
|
||||
|
|
@ -94,21 +94,17 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
|
|||
return err
|
||||
}
|
||||
|
||||
bOff := b.NextBackOff()
|
||||
if bOff == backoff.Stop {
|
||||
if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time elapsed: %w", err)
|
||||
}
|
||||
|
||||
// Wait for the greater of the backoff or throttle delay.
|
||||
var delay time.Duration
|
||||
if bOff > throttle {
|
||||
delay = bOff
|
||||
} else {
|
||||
elapsed := b.GetElapsedTime()
|
||||
if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
delay = throttle
|
||||
bOff := b.NextBackOff()
|
||||
delay := max(throttle, bOff)
|
||||
|
||||
elapsed := time.Since(startTime)
|
||||
if maxElapsedTime != 0 && elapsed+throttle > maxElapsedTime {
|
||||
return fmt.Errorf("max retry time would elapse: %w", err)
|
||||
}
|
||||
|
||||
if ctxErr := waitFunc(ctx, delay); ctxErr != nil {
|
||||
|
|
|
|||
16
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go
generated
vendored
16
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/options.go
generated
vendored
|
|
@ -153,3 +153,19 @@ func WithRetry(rc RetryConfig) Option {
|
|||
func WithProxy(pf HTTPTransportProxyFunc) Option {
|
||||
return wrappedOption{otlpconfig.WithProxy(otlpconfig.HTTPTransportProxyFunc(pf))}
|
||||
}
|
||||
|
||||
// WithHTTPClient sets the HTTP client to used by the exporter.
|
||||
//
|
||||
// This option will take precedence over [WithProxy], [WithTimeout],
|
||||
// [WithTLSClientConfig] options as well as OTEL_EXPORTER_OTLP_CERTIFICATE,
|
||||
// OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE, OTEL_EXPORTER_OTLP_TIMEOUT,
|
||||
// OTEL_EXPORTER_OTLP_TRACES_TIMEOUT environment variables.
|
||||
//
|
||||
// Timeout and all other fields of the passed [http.Client] are left intact.
|
||||
//
|
||||
// Be aware that passing an HTTP client with transport like
|
||||
// [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.NewTransport] can
|
||||
// cause the client to be instrumented twice and cause infinite recursion.
|
||||
func WithHTTPClient(c *http.Client) Option {
|
||||
return wrappedOption{otlpconfig.WithHTTPClient(c)}
|
||||
}
|
||||
|
|
|
|||
2
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go
generated
vendored
|
|
@ -5,5 +5,5 @@ package otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
|
|||
|
||||
// Version is the current release version of the OpenTelemetry OTLP trace exporter in use.
|
||||
func Version() string {
|
||||
return "1.35.0"
|
||||
return "1.36.0"
|
||||
}
|
||||
|
|
|
|||
11
vendor/go.opentelemetry.io/otel/exporters/prometheus/config.go
generated
vendored
11
vendor/go.opentelemetry.io/otel/exporters/prometheus/config.go
generated
vendored
|
|
@ -5,11 +5,13 @@ package prometheus // import "go.opentelemetry.io/otel/exporters/prometheus"
|
|||
|
||||
import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/common/model"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/internal/global"
|
||||
"go.opentelemetry.io/otel/sdk/metric"
|
||||
)
|
||||
|
||||
|
|
@ -25,6 +27,12 @@ type config struct {
|
|||
resourceAttributesFilter attribute.Filter
|
||||
}
|
||||
|
||||
var logDeprecatedLegacyScheme = sync.OnceFunc(func() {
|
||||
global.Warn(
|
||||
"prometheus exporter legacy scheme deprecated: support for the legacy NameValidationScheme will be removed in a future release",
|
||||
)
|
||||
})
|
||||
|
||||
// newConfig creates a validated config configured with options.
|
||||
func newConfig(opts ...Option) config {
|
||||
cfg := config{}
|
||||
|
|
@ -132,7 +140,8 @@ func WithoutScopeInfo() Option {
|
|||
// have special behavior based on their name.
|
||||
func WithNamespace(ns string) Option {
|
||||
return optionFunc(func(cfg config) config {
|
||||
if model.NameValidationScheme != model.UTF8Validation {
|
||||
if model.NameValidationScheme != model.UTF8Validation { // nolint:staticcheck // We need this check to keep supporting the legacy scheme.
|
||||
logDeprecatedLegacyScheme()
|
||||
// Only sanitize if prometheus does not support UTF-8.
|
||||
ns = model.EscapeName(ns, model.NameEscapingScheme)
|
||||
}
|
||||
|
|
|
|||
108
vendor/go.opentelemetry.io/otel/exporters/prometheus/exporter.go
generated
vendored
108
vendor/go.opentelemetry.io/otel/exporters/prometheus/exporter.go
generated
vendored
|
|
@ -8,6 +8,7 @@ import (
|
|||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
|
|
@ -40,7 +41,15 @@ const (
|
|||
spanIDExemplarKey = "span_id"
|
||||
)
|
||||
|
||||
var errScopeInvalid = errors.New("invalid scope")
|
||||
var (
|
||||
errScopeInvalid = errors.New("invalid scope")
|
||||
|
||||
metricsPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
return &metricdata.ResourceMetrics{}
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
// Exporter is a Prometheus Exporter that embeds the OTel metric.Reader
|
||||
// interface for easy instantiation with a MeterProvider.
|
||||
|
|
@ -144,9 +153,9 @@ func (c *collector) Describe(ch chan<- *prometheus.Desc) {
|
|||
//
|
||||
// This method is safe to call concurrently.
|
||||
func (c *collector) Collect(ch chan<- prometheus.Metric) {
|
||||
// TODO (#3047): Use a sync.Pool instead of allocating metrics every Collect.
|
||||
metrics := metricdata.ResourceMetrics{}
|
||||
err := c.reader.Collect(context.TODO(), &metrics)
|
||||
metrics := metricsPool.Get().(*metricdata.ResourceMetrics)
|
||||
defer metricsPool.Put(metrics)
|
||||
err := c.reader.Collect(context.TODO(), metrics)
|
||||
if err != nil {
|
||||
if errors.Is(err, metric.ErrReaderShutdown) {
|
||||
return
|
||||
|
|
@ -233,6 +242,10 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) {
|
|||
addHistogramMetric(ch, v, m, name, kv)
|
||||
case metricdata.Histogram[float64]:
|
||||
addHistogramMetric(ch, v, m, name, kv)
|
||||
case metricdata.ExponentialHistogram[int64]:
|
||||
addExponentialHistogramMetric(ch, v, m, name, kv)
|
||||
case metricdata.ExponentialHistogram[float64]:
|
||||
addExponentialHistogramMetric(ch, v, m, name, kv)
|
||||
case metricdata.Sum[int64]:
|
||||
addSumMetric(ch, v, m, name, kv)
|
||||
case metricdata.Sum[float64]:
|
||||
|
|
@ -246,7 +259,67 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) {
|
|||
}
|
||||
}
|
||||
|
||||
func addHistogramMetric[N int64 | float64](ch chan<- prometheus.Metric, histogram metricdata.Histogram[N], m metricdata.Metrics, name string, kv keyVals) {
|
||||
func addExponentialHistogramMetric[N int64 | float64](
|
||||
ch chan<- prometheus.Metric,
|
||||
histogram metricdata.ExponentialHistogram[N],
|
||||
m metricdata.Metrics,
|
||||
name string,
|
||||
kv keyVals,
|
||||
) {
|
||||
for _, dp := range histogram.DataPoints {
|
||||
keys, values := getAttrs(dp.Attributes)
|
||||
keys = append(keys, kv.keys...)
|
||||
values = append(values, kv.vals...)
|
||||
|
||||
desc := prometheus.NewDesc(name, m.Description, keys, nil)
|
||||
|
||||
// From spec: note that Prometheus Native Histograms buckets are indexed by upper boundary while Exponential Histograms are indexed by lower boundary, the result being that the Offset fields are different-by-one.
|
||||
positiveBuckets := make(map[int]int64)
|
||||
for i, c := range dp.PositiveBucket.Counts {
|
||||
if c > math.MaxInt64 {
|
||||
otel.Handle(fmt.Errorf("positive count %d is too large to be represented as int64", c))
|
||||
continue
|
||||
}
|
||||
positiveBuckets[int(dp.PositiveBucket.Offset)+i+1] = int64(c) // nolint: gosec // Size check above.
|
||||
}
|
||||
|
||||
negativeBuckets := make(map[int]int64)
|
||||
for i, c := range dp.NegativeBucket.Counts {
|
||||
if c > math.MaxInt64 {
|
||||
otel.Handle(fmt.Errorf("negative count %d is too large to be represented as int64", c))
|
||||
continue
|
||||
}
|
||||
negativeBuckets[int(dp.NegativeBucket.Offset)+i+1] = int64(c) // nolint: gosec // Size check above.
|
||||
}
|
||||
|
||||
m, err := prometheus.NewConstNativeHistogram(
|
||||
desc,
|
||||
dp.Count,
|
||||
float64(dp.Sum),
|
||||
positiveBuckets,
|
||||
negativeBuckets,
|
||||
dp.ZeroCount,
|
||||
dp.Scale,
|
||||
dp.ZeroThreshold,
|
||||
dp.StartTime,
|
||||
values...)
|
||||
if err != nil {
|
||||
otel.Handle(err)
|
||||
continue
|
||||
}
|
||||
|
||||
// TODO(GiedriusS): add exemplars here after https://github.com/prometheus/client_golang/pull/1654#pullrequestreview-2434669425 is done.
|
||||
ch <- m
|
||||
}
|
||||
}
|
||||
|
||||
func addHistogramMetric[N int64 | float64](
|
||||
ch chan<- prometheus.Metric,
|
||||
histogram metricdata.Histogram[N],
|
||||
m metricdata.Metrics,
|
||||
name string,
|
||||
kv keyVals,
|
||||
) {
|
||||
for _, dp := range histogram.DataPoints {
|
||||
keys, values := getAttrs(dp.Attributes)
|
||||
keys = append(keys, kv.keys...)
|
||||
|
|
@ -270,7 +343,13 @@ func addHistogramMetric[N int64 | float64](ch chan<- prometheus.Metric, histogra
|
|||
}
|
||||
}
|
||||
|
||||
func addSumMetric[N int64 | float64](ch chan<- prometheus.Metric, sum metricdata.Sum[N], m metricdata.Metrics, name string, kv keyVals) {
|
||||
func addSumMetric[N int64 | float64](
|
||||
ch chan<- prometheus.Metric,
|
||||
sum metricdata.Sum[N],
|
||||
m metricdata.Metrics,
|
||||
name string,
|
||||
kv keyVals,
|
||||
) {
|
||||
valueType := prometheus.CounterValue
|
||||
if !sum.IsMonotonic {
|
||||
valueType = prometheus.GaugeValue
|
||||
|
|
@ -296,7 +375,13 @@ func addSumMetric[N int64 | float64](ch chan<- prometheus.Metric, sum metricdata
|
|||
}
|
||||
}
|
||||
|
||||
func addGaugeMetric[N int64 | float64](ch chan<- prometheus.Metric, gauge metricdata.Gauge[N], m metricdata.Metrics, name string, kv keyVals) {
|
||||
func addGaugeMetric[N int64 | float64](
|
||||
ch chan<- prometheus.Metric,
|
||||
gauge metricdata.Gauge[N],
|
||||
m metricdata.Metrics,
|
||||
name string,
|
||||
kv keyVals,
|
||||
) {
|
||||
for _, dp := range gauge.DataPoints {
|
||||
keys, values := getAttrs(dp.Attributes)
|
||||
keys = append(keys, kv.keys...)
|
||||
|
|
@ -319,7 +404,7 @@ func getAttrs(attrs attribute.Set) ([]string, []string) {
|
|||
values := make([]string, 0, attrs.Len())
|
||||
itr := attrs.Iter()
|
||||
|
||||
if model.NameValidationScheme == model.UTF8Validation {
|
||||
if model.NameValidationScheme == model.UTF8Validation { // nolint:staticcheck // We need this check to keep supporting the legacy scheme.
|
||||
// Do not perform sanitization if prometheus supports UTF-8.
|
||||
for itr.Next() {
|
||||
kv := itr.Attribute()
|
||||
|
|
@ -405,8 +490,9 @@ var unitSuffixes = map[string]string{
|
|||
// getName returns the sanitized name, prefixed with the namespace and suffixed with unit.
|
||||
func (c *collector) getName(m metricdata.Metrics, typ *dto.MetricType) string {
|
||||
name := m.Name
|
||||
if model.NameValidationScheme != model.UTF8Validation {
|
||||
if model.NameValidationScheme != model.UTF8Validation { // nolint:staticcheck // We need this check to keep supporting the legacy scheme.
|
||||
// Only sanitize if prometheus does not support UTF-8.
|
||||
logDeprecatedLegacyScheme()
|
||||
name = model.EscapeName(name, model.NameEscapingScheme)
|
||||
}
|
||||
addCounterSuffix := !c.withoutCounterSuffixes && *typ == dto.MetricType_COUNTER
|
||||
|
|
@ -436,11 +522,13 @@ func (c *collector) getName(m metricdata.Metrics, typ *dto.MetricType) string {
|
|||
// underscore when the escaping scheme is underscore escaping. This is meant to
|
||||
// capture any character that should be considered a "delimiter".
|
||||
func convertsToUnderscore(b rune) bool {
|
||||
return !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == ':' || (b >= '0' && b <= '9'))
|
||||
return (b < 'a' || b > 'z') && (b < 'A' || b > 'Z') && b != ':' && (b < '0' || b > '9')
|
||||
}
|
||||
|
||||
func (c *collector) metricType(m metricdata.Metrics) *dto.MetricType {
|
||||
switch v := m.Data.(type) {
|
||||
case metricdata.ExponentialHistogram[int64], metricdata.ExponentialHistogram[float64]:
|
||||
return dto.MetricType_HISTOGRAM.Enum()
|
||||
case metricdata.Histogram[int64], metricdata.Histogram[float64]:
|
||||
return dto.MetricType_HISTOGRAM.Enum()
|
||||
case metricdata.Sum[float64]:
|
||||
|
|
|
|||
4
vendor/go.opentelemetry.io/otel/exporters/stdout/stdoutmetric/exporter.go
generated
vendored
4
vendor/go.opentelemetry.io/otel/exporters/stdout/stdoutmetric/exporter.go
generated
vendored
|
|
@ -131,7 +131,9 @@ func redactAggregationTimestamps(orig metricdata.Aggregation) metricdata.Aggrega
|
|||
}
|
||||
}
|
||||
|
||||
func redactHistogramTimestamps[T int64 | float64](hdp []metricdata.HistogramDataPoint[T]) []metricdata.HistogramDataPoint[T] {
|
||||
func redactHistogramTimestamps[T int64 | float64](
|
||||
hdp []metricdata.HistogramDataPoint[T],
|
||||
) []metricdata.HistogramDataPoint[T] {
|
||||
out := make([]metricdata.HistogramDataPoint[T], len(hdp))
|
||||
for i, dp := range hdp {
|
||||
out[i] = metricdata.HistogramDataPoint[T]{
|
||||
|
|
|
|||
17
vendor/go.opentelemetry.io/otel/log/doc.go
generated
vendored
17
vendor/go.opentelemetry.io/otel/log/doc.go
generated
vendored
|
|
@ -4,10 +4,19 @@
|
|||
/*
|
||||
Package log provides the OpenTelemetry Logs API.
|
||||
|
||||
This package is intended to be used by bridges between existing logging
|
||||
libraries and OpenTelemetry. Users should not directly use this package as a
|
||||
logging library. Instead, install one of the bridges listed in the
|
||||
[registry], and use the associated logging library.
|
||||
This API is separate from its implementation so the instrumentation built from
|
||||
it is reusable. See [go.opentelemetry.io/otel/sdk/log] for the official
|
||||
OpenTelemetry implementation of this API.
|
||||
|
||||
The log package provides the OpenTelemetry Logs API, which serves as a standard
|
||||
interface for generating and managing log records within the OpenTelemetry ecosystem.
|
||||
This package allows users to emit LogRecords, enabling structured, context-rich logging
|
||||
that can be easily integrated with observability tools. It ensures that log data is captured
|
||||
in a way that is consistent with OpenTelemetry's data model.
|
||||
|
||||
This package can be used to create bridges between existing logging libraries and OpenTelemetry.
|
||||
Log bridges allow integrating the existing logging setups with OpenTelemetry.
|
||||
Log bridges can be found in the [registry].
|
||||
|
||||
# API Implementations
|
||||
|
||||
|
|
|
|||
18
vendor/go.opentelemetry.io/otel/log/embedded/embedded.go
generated
vendored
18
vendor/go.opentelemetry.io/otel/log/embedded/embedded.go
generated
vendored
|
|
@ -4,33 +4,33 @@
|
|||
// Package embedded provides interfaces embedded within the [OpenTelemetry Logs
|
||||
// Bridge API].
|
||||
//
|
||||
// Implementers of the [OpenTelemetry Logs Bridge API] can embed the relevant
|
||||
// Implementers of the [OpenTelemetry Logs API] can embed the relevant
|
||||
// type from this package into their implementation directly. Doing so will
|
||||
// result in a compilation error for users when the [OpenTelemetry Logs Bridge
|
||||
// API] is extended (which is something that can happen without a major version
|
||||
// bump of the API package).
|
||||
//
|
||||
// [OpenTelemetry Logs Bridge API]: https://pkg.go.dev/go.opentelemetry.io/otel/log
|
||||
// [OpenTelemetry Logs API]: https://pkg.go.dev/go.opentelemetry.io/otel/log
|
||||
package embedded // import "go.opentelemetry.io/otel/log/embedded"
|
||||
|
||||
// LoggerProvider is embedded in the [Logs Bridge API LoggerProvider].
|
||||
// LoggerProvider is embedded in the [Logs API LoggerProvider].
|
||||
//
|
||||
// Embed this interface in your implementation of the [Logs Bridge API
|
||||
// Embed this interface in your implementation of the [Logs API
|
||||
// LoggerProvider] if you want users to experience a compilation error,
|
||||
// signaling they need to update to your latest implementation, when the [Logs
|
||||
// Bridge API LoggerProvider] interface is extended (which is something that
|
||||
// can happen without a major version bump of the API package).
|
||||
//
|
||||
// [Logs Bridge API LoggerProvider]: https://pkg.go.dev/go.opentelemetry.io/otel/log#LoggerProvider
|
||||
// [Logs API LoggerProvider]: https://pkg.go.dev/go.opentelemetry.io/otel/log#LoggerProvider
|
||||
type LoggerProvider interface{ loggerProvider() }
|
||||
|
||||
// Logger is embedded in [Logs Bridge API Logger].
|
||||
// Logger is embedded in [Logs API Logger].
|
||||
//
|
||||
// Embed this interface in your implementation of the [Logs Bridge API Logger]
|
||||
// Embed this interface in your implementation of the [Logs API Logger]
|
||||
// if you want users to experience a compilation error, signaling they need to
|
||||
// update to your latest implementation, when the [Logs Bridge API Logger]
|
||||
// update to your latest implementation, when the [Logs API Logger]
|
||||
// interface is extended (which is something that can happen without a major
|
||||
// version bump of the API package).
|
||||
//
|
||||
// [Logs Bridge API Logger]: https://pkg.go.dev/go.opentelemetry.io/otel/log#Logger
|
||||
// [Logs API Logger]: https://pkg.go.dev/go.opentelemetry.io/otel/log#Logger
|
||||
type Logger interface{ logger() }
|
||||
|
|
|
|||
2
vendor/go.opentelemetry.io/otel/log/keyvalue.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/log/keyvalue.go
generated
vendored
|
|
@ -301,7 +301,7 @@ func (v Value) String() string {
|
|||
case KindBool:
|
||||
return strconv.FormatBool(v.asBool())
|
||||
case KindBytes:
|
||||
return fmt.Sprint(v.asBytes())
|
||||
return fmt.Sprint(v.asBytes()) // nolint:staticcheck // Use fmt.Sprint to encode as slice.
|
||||
case KindMap:
|
||||
return fmt.Sprint(v.asMap())
|
||||
case KindSlice:
|
||||
|
|
|
|||
6
vendor/go.opentelemetry.io/otel/log/noop/noop.go
generated
vendored
6
vendor/go.opentelemetry.io/otel/log/noop/noop.go
generated
vendored
|
|
@ -4,14 +4,14 @@
|
|||
// Package noop provides an implementation of the [OpenTelemetry Logs Bridge
|
||||
// API] that produces no telemetry and minimizes used computation resources.
|
||||
//
|
||||
// Using this package to implement the [OpenTelemetry Logs Bridge API] will
|
||||
// Using this package to implement the [OpenTelemetry Logs API] will
|
||||
// effectively disable OpenTelemetry.
|
||||
//
|
||||
// This implementation can be embedded in other implementations of the
|
||||
// [OpenTelemetry Logs Bridge API]. Doing so will mean the implementation
|
||||
// [OpenTelemetry Logs API]. Doing so will mean the implementation
|
||||
// defaults to no operation for methods it does not implement.
|
||||
//
|
||||
// [OpenTelemetry Logs Bridge API]: https://pkg.go.dev/go.opentelemetry.io/otel/log
|
||||
// [OpenTelemetry Logs API]: https://pkg.go.dev/go.opentelemetry.io/otel/log
|
||||
package noop // import "go.opentelemetry.io/otel/log/noop"
|
||||
|
||||
import (
|
||||
|
|
|
|||
28
vendor/go.opentelemetry.io/otel/sdk/log/batch.go
generated
vendored
28
vendor/go.opentelemetry.io/otel/sdk/log/batch.go
generated
vendored
|
|
@ -156,13 +156,20 @@ func (b *BatchProcessor) poll(interval time.Duration) (done chan struct{}) {
|
|||
global.Warn("dropped log records", "dropped", d)
|
||||
}
|
||||
|
||||
qLen := b.q.TryDequeue(buf, func(r []Record) bool {
|
||||
ok := b.exporter.EnqueueExport(r)
|
||||
if ok {
|
||||
buf = slices.Clone(buf)
|
||||
}
|
||||
return ok
|
||||
})
|
||||
var qLen int
|
||||
// Don't copy data from queue unless exporter can accept more, it is very expensive.
|
||||
if b.exporter.Ready() {
|
||||
qLen = b.q.TryDequeue(buf, func(r []Record) bool {
|
||||
ok := b.exporter.EnqueueExport(r)
|
||||
if ok {
|
||||
buf = slices.Clone(buf)
|
||||
}
|
||||
return ok
|
||||
})
|
||||
} else {
|
||||
qLen = b.q.Len()
|
||||
}
|
||||
|
||||
if qLen >= b.batchSize {
|
||||
// There is another full batch ready. Immediately trigger
|
||||
// another export attempt.
|
||||
|
|
@ -272,6 +279,13 @@ func newQueue(size int) *queue {
|
|||
}
|
||||
}
|
||||
|
||||
func (q *queue) Len() int {
|
||||
q.Lock()
|
||||
defer q.Unlock()
|
||||
|
||||
return q.len
|
||||
}
|
||||
|
||||
// Dropped returns the number of Records dropped during enqueueing since the
|
||||
// last time Dropped was called.
|
||||
func (q *queue) Dropped() uint64 {
|
||||
|
|
|
|||
2
vendor/go.opentelemetry.io/otel/sdk/log/doc.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/sdk/log/doc.go
generated
vendored
|
|
@ -31,6 +31,6 @@ is being run on. That way when multiple instances of the code are collected
|
|||
at a single endpoint their origin is decipherable.
|
||||
|
||||
See [go.opentelemetry.io/otel/log] for more information about
|
||||
the OpenTelemetry Logs Bridge API.
|
||||
the OpenTelemetry Logs API.
|
||||
*/
|
||||
package log // import "go.opentelemetry.io/otel/sdk/log"
|
||||
|
|
|
|||
11
vendor/go.opentelemetry.io/otel/sdk/log/exporter.go
generated
vendored
11
vendor/go.opentelemetry.io/otel/sdk/log/exporter.go
generated
vendored
|
|
@ -186,11 +186,10 @@ type bufferExporter struct {
|
|||
|
||||
// newBufferExporter returns a new bufferExporter that wraps exporter. The
|
||||
// returned bufferExporter will buffer at most size number of export requests.
|
||||
// If size is less than zero, zero will be used (i.e. only synchronous
|
||||
// exporting will be supported).
|
||||
// If size is less than 1, 1 will be used.
|
||||
func newBufferExporter(exporter Exporter, size int) *bufferExporter {
|
||||
if size < 0 {
|
||||
size = 0
|
||||
if size < 1 {
|
||||
size = 1
|
||||
}
|
||||
input := make(chan exportData, size)
|
||||
return &bufferExporter{
|
||||
|
|
@ -201,6 +200,10 @@ func newBufferExporter(exporter Exporter, size int) *bufferExporter {
|
|||
}
|
||||
}
|
||||
|
||||
func (e *bufferExporter) Ready() bool {
|
||||
return len(e.input) != cap(e.input)
|
||||
}
|
||||
|
||||
var errStopped = errors.New("exporter stopped")
|
||||
|
||||
func (e *bufferExporter) enqueue(ctx context.Context, records []Record, rCh chan<- error) error {
|
||||
|
|
|
|||
2
vendor/go.opentelemetry.io/otel/sdk/log/filter_processor.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/sdk/log/filter_processor.go
generated
vendored
|
|
@ -8,7 +8,6 @@ import (
|
|||
|
||||
"go.opentelemetry.io/otel/log"
|
||||
"go.opentelemetry.io/otel/sdk/instrumentation"
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
)
|
||||
|
||||
// FilterProcessor is a [Processor] that knows, and can identify, what [Record]
|
||||
|
|
@ -56,7 +55,6 @@ type FilterProcessor interface {
|
|||
|
||||
// EnabledParameters represents payload for [FilterProcessor]'s Enabled method.
|
||||
type EnabledParameters struct {
|
||||
Resource resource.Resource
|
||||
InstrumentationScope instrumentation.Scope
|
||||
Severity log.Severity
|
||||
}
|
||||
|
|
|
|||
1
vendor/go.opentelemetry.io/otel/sdk/log/logger.go
generated
vendored
1
vendor/go.opentelemetry.io/otel/sdk/log/logger.go
generated
vendored
|
|
@ -50,7 +50,6 @@ func (l *logger) Emit(ctx context.Context, r log.Record) {
|
|||
// returned if it can be positively verified that no Processor will process.
|
||||
func (l *logger) Enabled(ctx context.Context, param log.EnabledParameters) bool {
|
||||
p := EnabledParameters{
|
||||
Resource: *l.provider.resource,
|
||||
InstrumentationScope: l.instrumentationScope,
|
||||
Severity: param.Severity,
|
||||
}
|
||||
|
|
|
|||
2
vendor/go.opentelemetry.io/otel/sdk/log/provider.go
generated
vendored
2
vendor/go.opentelemetry.io/otel/sdk/log/provider.go
generated
vendored
|
|
@ -236,7 +236,7 @@ func WithAttributeCountLimit(limit int) LoggerProviderOption {
|
|||
})
|
||||
}
|
||||
|
||||
// AttributeValueLengthLimit sets the maximum allowed attribute value length.
|
||||
// WithAttributeValueLengthLimit sets the maximum allowed attribute value length.
|
||||
//
|
||||
// This limit only applies to string and string slice attribute values.
|
||||
// Any string longer than this value will be truncated to this length.
|
||||
|
|
|
|||
4
vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service_grpc.pb.go
generated
vendored
4
vendor/go.opentelemetry.io/proto/otlp/collector/logs/v1/logs_service_grpc.pb.go
generated
vendored
|
|
@ -22,8 +22,6 @@ const _ = grpc.SupportPackageIsVersion7
|
|||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type LogsServiceClient interface {
|
||||
// For performance reasons, it is recommended to keep this RPC
|
||||
// alive for the entire life of the application.
|
||||
Export(ctx context.Context, in *ExportLogsServiceRequest, opts ...grpc.CallOption) (*ExportLogsServiceResponse, error)
|
||||
}
|
||||
|
||||
|
|
@ -48,8 +46,6 @@ func (c *logsServiceClient) Export(ctx context.Context, in *ExportLogsServiceReq
|
|||
// All implementations must embed UnimplementedLogsServiceServer
|
||||
// for forward compatibility
|
||||
type LogsServiceServer interface {
|
||||
// For performance reasons, it is recommended to keep this RPC
|
||||
// alive for the entire life of the application.
|
||||
Export(context.Context, *ExportLogsServiceRequest) (*ExportLogsServiceResponse, error)
|
||||
mustEmbedUnimplementedLogsServiceServer()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ const _ = grpc.SupportPackageIsVersion7
|
|||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type MetricsServiceClient interface {
|
||||
// For performance reasons, it is recommended to keep this RPC
|
||||
// alive for the entire life of the application.
|
||||
Export(ctx context.Context, in *ExportMetricsServiceRequest, opts ...grpc.CallOption) (*ExportMetricsServiceResponse, error)
|
||||
}
|
||||
|
||||
|
|
@ -48,8 +46,6 @@ func (c *metricsServiceClient) Export(ctx context.Context, in *ExportMetricsServ
|
|||
// All implementations must embed UnimplementedMetricsServiceServer
|
||||
// for forward compatibility
|
||||
type MetricsServiceServer interface {
|
||||
// For performance reasons, it is recommended to keep this RPC
|
||||
// alive for the entire life of the application.
|
||||
Export(context.Context, *ExportMetricsServiceRequest) (*ExportMetricsServiceResponse, error)
|
||||
mustEmbedUnimplementedMetricsServiceServer()
|
||||
}
|
||||
|
|
|
|||
4
vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go
generated
vendored
4
vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_service_grpc.pb.go
generated
vendored
|
|
@ -22,8 +22,6 @@ const _ = grpc.SupportPackageIsVersion7
|
|||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type TraceServiceClient interface {
|
||||
// For performance reasons, it is recommended to keep this RPC
|
||||
// alive for the entire life of the application.
|
||||
Export(ctx context.Context, in *ExportTraceServiceRequest, opts ...grpc.CallOption) (*ExportTraceServiceResponse, error)
|
||||
}
|
||||
|
||||
|
|
@ -48,8 +46,6 @@ func (c *traceServiceClient) Export(ctx context.Context, in *ExportTraceServiceR
|
|||
// All implementations must embed UnimplementedTraceServiceServer
|
||||
// for forward compatibility
|
||||
type TraceServiceServer interface {
|
||||
// For performance reasons, it is recommended to keep this RPC
|
||||
// alive for the entire life of the application.
|
||||
Export(context.Context, *ExportTraceServiceRequest) (*ExportTraceServiceResponse, error)
|
||||
mustEmbedUnimplementedTraceServiceServer()
|
||||
}
|
||||
|
|
|
|||
138
vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go
generated
vendored
138
vendor/go.opentelemetry.io/proto/otlp/common/v1/common.pb.go
generated
vendored
|
|
@ -430,6 +430,101 @@ func (x *InstrumentationScope) GetDroppedAttributesCount() uint32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
// A reference to an Entity.
|
||||
// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs.
|
||||
//
|
||||
// Status: [Development]
|
||||
type EntityRef struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The Schema URL, if known. This is the identifier of the Schema that the entity data
|
||||
// is recorded in. To learn more about Schema URL see
|
||||
// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
|
||||
//
|
||||
// This schema_url applies to the data in this message and to the Resource attributes
|
||||
// referenced by id_keys and description_keys.
|
||||
// TODO: discuss if we are happy with this somewhat complicated definition of what
|
||||
// the schema_url applies to.
|
||||
//
|
||||
// This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs.
|
||||
SchemaUrl string `protobuf:"bytes,1,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"`
|
||||
// Defines the type of the entity. MUST not change during the lifetime of the entity.
|
||||
// For example: "service" or "host". This field is required and MUST not be empty
|
||||
// for valid entities.
|
||||
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
|
||||
// Attribute Keys that identify the entity.
|
||||
// MUST not change during the lifetime of the entity. The Id must contain at least one attribute.
|
||||
// These keys MUST exist in the containing {message}.attributes.
|
||||
IdKeys []string `protobuf:"bytes,3,rep,name=id_keys,json=idKeys,proto3" json:"id_keys,omitempty"`
|
||||
// Descriptive (non-identifying) attribute keys of the entity.
|
||||
// MAY change over the lifetime of the entity. MAY be empty.
|
||||
// These attribute keys are not part of entity's identity.
|
||||
// These keys MUST exist in the containing {message}.attributes.
|
||||
DescriptionKeys []string `protobuf:"bytes,4,rep,name=description_keys,json=descriptionKeys,proto3" json:"description_keys,omitempty"`
|
||||
}
|
||||
|
||||
func (x *EntityRef) Reset() {
|
||||
*x = EntityRef{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EntityRef) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EntityRef) ProtoMessage() {}
|
||||
|
||||
func (x *EntityRef) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_opentelemetry_proto_common_v1_common_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EntityRef.ProtoReflect.Descriptor instead.
|
||||
func (*EntityRef) Descriptor() ([]byte, []int) {
|
||||
return file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *EntityRef) GetSchemaUrl() string {
|
||||
if x != nil {
|
||||
return x.SchemaUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EntityRef) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EntityRef) GetIdKeys() []string {
|
||||
if x != nil {
|
||||
return x.IdKeys
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *EntityRef) GetDescriptionKeys() []string {
|
||||
if x != nil {
|
||||
return x.DescriptionKeys
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_opentelemetry_proto_common_v1_common_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_opentelemetry_proto_common_v1_common_proto_rawDesc = []byte{
|
||||
|
|
@ -488,15 +583,23 @@ var file_opentelemetry_proto_common_v1_common_proto_rawDesc = []byte{
|
|||
0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
|
||||
0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64,
|
||||
0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
|
||||
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x7b, 0x0a, 0x20, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
|
||||
0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
|
||||
0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65,
|
||||
0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f,
|
||||
0x76, 0x31, 0xaa, 0x02, 0x1d, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
|
||||
0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
|
||||
0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x82, 0x01, 0x0a, 0x09, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79,
|
||||
0x52, 0x65, 0x66, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x75, 0x72,
|
||||
0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x55,
|
||||
0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x64, 0x5f, 0x6b, 0x65, 0x79,
|
||||
0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x69, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x12,
|
||||
0x29, 0x0a, 0x10, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b,
|
||||
0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x63, 0x72,
|
||||
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x42, 0x7b, 0x0a, 0x20, 0x69, 0x6f,
|
||||
0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0b,
|
||||
0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67,
|
||||
0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e,
|
||||
0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x63, 0x6f,
|
||||
0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x1d, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65,
|
||||
0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f,
|
||||
0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
@ -511,13 +614,14 @@ func file_opentelemetry_proto_common_v1_common_proto_rawDescGZIP() []byte {
|
|||
return file_opentelemetry_proto_common_v1_common_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_opentelemetry_proto_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_opentelemetry_proto_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_opentelemetry_proto_common_v1_common_proto_goTypes = []interface{}{
|
||||
(*AnyValue)(nil), // 0: opentelemetry.proto.common.v1.AnyValue
|
||||
(*ArrayValue)(nil), // 1: opentelemetry.proto.common.v1.ArrayValue
|
||||
(*KeyValueList)(nil), // 2: opentelemetry.proto.common.v1.KeyValueList
|
||||
(*KeyValue)(nil), // 3: opentelemetry.proto.common.v1.KeyValue
|
||||
(*InstrumentationScope)(nil), // 4: opentelemetry.proto.common.v1.InstrumentationScope
|
||||
(*EntityRef)(nil), // 5: opentelemetry.proto.common.v1.EntityRef
|
||||
}
|
||||
var file_opentelemetry_proto_common_v1_common_proto_depIdxs = []int32{
|
||||
1, // 0: opentelemetry.proto.common.v1.AnyValue.array_value:type_name -> opentelemetry.proto.common.v1.ArrayValue
|
||||
|
|
@ -599,6 +703,18 @@ func file_opentelemetry_proto_common_v1_common_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_opentelemetry_proto_common_v1_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*EntityRef); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_opentelemetry_proto_common_v1_common_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
(*AnyValue_StringValue)(nil),
|
||||
|
|
@ -615,7 +731,7 @@ func file_opentelemetry_proto_common_v1_common_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_opentelemetry_proto_common_v1_common_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
|
|
|||
2
vendor/go.opentelemetry.io/proto/otlp/logs/v1/logs.pb.go
generated
vendored
2
vendor/go.opentelemetry.io/proto/otlp/logs/v1/logs.pb.go
generated
vendored
|
|
@ -501,8 +501,6 @@ type LogRecord struct {
|
|||
// as an event.
|
||||
//
|
||||
// [Optional].
|
||||
//
|
||||
// Status: [Development]
|
||||
EventName string `protobuf:"bytes,12,opt,name=event_name,json=eventName,proto3" json:"event_name,omitempty"`
|
||||
}
|
||||
|
||||
|
|
|
|||
11
vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go
generated
vendored
11
vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go
generated
vendored
|
|
@ -526,7 +526,7 @@ type Metric struct {
|
|||
// description of the metric, which can be used in documentation.
|
||||
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||
// unit in which the metric value is reported. Follows the format
|
||||
// described by http://unitsofmeasure.org/ucum.html.
|
||||
// described by https://unitsofmeasure.org/ucum.html.
|
||||
Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit,omitempty"`
|
||||
// Data determines the aggregation type (if any) of the metric, what is the
|
||||
// reported value type for the data points, as well as the relatationship to
|
||||
|
|
@ -929,7 +929,7 @@ func (x *ExponentialHistogram) GetAggregationTemporality() AggregationTemporalit
|
|||
|
||||
// Summary metric data are used to convey quantile summaries,
|
||||
// a Prometheus (see: https://prometheus.io/docs/concepts/metric_types/#summary)
|
||||
// and OpenMetrics (see: https://github.com/OpenObservability/OpenMetrics/blob/4dbf6075567ab43296eed941037c12951faafb92/protos/prometheus.proto#L45)
|
||||
// and OpenMetrics (see: https://github.com/prometheus/OpenMetrics/blob/4dbf6075567ab43296eed941037c12951faafb92/protos/prometheus.proto#L45)
|
||||
// data type. These data points cannot always be merged in a meaningful way.
|
||||
// While they can be useful in some applications, histogram data points are
|
||||
// recommended for new applications.
|
||||
|
|
@ -1175,7 +1175,9 @@ type HistogramDataPoint struct {
|
|||
// The sum of the bucket_counts must equal the value in the count field.
|
||||
//
|
||||
// The number of elements in bucket_counts array must be by one greater than
|
||||
// the number of elements in explicit_bounds array.
|
||||
// the number of elements in explicit_bounds array. The exception to this rule
|
||||
// is when the length of bucket_counts is 0, then the length of explicit_bounds
|
||||
// must also be 0.
|
||||
BucketCounts []uint64 `protobuf:"fixed64,6,rep,packed,name=bucket_counts,json=bucketCounts,proto3" json:"bucket_counts,omitempty"`
|
||||
// explicit_bounds specifies buckets with explicitly defined bounds for values.
|
||||
//
|
||||
|
|
@ -1190,6 +1192,9 @@ type HistogramDataPoint struct {
|
|||
// Histogram buckets are inclusive of their upper boundary, except the last
|
||||
// bucket where the boundary is at infinity. This format is intentionally
|
||||
// compatible with the OpenMetrics histogram definition.
|
||||
//
|
||||
// If bucket_counts length is 0 then explicit_bounds length must also be 0,
|
||||
// otherwise the data point is invalid.
|
||||
ExplicitBounds []float64 `protobuf:"fixed64,7,rep,packed,name=explicit_bounds,json=explicitBounds,proto3" json:"explicit_bounds,omitempty"`
|
||||
// (Optional) List of exemplars collected from
|
||||
// measurements that were used to form the data point
|
||||
|
|
|
|||
56
vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go
generated
vendored
56
vendor/go.opentelemetry.io/proto/otlp/resource/v1/resource.pb.go
generated
vendored
|
|
@ -48,6 +48,12 @@ type Resource struct {
|
|||
// dropped_attributes_count is the number of dropped attributes. If the value is 0, then
|
||||
// no attributes were dropped.
|
||||
DroppedAttributesCount uint32 `protobuf:"varint,2,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"`
|
||||
// Set of entities that participate in this Resource.
|
||||
//
|
||||
// Note: keys in the references MUST exist in attributes of this message.
|
||||
//
|
||||
// Status: [Development]
|
||||
EntityRefs []*v1.EntityRef `protobuf:"bytes,3,rep,name=entity_refs,json=entityRefs,proto3" json:"entity_refs,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Resource) Reset() {
|
||||
|
|
@ -96,6 +102,13 @@ func (x *Resource) GetDroppedAttributesCount() uint32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (x *Resource) GetEntityRefs() []*v1.EntityRef {
|
||||
if x != nil {
|
||||
return x.EntityRefs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_opentelemetry_proto_resource_v1_resource_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = []byte{
|
||||
|
|
@ -106,7 +119,7 @@ var file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = []byte{
|
|||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76,
|
||||
0x31, 0x1a, 0x2a, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31,
|
||||
0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x01,
|
||||
0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd8, 0x01,
|
||||
0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x61, 0x74,
|
||||
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27,
|
||||
0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70,
|
||||
|
|
@ -115,16 +128,21 @@ var file_opentelemetry_proto_resource_v1_resource_proto_rawDesc = []byte{
|
|||
0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61,
|
||||
0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x41, 0x74,
|
||||
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x83, 0x01,
|
||||
0x0a, 0x22, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
|
||||
0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65,
|
||||
0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2f, 0x6f, 0x74, 0x6c, 0x70, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76,
|
||||
0x31, 0xaa, 0x02, 0x1f, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72,
|
||||
0x79, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||
0x2e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x49, 0x0a,
|
||||
0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x72, 0x65, 0x66, 0x73, 0x18, 0x03, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
|
||||
0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
|
||||
0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x66, 0x52, 0x0a, 0x65, 0x6e,
|
||||
0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x66, 0x73, 0x42, 0x83, 0x01, 0x0a, 0x22, 0x69, 0x6f, 0x2e,
|
||||
0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x42,
|
||||
0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
||||
0x5a, 0x2a, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74,
|
||||
0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x6c, 0x70,
|
||||
0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x31, 0xaa, 0x02, 0x1f, 0x4f,
|
||||
0x70, 0x65, 0x6e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x56, 0x31, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
@ -141,16 +159,18 @@ func file_opentelemetry_proto_resource_v1_resource_proto_rawDescGZIP() []byte {
|
|||
|
||||
var file_opentelemetry_proto_resource_v1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_opentelemetry_proto_resource_v1_resource_proto_goTypes = []interface{}{
|
||||
(*Resource)(nil), // 0: opentelemetry.proto.resource.v1.Resource
|
||||
(*v1.KeyValue)(nil), // 1: opentelemetry.proto.common.v1.KeyValue
|
||||
(*Resource)(nil), // 0: opentelemetry.proto.resource.v1.Resource
|
||||
(*v1.KeyValue)(nil), // 1: opentelemetry.proto.common.v1.KeyValue
|
||||
(*v1.EntityRef)(nil), // 2: opentelemetry.proto.common.v1.EntityRef
|
||||
}
|
||||
var file_opentelemetry_proto_resource_v1_resource_proto_depIdxs = []int32{
|
||||
1, // 0: opentelemetry.proto.resource.v1.Resource.attributes:type_name -> opentelemetry.proto.common.v1.KeyValue
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
2, // 1: opentelemetry.proto.resource.v1.Resource.entity_refs:type_name -> opentelemetry.proto.common.v1.EntityRef
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_opentelemetry_proto_resource_v1_resource_proto_init() }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue