diff --git a/CHANGELOG.md b/CHANGELOG.md index d32cf9da168f..b937e8b8d404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,16 @@ internal API changes are not present. Main (unreleased) ----------------- +### Breaking changes + +- The algorithm for the "hash" action of `otelcol.processor.attributes` has changed. + The change was made in PR [#22831](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22831) of opentelemetry-collector-contrib. (@ptodev) + +- `otelcol.exporter.loki` now includes the instrumentation scope in its output. (@ptodev) + +- `otelcol.extension.jaeger_remote_sampling` removes the `\` HTTP endpoint. The `/sampling` endpoint is still functional. + The change was made in PR [#18070](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/18070) of opentelemetry-collector-contrib. (@ptodev) + ### Features - The Pyroscope scrape component computes and sends delta profiles automatically when required to reduce bandwidth usage. (@cyriltovena) @@ -20,7 +30,6 @@ Main (unreleased) - Support custom fields in MMDB file for `stage.geoip`. (@akselleirv) - - New Grafana Agent Flow components: - `discovery.kubelet` collect scrape targets from the Kubelet API. (@gcampbell12) @@ -66,6 +75,8 @@ Main (unreleased) - The Agent Operational dashboard of Grafana Agent mixin now has more descriptive panel titles, Y-axis units +- Update OpenTelemetry Collector dependencies from v0.63.0 to v0.79.0. (@ptodev) + ### Bugfixes - Add signing region to remote.s3 component for use with custom endpoints so that Authorization Headers work correctly when diff --git a/build-image/Dockerfile b/build-image/Dockerfile index 95c355d3702c..70b3d45e3ade 100644 --- a/build-image/Dockerfile +++ b/build-image/Dockerfile @@ -46,7 +46,7 @@ RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@$CONTROLLER_GEN_V # rfratto/viceroy contains C cross compilers can be used for our Cgo # dependencies. -FROM rfratto/viceroy:v0.3.0 +FROM rfratto/viceroy:v0.4.0 # Install NodeJS LTS. This is needed because the most recent version of NodeJS # from official Debian packages is v12, and we need LTS version v16. diff --git a/component/otelcol/auth/auth.go b/component/otelcol/auth/auth.go index c5bc989fdf30..e36777ff62a0 100644 --- a/component/otelcol/auth/auth.go +++ b/component/otelcol/auth/auth.go @@ -17,7 +17,7 @@ import ( "github.com/grafana/agent/pkg/util/zapadapter" "github.com/prometheus/client_golang/prometheus" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/sdk/metric" @@ -31,15 +31,15 @@ type Arguments interface { // Convert converts the Arguments into an OpenTelemetry Collector // authentication extension configuration. - Convert() (otelconfig.Extension, error) + Convert() (otelcomponent.Config, error) // Extensions returns the set of extensions that the configured component is // allowed to use. - Extensions() map[otelconfig.ComponentID]otelcomponent.Extension + Extensions() map[otelcomponent.ID]otelextension.Extension // Exporters returns the set of exporters that are exposed to the configured // component. - Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter + Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component } // Exports is a common Exports type for Flow components which expose @@ -52,8 +52,8 @@ type Exports struct { // Handler combines an extension with its ID. type Handler struct { - ID otelconfig.ComponentID - Extension otelcomponent.Extension + ID otelcomponent.ID + Extension otelextension.Extension } var _ river.Capsule = Handler{} @@ -68,7 +68,7 @@ type Auth struct { cancel context.CancelFunc opts component.Options - factory otelcomponent.ExtensionFactory + factory otelextension.Factory sched *scheduler.Scheduler collector *lazycollector.Collector @@ -85,7 +85,7 @@ var ( // // The registered component must be registered to export the Exports type from // this package, otherwise New will panic. -func New(opts component.Options, f otelcomponent.ExtensionFactory, args Arguments) (*Auth, error) { +func New(opts component.Options, f otelextension.Factory, args Arguments) (*Auth, error) { ctx, cancel := context.WithCancel(context.Background()) // Create a lazy collector where metrics from the upstream component will be @@ -135,7 +135,7 @@ func (a *Auth) Update(args component.Arguments) error { return err } - settings := otelcomponent.ExtensionCreateSettings{ + settings := otelextension.CreateSettings{ TelemetrySettings: otelcomponent.TelemetrySettings{ Logger: zapadapter.New(a.opts.Logger), @@ -168,7 +168,7 @@ func (a *Auth) Update(args component.Arguments) error { // Inform listeners that our handler changed. a.opts.OnStateChange(Exports{ Handler: Handler{ - ID: otelconfig.NewComponentID(otelconfig.Type(a.opts.ID)), + ID: otelcomponent.NewID(otelcomponent.Type(a.opts.ID)), Extension: ext, }, }) diff --git a/component/otelcol/auth/auth_test.go b/component/otelcol/auth/auth_test.go index 4c5e64c2e3ac..535b83815168 100644 --- a/component/otelcol/auth/auth_test.go +++ b/component/otelcol/auth/auth_test.go @@ -12,7 +12,7 @@ import ( "github.com/grafana/agent/pkg/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" ) func TestAuth(t *testing.T) { @@ -45,14 +45,14 @@ func newTestEnvironment(t *testing.T, onCreated func()) *testEnvironment { Args: fakeAuthArgs{}, Exports: otelcol.ConsumerExports{}, Build: func(opts component.Options, args component.Arguments) (component.Component, error) { - factory := otelcomponent.NewExtensionFactory( + factory := otelextension.NewFactory( "testcomponent", - func() otelconfig.Extension { return nil }, + func() otelcomponent.Config { return nil }, func( _ context.Context, - _ otelcomponent.ExtensionCreateSettings, - _ otelconfig.Extension, - ) (otelcomponent.Extension, error) { + _ otelextension.CreateSettings, + _ otelcomponent.Config, + ) (otelcomponent.Component, error) { onCreated() return nil, nil @@ -82,15 +82,14 @@ type fakeAuthArgs struct { var _ auth.Arguments = fakeAuthArgs{} -func (fa fakeAuthArgs) Convert() (otelconfig.Extension, error) { - settings := otelconfig.NewExtensionSettings(otelconfig.NewComponentID("testcomponent")) - return &settings, nil +func (fa fakeAuthArgs) Convert() (otelcomponent.Config, error) { + return &struct{}{}, nil } -func (fa fakeAuthArgs) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (fa fakeAuthArgs) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } -func (fa fakeAuthArgs) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (fa fakeAuthArgs) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/auth/basic/basic.go b/component/otelcol/auth/basic/basic.go index e4ba4cdc7213..5baa5ed6d842 100644 --- a/component/otelcol/auth/basic/basic.go +++ b/component/otelcol/auth/basic/basic.go @@ -7,7 +7,8 @@ import ( "github.com/grafana/agent/pkg/river/rivertypes" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/config/configopaque" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -34,22 +35,21 @@ type Arguments struct { var _ auth.Arguments = Arguments{} // Convert implements auth.Arguments. -func (args Arguments) Convert() (otelconfig.Extension, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &basicauthextension.Config{ - ExtensionSettings: otelconfig.NewExtensionSettings(otelconfig.NewComponentID("basic")), ClientAuth: &basicauthextension.ClientAuthSettings{ Username: args.Username, - Password: string(args.Password), + Password: configopaque.String(args.Password), }, }, nil } // Extensions implements auth.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements auth.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/auth/basic/basic_test.go b/component/otelcol/auth/basic/basic_test.go index 26dc96e1a9a0..eb2ac3a3aa5c 100644 --- a/component/otelcol/auth/basic/basic_test.go +++ b/component/otelcol/auth/basic/basic_test.go @@ -14,7 +14,7 @@ import ( "github.com/grafana/agent/pkg/util" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/config/configauth" + extauth "go.opentelemetry.io/collector/extension/auth" ) // Test performs a basic integration test which runs the otelcol.auth.basic @@ -62,7 +62,7 @@ func Test(t *testing.T) { exports := ctrl.Exports().(auth.Exports) require.NotNil(t, exports.Handler.Extension, "handler extension is nil") - clientAuth, ok := exports.Handler.Extension.(configauth.ClientAuthenticator) + clientAuth, ok := exports.Handler.Extension.(extauth.Client) require.True(t, ok, "handler does not implement configauth.ClientAuthenticator") rt, err := clientAuth.RoundTripper(http.DefaultTransport) diff --git a/component/otelcol/auth/bearer/bearer.go b/component/otelcol/auth/bearer/bearer.go index a260e2656db3..53978ff054f9 100644 --- a/component/otelcol/auth/bearer/bearer.go +++ b/component/otelcol/auth/bearer/bearer.go @@ -7,7 +7,8 @@ import ( "github.com/grafana/agent/pkg/river/rivertypes" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/config/configopaque" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -25,25 +26,44 @@ func init() { // Arguments configures the otelcol.auth.bearer component. type Arguments struct { - Token rivertypes.Secret `river:"token,attr"` + // Do not include the "filename" attribute - users should use local.file instead. + Scheme string `river:"scheme,attr,optional"` + Token rivertypes.Secret `river:"token,attr"` } var _ auth.Arguments = Arguments{} +// DefaultArguments holds default settings for Arguments. +var DefaultArguments = Arguments{ + Scheme: "Bearer", +} + +// UnmarshalRiver implements river.Unmarshaler. +func (args *Arguments) UnmarshalRiver(f func(interface{}) error) error { + *args = DefaultArguments + + type arguments Arguments + if err := f((*arguments)(args)); err != nil { + return err + } + + return nil +} + // Convert implements auth.Arguments. -func (args Arguments) Convert() (otelconfig.Extension, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &bearertokenauthextension.Config{ - ExtensionSettings: otelconfig.NewExtensionSettings(otelconfig.NewComponentID("bearer")), - BearerToken: string(args.Token), + Scheme: args.Scheme, + BearerToken: configopaque.String(args.Token), }, nil } // Extensions implements auth.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements auth.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/auth/bearer/bearer_test.go b/component/otelcol/auth/bearer/bearer_test.go index c16f6c06fbd1..0d76aae936ba 100644 --- a/component/otelcol/auth/bearer/bearer_test.go +++ b/component/otelcol/auth/bearer/bearer_test.go @@ -14,64 +14,103 @@ import ( "github.com/grafana/agent/pkg/util" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/config/configauth" + extauth "go.opentelemetry.io/collector/extension/auth" ) // Test performs a basic integration test which runs the otelcol.auth.bearer // component and ensures that it can be used for authentication. func Test(t *testing.T) { - // Create an HTTP server which will assert that bearer auth has been injected - // into the request. - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - authHeader := r.Header.Get("Authorization") - assert.Equal(t, "Bearer foobar", authHeader, "auth header didn't match") - - w.WriteHeader(http.StatusOK) - })) - defer srv.Close() - - ctx := componenttest.TestContext(t) - ctx, cancel := context.WithTimeout(ctx, time.Minute) - defer cancel() - - l := util.TestLogger(t) - - // Create and run our component - ctrl, err := componenttest.NewControllerFromID(l, "otelcol.auth.bearer") - require.NoError(t, err) - - cfg := ` - token = "foobar" - ` - var args bearer.Arguments - require.NoError(t, river.Unmarshal([]byte(cfg), &args)) - - go func() { - err := ctrl.Run(ctx, args) + type TestDefinition struct { + testName string + expectedHeaderVal string + riverConfig string + } + + tests := []TestDefinition{ + { + testName: "Test1", + expectedHeaderVal: "Bearer example_access_key_id", + riverConfig: ` + token = "example_access_key_id" + `, + }, + { + testName: "Test2", + expectedHeaderVal: "Bearer example_access_key_id", + riverConfig: ` + token = "example_access_key_id" + scheme = "Bearer" + `, + }, + { + testName: "Test3", + expectedHeaderVal: "MyScheme example_access_key_id", + riverConfig: ` + token = "example_access_key_id" + scheme = "MyScheme" + `, + }, + { + testName: "Test4", + expectedHeaderVal: "example_access_key_id", + riverConfig: ` + token = "example_access_key_id" + scheme = "" + `, + }, + } + + for _, tt := range tests { + // Create an HTTP server which will assert that bearer auth has been injected + // into the request. + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + authHeader := r.Header.Get("Authorization") + assert.Equal(t, tt.expectedHeaderVal, authHeader, "auth header didn't match") + + w.WriteHeader(http.StatusOK) + })) + defer srv.Close() + + ctx := componenttest.TestContext(t) + ctx, cancel := context.WithTimeout(ctx, time.Minute) + defer cancel() + + l := util.TestLogger(t) + + // Create and run our component + ctrl, err := componenttest.NewControllerFromID(l, "otelcol.auth.bearer") + require.NoError(t, err) + + var args bearer.Arguments + require.NoError(t, river.Unmarshal([]byte(tt.riverConfig), &args)) + + go func() { + err := ctrl.Run(ctx, args) + require.NoError(t, err) + }() + + require.NoError(t, ctrl.WaitRunning(time.Second), "component never started") + require.NoError(t, ctrl.WaitExports(time.Second), "component never exported anything") + + // Get the authentication extension from our component and use it to make a + // request to our test server. + exports := ctrl.Exports().(auth.Exports) + require.NotNil(t, exports.Handler.Extension, "handler extension is nil") + + clientAuth, ok := exports.Handler.Extension.(extauth.Client) + require.True(t, ok, "handler does not implement configauth.ClientAuthenticator") + + rt, err := clientAuth.RoundTripper(http.DefaultTransport) + require.NoError(t, err) + cli := &http.Client{Transport: rt} + + // Wait until the request finishes. We don't assert anything else here; our + // HTTP handler won't write the response until it ensures that the bearer + // auth was found. + req, err := http.NewRequestWithContext(ctx, http.MethodGet, srv.URL, nil) require.NoError(t, err) - }() - - require.NoError(t, ctrl.WaitRunning(time.Second), "component never started") - require.NoError(t, ctrl.WaitExports(time.Second), "component never exported anything") - - // Get the authentication extension from our component and use it to make a - // request to our test server. - exports := ctrl.Exports().(auth.Exports) - require.NotNil(t, exports.Handler.Extension, "handler extension is nil") - - clientAuth, ok := exports.Handler.Extension.(configauth.ClientAuthenticator) - require.True(t, ok, "handler does not implement configauth.ClientAuthenticator") - - rt, err := clientAuth.RoundTripper(http.DefaultTransport) - require.NoError(t, err) - cli := &http.Client{Transport: rt} - - // Wait until the request finishes. We don't assert anything else here; our - // HTTP handler won't write the response until it ensures that the bearer - // auth was found. - req, err := http.NewRequestWithContext(ctx, http.MethodGet, srv.URL, nil) - require.NoError(t, err) - resp, err := cli.Do(req) - require.NoError(t, err, "HTTP request failed") - require.Equal(t, http.StatusOK, resp.StatusCode) + resp, err := cli.Do(req) + require.NoError(t, err, "HTTP request failed") + require.Equal(t, http.StatusOK, resp.StatusCode) + } } diff --git a/component/otelcol/auth/headers/headers.go b/component/otelcol/auth/headers/headers.go index 304b8eca8ee2..4f470bb38ff3 100644 --- a/component/otelcol/auth/headers/headers.go +++ b/component/otelcol/auth/headers/headers.go @@ -9,7 +9,7 @@ import ( "github.com/grafana/agent/pkg/river/rivertypes" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -33,7 +33,7 @@ type Arguments struct { var _ auth.Arguments = Arguments{} // Convert implements auth.Arguments. -func (args Arguments) Convert() (otelconfig.Extension, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { var upstreamHeaders []headerssetterextension.HeaderConfig for _, h := range args.Headers { upstreamHeader := headerssetterextension.HeaderConfig{ @@ -51,18 +51,17 @@ func (args Arguments) Convert() (otelconfig.Extension, error) { } return &headerssetterextension.Config{ - ExtensionSettings: otelconfig.NewExtensionSettings(otelconfig.NewComponentID("headers")), - HeadersConfig: upstreamHeaders, + HeadersConfig: upstreamHeaders, }, nil } // Extensions implements auth.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements auth.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/auth/headers/headers_test.go b/component/otelcol/auth/headers/headers_test.go index f0717a3f857f..66a60d8ea427 100644 --- a/component/otelcol/auth/headers/headers_test.go +++ b/component/otelcol/auth/headers/headers_test.go @@ -14,7 +14,7 @@ import ( "github.com/grafana/agent/pkg/util" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/config/configauth" + extauth "go.opentelemetry.io/collector/extension/auth" ) // Test performs a basic integration test which runs the otelcol.auth.headers @@ -62,7 +62,7 @@ func Test(t *testing.T) { exports := ctrl.Exports().(auth.Exports) require.NotNil(t, exports.Handler.Extension, "handler extension is nil") - clientAuth, ok := exports.Handler.Extension.(configauth.ClientAuthenticator) + clientAuth, ok := exports.Handler.Extension.(extauth.Client) require.True(t, ok, "handler does not implement configauth.ClientAuthenticator") rt, err := clientAuth.RoundTripper(http.DefaultTransport) diff --git a/component/otelcol/auth/oauth2/oauth2.go b/component/otelcol/auth/oauth2/oauth2.go index 9554fb72b39c..47e2c102fff6 100644 --- a/component/otelcol/auth/oauth2/oauth2.go +++ b/component/otelcol/auth/oauth2/oauth2.go @@ -9,7 +9,8 @@ import ( "github.com/grafana/agent/component/otelcol/auth" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/config/configopaque" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -39,25 +40,24 @@ type Arguments struct { var _ auth.Arguments = Arguments{} // Convert implements auth.Arguments. -func (args Arguments) Convert() (otelconfig.Extension, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &oauth2clientauthextension.Config{ - ExtensionSettings: otelconfig.NewExtensionSettings(otelconfig.NewComponentID("oauth2")), - ClientID: args.ClientID, - ClientSecret: args.ClientSecret, - TokenURL: args.TokenURL, - EndpointParams: args.EndpointParams, - Scopes: args.Scopes, - TLSSetting: *args.TLSSetting.Convert(), - Timeout: args.Timeout, + ClientID: args.ClientID, + ClientSecret: configopaque.String(args.ClientSecret), + TokenURL: args.TokenURL, + EndpointParams: args.EndpointParams, + Scopes: args.Scopes, + TLSSetting: *args.TLSSetting.Convert(), + Timeout: args.Timeout, }, nil } // Extensions implements auth.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements auth.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/auth/oauth2/oauth2_test.go b/component/otelcol/auth/oauth2/oauth2_test.go index 1d5dcdc9c7a8..37cc2fb5dd9e 100644 --- a/component/otelcol/auth/oauth2/oauth2_test.go +++ b/component/otelcol/auth/oauth2/oauth2_test.go @@ -14,7 +14,7 @@ import ( "github.com/grafana/agent/pkg/river" "github.com/grafana/agent/pkg/util" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/config/configauth" + extauth "go.opentelemetry.io/collector/extension/auth" "gotest.tools/assert" ) @@ -114,7 +114,7 @@ func Test(t *testing.T) { exports := ctrl.Exports().(auth.Exports) require.NotNil(t, exports.Handler.Extension, "handler extension is nil") - clientAuth, ok := exports.Handler.Extension.(configauth.ClientAuthenticator) + clientAuth, ok := exports.Handler.Extension.(extauth.Client) require.True(t, ok, "handler does not implement configauth.ClientAuthenticator") rt, err := clientAuth.RoundTripper(http.DefaultTransport) diff --git a/component/otelcol/auth/sigv4/sigv4.go b/component/otelcol/auth/sigv4/sigv4.go index d4e26039805f..0a3db55c546b 100644 --- a/component/otelcol/auth/sigv4/sigv4.go +++ b/component/otelcol/auth/sigv4/sigv4.go @@ -5,7 +5,7 @@ import ( "github.com/grafana/agent/component/otelcol/auth" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -33,12 +33,11 @@ var ( ) // Convert implements auth.Arguments. -func (args Arguments) Convert() (otelconfig.Extension, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { res := sigv4authextension.Config{ - ExtensionSettings: otelconfig.NewExtensionSettings(otelconfig.NewComponentID("sigv4")), - Region: args.Region, - Service: args.Service, - AssumeRole: *args.AssumeRole.Convert(), + Region: args.Region, + Service: args.Service, + AssumeRole: *args.AssumeRole.Convert(), } // sigv4authextension.Config has a private member called "credsProvider" which gets initialized when we call Validate(). // If we don't call validate, the unit tests for this component will fail. @@ -55,12 +54,12 @@ func (args Arguments) Validate() error { } // Extensions implements auth.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements auth.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/auth/sigv4/sigv4_test.go b/component/otelcol/auth/sigv4/sigv4_test.go index 16f593ab0b6d..a48ec525e971 100644 --- a/component/otelcol/auth/sigv4/sigv4_test.go +++ b/component/otelcol/auth/sigv4/sigv4_test.go @@ -16,7 +16,7 @@ import ( "github.com/grafana/agent/pkg/util" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/config/configauth" + extauth "go.opentelemetry.io/collector/extension/auth" ) // Test performs a basic integration test which runs the otelcol.auth.sigv4 @@ -175,7 +175,7 @@ func Test(t *testing.T) { exports := ctrl.Exports().(auth.Exports) require.NotNil(t, exports.Handler.Extension, "handler extension is nil") - clientAuth, ok := exports.Handler.Extension.(configauth.ClientAuthenticator) + clientAuth, ok := exports.Handler.Extension.(extauth.Client) require.True(t, ok, "handler does not implement configauth.ClientAuthenticator") rt, err := clientAuth.RoundTripper(http.DefaultTransport) diff --git a/component/otelcol/config_filter.go b/component/otelcol/config_filter.go index 9661251efdf2..d3199b9ebdb0 100644 --- a/component/otelcol/config_filter.go +++ b/component/otelcol/config_filter.go @@ -241,8 +241,8 @@ var ( _ encoding.TextUnmarshaler = (*SeverityLevel)(nil) ) -// The severity levels should be in sync with "opentelemetry-collector/pdata/plog/logs.go" -var severityLevels = map[SeverityLevel]int32{ +// The severity levels should be in sync with "opentelemetry-collector/pdata/plog/severity_number.go" +var severityLevels = map[SeverityLevel]plog.SeverityNumber{ "TRACE": 1, "TRACE2": 2, "TRACE3": 3, @@ -271,14 +271,10 @@ var severityLevels = map[SeverityLevel]int32{ // UnmarshalText implements encoding.TextUnmarshaler for SeverityLevel. func (sl *SeverityLevel) UnmarshalText(text []byte) error { - if numVal, exists := severityLevels[SeverityLevel(text)]; exists { - // Check if this is a valid plog severity number - plogInt := plog.SeverityNumber(numVal) - plogStr := plogInt.String() - if plogStr == "SEVERITY_NUMBER_"+string(text) { - *sl = SeverityLevel(text) - return nil - } + agentSevLevelStr := SeverityLevel(text) + if _, exists := severityLevels[agentSevLevelStr]; exists { + *sl = agentSevLevelStr + return nil } return fmt.Errorf("unrecognized severity level %q", string(text)) } diff --git a/component/otelcol/config_filter_test.go b/component/otelcol/config_filter_test.go index e794b107f61a..dbb78dd1687c 100644 --- a/component/otelcol/config_filter_test.go +++ b/component/otelcol/config_filter_test.go @@ -6,6 +6,7 @@ import ( "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/pkg/river" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/pdata/plog" "k8s.io/utils/pointer" ) @@ -77,7 +78,7 @@ func TestConvertMatchProperties(t *testing.T) { }, "log_bodies": []string{"AUTH.*"}, "log_severity_number": map[string]interface{}{ - "min": int32(2), + "min": plog.SeverityNumber(2), "match_undefined": true, }, "log_severity_texts": []string{ @@ -200,6 +201,13 @@ func TestUnmarshalSeverityLevel(t *testing.T) { match_undefined = true `, }, + { + name: "valid INFO config without matching undefined", + cfg: ` + min = "INFO" + match_undefined = false + `, + }, { name: "valid WARN config", cfg: ` @@ -258,3 +266,42 @@ func TestUnmarshalSeverityLevel(t *testing.T) { }) } } + +func TestUnmarshalSeverityLevelString(t *testing.T) { + for _, sevLevelStr := range []string{ + "TRACE", + "TRACE2", + "TRACE3", + "TRACE4", + "DEBUG", + "DEBUG2", + "DEBUG3", + "DEBUG4", + "INFO", + "INFO2", + "INFO3", + "INFO4", + "WARN", + "WARN2", + "WARN3", + "WARN4", + "ERROR", + "ERROR2", + "ERROR3", + "ERROR4", + "FATAL", + "FATAL2", + "FATAL3", + "FATAL4", + } { + sevLevelStr := sevLevelStr + + t.Run(sevLevelStr, func(t *testing.T) { + t.Parallel() + + var sl otelcol.SeverityLevel + require.NoError(t, sl.UnmarshalText([]byte(sevLevelStr))) + require.Equal(t, sevLevelStr, string(sl)) + }) + } +} diff --git a/component/otelcol/config_grpc.go b/component/otelcol/config_grpc.go index ede394b5feac..9852d40dbd0c 100644 --- a/component/otelcol/config_grpc.go +++ b/component/otelcol/config_grpc.go @@ -6,10 +6,11 @@ import ( "github.com/alecthomas/units" "github.com/grafana/agent/component/otelcol/auth" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" otelconfigauth "go.opentelemetry.io/collector/config/configauth" otelconfiggrpc "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/config/confignet" + "go.opentelemetry.io/collector/config/configopaque" + otelextension "go.opentelemetry.io/collector/extension" ) // GRPCServerArguments holds shared gRPC settings for components which launch @@ -153,6 +154,11 @@ func (args *GRPCClientArguments) Convert() *otelconfiggrpc.GRPCClientSettings { return nil } + opaqueHeaders := make(map[string]configopaque.String) + for headerName, headerVal := range args.Headers { + opaqueHeaders[headerName] = configopaque.String(headerVal) + } + // Configure the authentication if args.Auth is set. var auth *otelconfigauth.Authentication if args.Auth != nil { @@ -170,7 +176,7 @@ func (args *GRPCClientArguments) Convert() *otelconfiggrpc.GRPCClientSettings { ReadBufferSize: int(args.ReadBufferSize), WriteBufferSize: int(args.WriteBufferSize), WaitForReady: args.WaitForReady, - Headers: args.Headers, + Headers: opaqueHeaders, BalancerName: args.BalancerName, Auth: auth, @@ -178,8 +184,8 @@ func (args *GRPCClientArguments) Convert() *otelconfiggrpc.GRPCClientSettings { } // Extensions exposes extensions used by args. -func (args *GRPCClientArguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { - m := make(map[otelconfig.ComponentID]otelcomponent.Extension) +func (args *GRPCClientArguments) Extensions() map[otelcomponent.ID]otelextension.Extension { + m := make(map[otelcomponent.ID]otelextension.Extension) if args.Auth != nil { m[args.Auth.ID] = args.Auth.Extension } diff --git a/component/otelcol/config_http.go b/component/otelcol/config_http.go index 7ecdbb402771..13ddaf306996 100644 --- a/component/otelcol/config_http.go +++ b/component/otelcol/config_http.go @@ -6,9 +6,10 @@ import ( "github.com/alecthomas/units" "github.com/grafana/agent/component/otelcol/auth" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" otelconfigauth "go.opentelemetry.io/collector/config/configauth" otelconfighttp "go.opentelemetry.io/collector/config/confighttp" + "go.opentelemetry.io/collector/config/configopaque" + otelextension "go.opentelemetry.io/collector/extension" ) // HTTPServerArguments holds shared settings for components which launch HTTP @@ -106,6 +107,11 @@ func (args *HTTPClientArguments) Convert() *otelconfighttp.HTTPClientSettings { auth = &otelconfigauth.Authentication{AuthenticatorID: args.Auth.ID} } + opaqueHeaders := make(map[string]configopaque.String) + for headerName, headerVal := range args.Headers { + opaqueHeaders[headerName] = configopaque.String(headerVal) + } + return &otelconfighttp.HTTPClientSettings{ Endpoint: args.Endpoint, @@ -116,7 +122,7 @@ func (args *HTTPClientArguments) Convert() *otelconfighttp.HTTPClientSettings { ReadBufferSize: int(args.ReadBufferSize), WriteBufferSize: int(args.WriteBufferSize), Timeout: args.Timeout, - Headers: args.Headers, + Headers: opaqueHeaders, // CustomRoundTripper: func(http.RoundTripper) (http.RoundTripper, error) { panic("not implemented") }, TODO (@tpaschalis) MaxIdleConns: args.MaxIdleConns, MaxIdleConnsPerHost: args.MaxIdleConnsPerHost, @@ -128,8 +134,8 @@ func (args *HTTPClientArguments) Convert() *otelconfighttp.HTTPClientSettings { } // Extensions exposes extensions used by args. -func (args *HTTPClientArguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { - m := make(map[otelconfig.ComponentID]otelcomponent.Extension) +func (args *HTTPClientArguments) Extensions() map[otelcomponent.ID]otelextension.Extension { + m := make(map[otelcomponent.ID]otelextension.Extension) if args.Auth != nil { m[args.Auth.ID] = args.Auth.Extension } diff --git a/component/otelcol/config_tls.go b/component/otelcol/config_tls.go index 550c4f71354e..af482ba8d90d 100644 --- a/component/otelcol/config_tls.go +++ b/component/otelcol/config_tls.go @@ -5,6 +5,7 @@ import ( "time" "github.com/grafana/agent/pkg/river/rivertypes" + "go.opentelemetry.io/collector/config/configopaque" otelconfigtls "go.opentelemetry.io/collector/config/configtls" ) @@ -70,11 +71,11 @@ func (args *TLSSetting) Convert() *otelconfigtls.TLSSetting { } return &otelconfigtls.TLSSetting{ - CAPem: []byte(args.CA), + CAPem: configopaque.String(args.CA), CAFile: args.CAFile, - CertPem: []byte(args.Cert), + CertPem: configopaque.String(args.Cert), CertFile: args.CertFile, - KeyPem: []byte(string(args.Key)), + KeyPem: configopaque.String(string(args.Key)), KeyFile: args.KeyFile, MinVersion: args.MinVersion, MaxVersion: args.MaxVersion, diff --git a/component/otelcol/exporter/exporter.go b/component/otelcol/exporter/exporter.go index b7f03bd61088..d2421e87a580 100644 --- a/component/otelcol/exporter/exporter.go +++ b/component/otelcol/exporter/exporter.go @@ -16,7 +16,8 @@ import ( "github.com/grafana/agent/pkg/util/zapadapter" "github.com/prometheus/client_golang/prometheus" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelexporter "go.opentelemetry.io/collector/exporter" + otelextension "go.opentelemetry.io/collector/extension" sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/sdk/metric" @@ -30,15 +31,15 @@ type Arguments interface { // Convert converts the Arguments into an OpenTelemetry Collector exporter // configuration. - Convert() (otelconfig.Exporter, error) + Convert() (otelcomponent.Config, error) // Extensions returns the set of extensions that the configured component is // allowed to use. - Extensions() map[otelconfig.ComponentID]otelcomponent.Extension + Extensions() map[otelcomponent.ID]otelextension.Extension // Exporters returns the set of exporters that are exposed to the configured // component. - Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter + Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component } // Exporter is a Flow component shim which manages an OpenTelemetry Collector @@ -48,7 +49,7 @@ type Exporter struct { cancel context.CancelFunc opts component.Options - factory otelcomponent.ExporterFactory + factory otelexporter.Factory consumer *lazyconsumer.Consumer sched *scheduler.Scheduler @@ -66,7 +67,7 @@ var ( // // The registered component must be registered to export the // otelcol.ConsumerExports type, otherwise New will panic. -func New(opts component.Options, f otelcomponent.ExporterFactory, args Arguments) (*Exporter, error) { +func New(opts component.Options, f otelexporter.Factory, args Arguments) (*Exporter, error) { ctx, cancel := context.WithCancel(context.Background()) consumer := lazyconsumer.New(ctx) @@ -126,7 +127,7 @@ func (e *Exporter) Update(args component.Arguments) error { return err } - settings := otelcomponent.ExporterCreateSettings{ + settings := otelexporter.CreateSettings{ TelemetrySettings: otelcomponent.TelemetrySettings{ Logger: zapadapter.New(e.opts.Logger), diff --git a/component/otelcol/exporter/exporter_test.go b/component/otelcol/exporter/exporter_test.go index 815c3b28caa0..7f37896b17be 100644 --- a/component/otelcol/exporter/exporter_test.go +++ b/component/otelcol/exporter/exporter_test.go @@ -13,8 +13,9 @@ import ( "github.com/grafana/agent/pkg/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" otelconsumer "go.opentelemetry.io/collector/consumer" + otelexporter "go.opentelemetry.io/collector/exporter" + otelextension "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/pdata/ptrace" ) @@ -90,14 +91,14 @@ func newTestEnvironment(t *testing.T, fe *fakeExporter) *testEnvironment { Build: func(opts component.Options, args component.Arguments) (component.Component, error) { // Create a factory which always returns our instance of fakeExporter // defined above. - factory := otelcomponent.NewExporterFactory( + factory := otelexporter.NewFactory( "testcomponent", - func() otelconfig.Exporter { + func() otelcomponent.Config { res, err := fakeExporterArgs{}.Convert() require.NoError(t, err) return res }, - otelcomponent.WithTracesExporter(func(ctx context.Context, ecs otelcomponent.ExporterCreateSettings, e otelconfig.Exporter) (otelcomponent.TracesExporter, error) { + otelexporter.WithTraces(func(ctx context.Context, ecs otelexporter.CreateSettings, e otelcomponent.Config) (otelexporter.Traces, error) { return fe, nil }, otelcomponent.StabilityLevelUndefined), ) @@ -125,16 +126,15 @@ type fakeExporterArgs struct { var _ exporter.Arguments = fakeExporterArgs{} -func (fa fakeExporterArgs) Convert() (otelconfig.Exporter, error) { - settings := otelconfig.NewExporterSettings(otelconfig.NewComponentID("testcomponent")) - return &settings, nil +func (fa fakeExporterArgs) Convert() (otelcomponent.Config, error) { + return &struct{}{}, nil } -func (fa fakeExporterArgs) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (fa fakeExporterArgs) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } -func (fa fakeExporterArgs) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (fa fakeExporterArgs) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } @@ -145,7 +145,7 @@ type fakeExporter struct { ConsumeTracesFunc func(ctx context.Context, td ptrace.Traces) error } -var _ otelcomponent.TracesExporter = (*fakeExporter)(nil) +var _ otelconsumer.Traces = (*fakeExporter)(nil) func (fe *fakeExporter) Start(ctx context.Context, host otelcomponent.Host) error { if fe.StartFunc != nil { diff --git a/component/otelcol/exporter/jaeger/jaeger.go b/component/otelcol/exporter/jaeger/jaeger.go index c6f75028ad6b..29fdce5548f7 100644 --- a/component/otelcol/exporter/jaeger/jaeger.go +++ b/component/otelcol/exporter/jaeger/jaeger.go @@ -9,8 +9,8 @@ import ( "github.com/grafana/agent/component/otelcol/exporter" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" otelpexporterhelper "go.opentelemetry.io/collector/exporter/exporterhelper" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -54,9 +54,8 @@ func (args *Arguments) SetToDefault() { } // Convert implements exporter.Arguments. -func (args Arguments) Convert() (otelconfig.Exporter, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &jaegerexporter.Config{ - ExporterSettings: otelconfig.NewExporterSettings(otelconfig.NewComponentID("jaeger")), TimeoutSettings: otelpexporterhelper.TimeoutSettings{ Timeout: args.Timeout, }, @@ -67,12 +66,12 @@ func (args Arguments) Convert() (otelconfig.Exporter, error) { } // Extensions implements exporter.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return (*otelcol.GRPCClientArguments)(&args.Client).Extensions() } // Exporters implements exporter.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/exporter/logging/logging.go b/component/otelcol/exporter/logging/logging.go index 74c3b64c2d68..1e717ad89d1b 100644 --- a/component/otelcol/exporter/logging/logging.go +++ b/component/otelcol/exporter/logging/logging.go @@ -6,9 +6,9 @@ import ( "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/exporter" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configtelemetry" loggingexporter "go.opentelemetry.io/collector/exporter/loggingexporter" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -48,9 +48,8 @@ func (args *Arguments) SetToDefault() { } // Convert implements exporter.Arguments. -func (args Arguments) Convert() (otelconfig.Exporter, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &loggingexporter.Config{ - ExporterSettings: otelconfig.NewExporterSettings(otelconfig.NewComponentID("logging")), Verbosity: args.Verbosity, SamplingInitial: args.SamplingInitial, SamplingThereafter: args.SamplingInitial, @@ -58,11 +57,11 @@ func (args Arguments) Convert() (otelconfig.Exporter, error) { } // Extensions implements exporter.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements exporter.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/exporter/loki/internal/convert/convert.go b/component/otelcol/exporter/loki/internal/convert/convert.go index 4db7b089c45b..40b7bea95e18 100644 --- a/component/otelcol/exporter/loki/internal/convert/convert.go +++ b/component/otelcol/exporter/loki/internal/convert/convert.go @@ -10,16 +10,14 @@ package convert import ( "context" - "fmt" - "strings" "sync" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" + loki_translator "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki" "github.com/prometheus/client_golang/prometheus" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" ) @@ -65,34 +63,11 @@ func (conv *Converter) ConsumeLogs(ctx context.Context, ld plog.Logs) error { ills := rls.At(i).ScopeLogs() for j := 0; j < ills.Len(); j++ { logs := ills.At(j).LogRecords() + scope := ills.At(j).Scope() for k := 0; k < logs.Len(); k++ { conv.metrics.entriesTotal.Inc() - // we may remove attributes, so to avoid mutating the original - // log entry, we make our own copy and change that instead. - log := plog.NewLogRecord() - logs.At(k).CopyTo(log) - - // similarly, we may remove resources, so to avoid mutating the - // original log entry, we make and use our own copy instead. - resource := pcommon.NewResource() - rls.At(i).Resource().CopyTo(resource) - - // adds level attribute from log.severityNumber - addLogLevelAttributeAndHint(log) - - // TODO (@tpaschalis) If we want to pre-populate a tenant - // label from the OTel hint, it should happen here. with the - // upstream getTenantFromTenantHint helper. - - format := getFormatFromFormatHint(log.Attributes(), resource.Attributes()) - - mergedLabels := convertAttributesAndMerge(log.Attributes(), resource.Attributes()) - // remove the attributes that were promoted to labels - removeAttributes(log.Attributes(), mergedLabels) - removeAttributes(resource.Attributes(), mergedLabels) - - entry, err := convertLogToLokiEntry(log, resource, format) + entry, err := loki_translator.LogToLokiEntry(logs.At(k), rls.At(i).Resource(), scope) if err != nil { level.Error(conv.log).Log("msg", "failed to convert log to loki entry", "err", err) conv.metrics.entriesFailed.Inc() @@ -101,8 +76,8 @@ func (conv *Converter) ConsumeLogs(ctx context.Context, ld plog.Logs) error { conv.metrics.entriesProcessed.Inc() entries = append(entries, loki.Entry{ - Labels: mergedLabels, - Entry: *entry, + Labels: entry.Labels, + Entry: *entry.Entry, }) } } @@ -130,63 +105,3 @@ func (conv *Converter) UpdateFanout(fanout []loki.LogsReceiver) { conv.next = fanout } - -func addLogLevelAttributeAndHint(log plog.LogRecord) { - if log.SeverityNumber() == plog.SeverityNumberUnspecified { - return - } - addHint(log) - if _, found := log.Attributes().Get(levelAttributeName); !found { - level := severityNumberToLevel[log.SeverityNumber().String()] - log.Attributes().PutStr(levelAttributeName, level) - } -} - -func addHint(log plog.LogRecord) { - if value, found := log.Attributes().Get(hintAttributes); found && !strings.Contains(value.AsString(), levelAttributeName) { - log.Attributes().PutStr(hintAttributes, fmt.Sprintf("%s,%s", value.AsString(), levelAttributeName)) - } else { - log.Attributes().PutStr(hintAttributes, levelAttributeName) - } -} - -var severityNumberToLevel = map[string]string{ - plog.SeverityNumberUnspecified.String(): "UNSPECIFIED", - plog.SeverityNumberTrace.String(): "TRACE", - plog.SeverityNumberTrace2.String(): "TRACE2", - plog.SeverityNumberTrace3.String(): "TRACE3", - plog.SeverityNumberTrace4.String(): "TRACE4", - plog.SeverityNumberDebug.String(): "DEBUG", - plog.SeverityNumberDebug2.String(): "DEBUG2", - plog.SeverityNumberDebug3.String(): "DEBUG3", - plog.SeverityNumberDebug4.String(): "DEBUG4", - plog.SeverityNumberInfo.String(): "INFO", - plog.SeverityNumberInfo2.String(): "INFO2", - plog.SeverityNumberInfo3.String(): "INFO3", - plog.SeverityNumberInfo4.String(): "INFO4", - plog.SeverityNumberWarn.String(): "WARN", - plog.SeverityNumberWarn2.String(): "WARN2", - plog.SeverityNumberWarn3.String(): "WARN3", - plog.SeverityNumberWarn4.String(): "WARN4", - plog.SeverityNumberError.String(): "ERROR", - plog.SeverityNumberError2.String(): "ERROR2", - plog.SeverityNumberError3.String(): "ERROR3", - plog.SeverityNumberError4.String(): "ERROR4", - plog.SeverityNumberFatal.String(): "FATAL", - plog.SeverityNumberFatal2.String(): "FATAL2", - plog.SeverityNumberFatal3.String(): "FATAL3", - plog.SeverityNumberFatal4.String(): "FATAL4", -} - -func getFormatFromFormatHint(logAttr pcommon.Map, resourceAttr pcommon.Map) string { - format := formatJSON - formatVal, found := resourceAttr.Get(hintFormat) - if !found { - formatVal, found = logAttr.Get(hintFormat) - } - - if found { - format = formatVal.AsString() - } - return format -} diff --git a/component/otelcol/exporter/loki/internal/convert/convert_loki.go b/component/otelcol/exporter/loki/internal/convert/convert_loki.go deleted file mode 100644 index 5280f9422b6e..000000000000 --- a/component/otelcol/exporter/loki/internal/convert/convert_loki.go +++ /dev/null @@ -1,175 +0,0 @@ -package convert - -// This file is a near copy of -// https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.63.0/pkg/translator/loki/convert.go -// -// A copy was made because the upstream package contains some unexported -// definitions. If they're ever made public, our copy can be removed. -// -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "strings" - "time" - - "github.com/grafana/loki/pkg/logproto" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki" - "github.com/prometheus/common/model" - "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/pdata/plog" -) - -const ( - hintAttributes = "loki.attribute.labels" - hintResources = "loki.resource.labels" - hintTenant = "loki.tenant" - hintFormat = "loki.format" - levelAttributeName = "level" -) - -const ( - formatJSON string = "json" - formatLogfmt string = "logfmt" -) - -var defaultExporterLabels = model.LabelSet{"exporter": "OTLP"} -var timeNow = time.Now - -func convertAttributesAndMerge(logAttrs pcommon.Map, resAttrs pcommon.Map) model.LabelSet { - out := defaultExporterLabels - - if resourcesToLabel, found := resAttrs.Get(hintResources); found { - labels := convertAttributesToLabels(resAttrs, resourcesToLabel) - out = out.Merge(labels) - } - - // get the hint from the log attributes, not from the resource - // the value can be a single resource name to use as label - // or a slice of string values - if resourcesToLabel, found := logAttrs.Get(hintResources); found { - labels := convertAttributesToLabels(resAttrs, resourcesToLabel) - out = out.Merge(labels) - } - - if attributesToLabel, found := logAttrs.Get(hintAttributes); found { - labels := convertAttributesToLabels(logAttrs, attributesToLabel) - out = out.Merge(labels) - } - - // get tenant hint from resource attributes, fallback to record attributes - // if it is not found - if resourcesToLabel, found := resAttrs.Get(hintTenant); !found { - if attributesToLabel, found := logAttrs.Get(hintTenant); found { - labels := convertAttributesToLabels(logAttrs, attributesToLabel) - out = out.Merge(labels) - } - } else { - labels := convertAttributesToLabels(resAttrs, resourcesToLabel) - out = out.Merge(labels) - } - - return out -} - -func convertAttributesToLabels(attributes pcommon.Map, attrsToSelect pcommon.Value) model.LabelSet { - out := model.LabelSet{} - - attrs := parseAttributeNames(attrsToSelect) - for _, attr := range attrs { - attr = strings.TrimSpace(attr) - av, ok := attributes.Get(attr) // do we need to trim this? - if ok { - out[model.LabelName(attr)] = model.LabelValue(av.AsString()) - } - } - - return out -} - -func parseAttributeNames(attrsToSelect pcommon.Value) []string { - var out []string - - switch attrsToSelect.Type() { - case pcommon.ValueTypeStr: - out = strings.Split(attrsToSelect.AsString(), ",") - case pcommon.ValueTypeSlice: - as := attrsToSelect.Slice().AsRaw() - for _, a := range as { - out = append(out, fmt.Sprintf("%v", a)) - } - default: - // trying to make the most of bad data - out = append(out, attrsToSelect.AsString()) - } - - return out -} - -func removeAttributes(attrs pcommon.Map, labels model.LabelSet) { - attrs.RemoveIf(func(s string, v pcommon.Value) bool { - if s == hintAttributes || s == hintResources || s == hintTenant || s == hintFormat { - return true - } - - _, exists := labels[model.LabelName(s)] - return exists - }) -} - -func convertLogToJSONEntry(lr plog.LogRecord, res pcommon.Resource) (*logproto.Entry, error) { - line, err := loki.Encode(lr, res) - if err != nil { - return nil, err - } - return &logproto.Entry{ - Timestamp: timestampFromLogRecord(lr), - Line: line, - }, nil -} - -func convertLogToLogfmtEntry(lr plog.LogRecord, res pcommon.Resource) (*logproto.Entry, error) { - line, err := loki.EncodeLogfmt(lr, res) - if err != nil { - return nil, err - } - return &logproto.Entry{ - Timestamp: timestampFromLogRecord(lr), - Line: line, - }, nil -} - -func convertLogToLokiEntry(lr plog.LogRecord, res pcommon.Resource, format string) (*logproto.Entry, error) { - switch format { - case formatJSON: - return convertLogToJSONEntry(lr, res) - case formatLogfmt: - return convertLogToLogfmtEntry(lr, res) - default: - return nil, fmt.Errorf("invalid format %s. Expected one of: %s, %s", format, formatJSON, formatLogfmt) - } -} - -func timestampFromLogRecord(lr plog.LogRecord) time.Time { - if lr.Timestamp() != 0 { - return time.Unix(0, int64(lr.Timestamp())) - } - - if lr.ObservedTimestamp() != 0 { - return time.Unix(0, int64(lr.ObservedTimestamp())) - } - - return time.Unix(0, int64(pcommon.NewTimestampFromTime(timeNow()))) -} diff --git a/component/otelcol/exporter/loki/internal/convert/convert_test.go b/component/otelcol/exporter/loki/internal/convert/convert_test.go deleted file mode 100644 index b4c7ffcba88a..000000000000 --- a/component/otelcol/exporter/loki/internal/convert/convert_test.go +++ /dev/null @@ -1,481 +0,0 @@ -package convert_test - -import ( - "context" - "testing" - "time" - - "github.com/grafana/agent/component/common/loki" - "github.com/grafana/agent/component/otelcol/exporter/loki/internal/convert" - "github.com/grafana/agent/pkg/util" - "github.com/prometheus/client_golang/prometheus" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/pdata/plog" -) - -func TestConverter(t *testing.T) { - tt := []struct { - name string - input string - expectLine string - expectLabels string - expectTimestamp time.Time - }{ - { - name: "log line without format hint", - input: `{ - "resourceLogs": [ - { - "resource": { - "attributes": [ - { - "key": "host.name", - "value": { - "stringValue": "testHost" - } - } - ], - "droppedAttributesCount": 1 - }, - "scopeLogs": [ - { - "scope": { - "name": "name", - "version": "version", - "droppedAttributesCount": 1 - }, - "logRecords": [ - { - "timeUnixNano": "1672827031972869000", - "observedTimeUnixNano": "1672827031972869000", - "severityNumber": 17, - "severityText": "Error", - "body": { - "stringValue": "hello world" - }, - "attributes": [ - { - "key": "sdkVersion", - "value": { - "stringValue": "1.0.1" - } - } - ], - "droppedAttributesCount": 1, - "traceId": "0102030405060708090a0b0c0d0e0f10", - "spanId": "1112131415161718" - } - ], - "schemaUrl": "ScopeLogsSchemaURL" - } - ], - "schemaUrl": "testSchemaURL" - } - ] -}`, - expectLine: `{"body":"hello world","traceid":"0102030405060708090a0b0c0d0e0f10","spanid":"1112131415161718","severity":"Error","attributes":{"sdkVersion":"1.0.1"},"resources":{"host.name":"testHost"}}`, - expectLabels: `{exporter="OTLP", level="ERROR"}`, - expectTimestamp: time.Date(2023, time.January, 4, 10, 10, 31, 972869000, time.UTC), - }, - { - name: "log line with logfmt format hint in resource attributes", - input: `{ - "resourceLogs": [ - { - "resource": { - "attributes": [ - { - "key": "host.name", - "value": { - "stringValue": "testHost" - } - }, - { - "key": "loki.format", - "value": { - "stringValue": "logfmt" - } - } - ], - "droppedAttributesCount": 1 - }, - "scopeLogs": [ - { - "scope": { - "name": "name", - "version": "version", - "droppedAttributesCount": 1 - }, - "logRecords": [ - { - "timeUnixNano": "1672827031972869000", - "observedTimeUnixNano": "1672827031972869000", - "severityNumber": 17, - "severityText": "Error", - "body": { - "stringValue": "msg=\"hello world\"" - }, - "attributes": [ - { - "key": "sdkVersion", - "value": { - "stringValue": "1.0.1" - } - } - ], - "droppedAttributesCount": 1, - "traceId": "0102030405060708090a0b0c0d0e0f10", - "spanId": "1112131415161718" - } - ], - "schemaUrl": "ScopeLogsSchemaURL" - } - ], - "schemaUrl": "testSchemaURL" - } - ] -}`, - expectLine: `msg="hello world" traceID=0102030405060708090a0b0c0d0e0f10 spanID=1112131415161718 severity=Error attribute_sdkVersion=1.0.1 resource_host.name=testHost`, - expectLabels: `{exporter="OTLP", level="ERROR"}`, - expectTimestamp: time.Date(2023, time.January, 4, 10, 10, 31, 972869000, time.UTC), - }, - { - name: "log line with logfmt format hint in log attributes", - input: `{ - "resourceLogs": [ - { - "resource": { - "attributes": [ - { - "key": "host.name", - "value": { - "stringValue": "testHost" - } - } - ], - "droppedAttributesCount": 1 - }, - "scopeLogs": [ - { - "scope": { - "name": "name", - "version": "version", - "droppedAttributesCount": 1 - }, - "logRecords": [ - { - "timeUnixNano": "1672827031972869000", - "observedTimeUnixNano": "1672827031972869000", - "severityNumber": 17, - "severityText": "Error", - "body": { - "stringValue": "msg=\"hello world\"" - }, - "attributes": [ - { - "key": "sdkVersion", - "value": { - "stringValue": "1.0.1" - } - }, - { - "key": "loki.format", - "value": { - "stringValue": "logfmt" - } - } - ], - "droppedAttributesCount": 1, - "traceId": "0102030405060708090a0b0c0d0e0f10", - "spanId": "1112131415161718" - } - ], - "schemaUrl": "ScopeLogsSchemaURL" - } - ], - "schemaUrl": "testSchemaURL" - } - ] -}`, - expectLine: `msg="hello world" traceID=0102030405060708090a0b0c0d0e0f10 spanID=1112131415161718 severity=Error attribute_sdkVersion=1.0.1 resource_host.name=testHost`, - expectLabels: `{exporter="OTLP", level="ERROR"}`, - expectTimestamp: time.Date(2023, time.January, 4, 10, 10, 31, 972869000, time.UTC), - }, - { - name: "resource attributes converted to labels", - input: `{ - "resourceLogs": [ - { - "resource": { - "attributes": [ - { - "key": "host.name", - "value": { - "stringValue": "testHost" - } - }, - { - "key": "loki.resource.labels", - "value": { - "stringValue": "mylabel_1,mylabel_2" - } - }, - { - "key": "mylabel_1", - "value": { - "stringValue": "value_1" - } - }, - { - "key": "mylabel_2", - "value": { - "intValue": "42" - } - }, - { - "key": "mylabel_3", - "value": { - "stringValue": "value_3" - } - } - ], - "droppedAttributesCount": 1 - }, - "scopeLogs": [ - { - "scope": { - "name": "name", - "version": "version", - "droppedAttributesCount": 1 - }, - "logRecords": [ - { - "timeUnixNano": "1672827031972869000", - "observedTimeUnixNano": "1672827031972869000", - "severityNumber": 17, - "severityText": "Error", - "body": { - "stringValue": "msg=\"hello world\"" - }, - "attributes": [ - { - "key": "sdkVersion", - "value": { - "stringValue": "1.0.1" - } - }, - { - "key": "loki.format", - "value": { - "stringValue": "logfmt" - } - } - ], - "droppedAttributesCount": 1, - "traceId": "0102030405060708090a0b0c0d0e0f10", - "spanId": "1112131415161718" - } - ], - "schemaUrl": "ScopeLogsSchemaURL" - } - ], - "schemaUrl": "testSchemaURL" - } - ] -}`, - expectLine: `msg="hello world" traceID=0102030405060708090a0b0c0d0e0f10 spanID=1112131415161718 severity=Error attribute_sdkVersion=1.0.1 resource_host.name=testHost resource_mylabel_3=value_3`, - expectLabels: `{exporter="OTLP", level="ERROR", mylabel_1="value_1", mylabel_2="42"}`, - expectTimestamp: time.Date(2023, time.January, 4, 10, 10, 31, 972869000, time.UTC), - }, - { - name: "log attributes converted to labels", - input: `{ - "resourceLogs": [ - { - "resource": { - "attributes": [ - { - "key": "host.name", - "value": { - "stringValue": "testHost" - } - } - ], - "droppedAttributesCount": 1 - }, - "scopeLogs": [ - { - "scope": { - "name": "name", - "version": "version", - "droppedAttributesCount": 1 - }, - "logRecords": [ - { - "timeUnixNano": "1672827031972869000", - "observedTimeUnixNano": "1672827031972869000", - "severityNumber": 17, - "severityText": "Error", - "body": { - "stringValue": "msg=\"hello world\"" - }, - "attributes": [ - { - "key": "sdkVersion", - "value": { - "stringValue": "1.0.1" - } - }, - { - "key": "loki.format", - "value": { - "stringValue": "logfmt" - } - }, - { - "key": "loki.attribute.labels", - "value": { - "stringValue": "mylabel_1,mylabel_2" - } - }, - { - "key": "mylabel_1", - "value": { - "stringValue": "value_1" - } - }, - { - "key": "mylabel_2", - "value": { - "intValue": "42" - } - }, - { - "key": "mylabel_3", - "value": { - "stringValue": "value_3" - } - } - ], - "droppedAttributesCount": 1, - "traceId": "0102030405060708090a0b0c0d0e0f10", - "spanId": "1112131415161718" - } - ], - "schemaUrl": "ScopeLogsSchemaURL" - } - ], - "schemaUrl": "testSchemaURL" - } - ] -}`, - expectLine: `msg="hello world" traceID=0102030405060708090a0b0c0d0e0f10 spanID=1112131415161718 severity=Error attribute_sdkVersion=1.0.1 attribute_mylabel_3=value_3 resource_host.name=testHost`, - expectLabels: `{exporter="OTLP", level="ERROR", mylabel_1="value_1", mylabel_2="42"}`, - expectTimestamp: time.Date(2023, time.January, 4, 10, 10, 31, 972869000, time.UTC), - }, - { - name: "tenant resource attribute converted to label", - input: `{ - "resourceLogs": [ - { - "resource": { - "attributes": [ - { - "key": "host.name", - "value": { - "stringValue": "testHost" - } - } - ], - "droppedAttributesCount": 1 - }, - "scopeLogs": [ - { - "scope": { - "name": "name", - "version": "version", - "droppedAttributesCount": 1 - }, - "logRecords": [ - { - "timeUnixNano": "1672827031972869000", - "observedTimeUnixNano": "1672827031972869000", - "severityNumber": 17, - "severityText": "Error", - "body": { - "stringValue": "hello world" - }, - "attributes": [ - { - "key": "sdkVersion", - "value": { - "stringValue": "1.0.1" - } - }, - { - "key": "loki.format", - "value": { - "stringValue": "json" - } - }, - { - "key": "loki.tenant", - "value": { - "stringValue": "tenant.id" - } - }, - { - "key": "tenant.id", - "value": { - "stringValue": "tenant_2" - } - } - ], - "droppedAttributesCount": 1, - "traceId": "0102030405060708090a0b0c0d0e0f10", - "spanId": "1112131415161718" - } - ], - "schemaUrl": "ScopeLogsSchemaURL" - } - ], - "schemaUrl": "testSchemaURL" - } - ] -}`, - expectLine: `{"body":"hello world","traceid":"0102030405060708090a0b0c0d0e0f10","spanid":"1112131415161718","severity":"Error","attributes":{"sdkVersion":"1.0.1"},"resources":{"host.name":"testHost"}}`, - expectLabels: `{exporter="OTLP", level="ERROR", tenant.id="tenant_2"}`, - expectTimestamp: time.Date(2023, time.January, 4, 10, 10, 31, 972869000, time.UTC), - }, - } - - decoder := &plog.JSONUnmarshaler{} - for _, tc := range tt { - t.Run(tc.name, func(t *testing.T) { - payload, err := decoder.UnmarshalLogs([]byte(tc.input)) - require.NoError(t, err) - - l := util.TestLogger(t) - ch1, ch2 := loki.NewLogsReceiver(), loki.NewLogsReceiver() - conv := convert.New(l, prometheus.NewRegistry(), []loki.LogsReceiver{ch1, ch2}) - go func() { - require.NoError(t, conv.ConsumeLogs(context.Background(), payload)) - }() - - for i := 0; i < 2; i++ { - select { - case l := <-ch1.Chan(): - require.Equal(t, tc.expectLine, l.Line) - require.Equal(t, tc.expectLabels, l.Labels.String()) - require.Equal(t, tc.expectTimestamp, l.Timestamp.UTC()) - case l := <-ch2.Chan(): - require.Equal(t, tc.expectLine, l.Line) - require.Equal(t, tc.expectLabels, l.Labels.String()) - require.Equal(t, tc.expectTimestamp, l.Timestamp.UTC()) - case <-time.After(time.Second): - require.FailNow(t, "failed waiting for logs") - } - } - }) - } -} diff --git a/component/otelcol/exporter/otlp/otlp.go b/component/otelcol/exporter/otlp/otlp.go index 2b403f5cd237..baf3240af5e2 100644 --- a/component/otelcol/exporter/otlp/otlp.go +++ b/component/otelcol/exporter/otlp/otlp.go @@ -8,9 +8,9 @@ import ( "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/exporter" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" otelpexporterhelper "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/collector/exporter/otlpexporter" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -54,9 +54,8 @@ func (args *Arguments) SetToDefault() { } // Convert implements exporter.Arguments. -func (args Arguments) Convert() (otelconfig.Exporter, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &otlpexporter.Config{ - ExporterSettings: otelconfig.NewExporterSettings(otelconfig.NewComponentID("otlp")), TimeoutSettings: otelpexporterhelper.TimeoutSettings{ Timeout: args.Timeout, }, @@ -67,12 +66,12 @@ func (args Arguments) Convert() (otelconfig.Exporter, error) { } // Extensions implements exporter.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return (*otelcol.GRPCClientArguments)(&args.Client).Extensions() } // Exporters implements exporter.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/exporter/otlp/otlp_test.go b/component/otelcol/exporter/otlp/otlp_test.go index 5a1005b0507d..33ec79901fec 100644 --- a/component/otelcol/exporter/otlp/otlp_test.go +++ b/component/otelcol/exporter/otlp/otlp_test.go @@ -107,6 +107,7 @@ func makeTracesServer(t *testing.T, ch chan ptrace.Traces) string { } type mockTracesReceiver struct { + ptraceotlp.UnimplementedGRPCServer ch chan ptrace.Traces } diff --git a/component/otelcol/exporter/otlphttp/otlphttp.go b/component/otelcol/exporter/otlphttp/otlphttp.go index a6449f2996ba..bbc6d47535d5 100644 --- a/component/otelcol/exporter/otlphttp/otlphttp.go +++ b/component/otelcol/exporter/otlphttp/otlphttp.go @@ -9,8 +9,8 @@ import ( "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/exporter" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/exporter/otlphttpexporter" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -58,9 +58,8 @@ func (args *Arguments) SetToDefault() { } // Convert implements exporter.Arguments. -func (args Arguments) Convert() (otelconfig.Exporter, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &otlphttpexporter.Config{ - ExporterSettings: otelconfig.NewExporterSettings(otelconfig.NewComponentID("otlp")), HTTPClientSettings: *(*otelcol.HTTPClientArguments)(&args.Client).Convert(), QueueSettings: *args.Queue.Convert(), RetrySettings: *args.Retry.Convert(), @@ -71,12 +70,12 @@ func (args Arguments) Convert() (otelconfig.Exporter, error) { } // Extensions implements exporter.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return (*otelcol.HTTPClientArguments)(&args.Client).Extensions() } // Exporters implements exporter.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/exporter/prometheus/internal/convert/convert.go b/component/otelcol/exporter/prometheus/internal/convert/convert.go index d71eb7ac780d..67daf8ba098a 100644 --- a/component/otelcol/exporter/prometheus/internal/convert/convert.go +++ b/component/otelcol/exporter/prometheus/internal/convert/convert.go @@ -161,7 +161,9 @@ func (conv *Converter) getOrCreateResource(res pcommon.Resource) *memorySeries { targetInfoLabels := labels.FromStrings(model.MetricNameLabel, "target_info") var ( - attrs = res.Attributes().Sort() + // There is no need to sort the attributes here. + // The call to lb.Labels below will sort them. + attrs = res.Attributes() jobLabel string instanceLabel string @@ -245,7 +247,9 @@ func (conv *Converter) getOrCreateScope(res *memorySeries, scope pcommon.Instrum ) lb := labels.NewBuilder(scopeInfoLabels) - scope.Attributes().Sort().Range(func(k string, v pcommon.Value) bool { + // There is no need to sort the attributes here. + // The call to lb.Labels below will sort them. + scope.Attributes().Range(func(k string, v pcommon.Value) bool { lb.Set(prometheus.NormalizeLabel(k), v.AsString()) return true }) @@ -341,7 +345,9 @@ func (conv *Converter) getOrCreateSeries(res *memorySeries, scope *memorySeries, lb.Set("otel_scope_version", scope.metadata[scopeVersionLabel]) } - attrs.Sort().Range(func(k string, v pcommon.Value) bool { + // There is no need to sort the attributes here. + // The call to lb.Labels below will sort them. + attrs.Range(func(k string, v pcommon.Value) bool { lb.Set(prometheus.NormalizeLabel(k), v.AsString()) return true }) diff --git a/component/otelcol/extension/extension.go b/component/otelcol/extension/extension.go index fd9b711da590..e9f2d7fad99c 100644 --- a/component/otelcol/extension/extension.go +++ b/component/otelcol/extension/extension.go @@ -16,7 +16,7 @@ import ( "github.com/grafana/agent/pkg/util/zapadapter" "github.com/prometheus/client_golang/prometheus" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/sdk/metric" @@ -30,15 +30,15 @@ type Arguments interface { // Convert converts the Arguments into an OpenTelemetry Collector // extension configuration. - Convert() (otelconfig.Extension, error) + Convert() (otelcomponent.Config, error) // Extensions returns the set of extensions that the configured component is // allowed to use. - Extensions() map[otelconfig.ComponentID]otelcomponent.Extension + Extensions() map[otelcomponent.ID]otelextension.Extension // Exporters returns the set of exporters that are exposed to the configured // component. - Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter + Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component } // Extension is a Flow component shim which manages an OpenTelemetry Collector @@ -48,7 +48,7 @@ type Extension struct { cancel context.CancelFunc opts component.Options - factory otelcomponent.ExtensionFactory + factory otelextension.Factory sched *scheduler.Scheduler collector *lazycollector.Collector @@ -62,7 +62,7 @@ var ( // New creates a new Flow component which encapsulates an OpenTelemetry // Collector extension. args must hold a value of the argument // type registered with the Flow component. -func New(opts component.Options, f otelcomponent.ExtensionFactory, args Arguments) (*Extension, error) { +func New(opts component.Options, f otelextension.Factory, args Arguments) (*Extension, error) { ctx, cancel := context.WithCancel(context.Background()) // Create a lazy collector where metrics from the upstream component will be @@ -112,7 +112,7 @@ func (e *Extension) Update(args component.Arguments) error { return err } - settings := otelcomponent.ExtensionCreateSettings{ + settings := otelextension.CreateSettings{ TelemetrySettings: otelcomponent.TelemetrySettings{ Logger: zapadapter.New(e.opts.Logger), diff --git a/component/otelcol/extension/extension_test.go b/component/otelcol/extension/extension_test.go index 6229ff64aed7..19412b2cecd0 100644 --- a/component/otelcol/extension/extension_test.go +++ b/component/otelcol/extension/extension_test.go @@ -12,7 +12,7 @@ import ( "github.com/grafana/agent/pkg/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" ) func TestExtension(t *testing.T) { @@ -45,14 +45,14 @@ func newTestEnvironment(t *testing.T, onCreated func()) *testEnvironment { Args: fakeExtensionArgs{}, Exports: otelcol.ConsumerExports{}, Build: func(opts component.Options, args component.Arguments) (component.Component, error) { - factory := otelcomponent.NewExtensionFactory( + factory := otelextension.NewFactory( "testcomponent", - func() otelconfig.Extension { return nil }, + func() otelcomponent.Config { return nil }, func( _ context.Context, - _ otelcomponent.ExtensionCreateSettings, - _ otelconfig.Extension, - ) (otelcomponent.Extension, error) { + _ otelextension.CreateSettings, + _ otelcomponent.Config, + ) (otelcomponent.Component, error) { onCreated() return nil, nil @@ -82,15 +82,14 @@ type fakeExtensionArgs struct { var _ extension.Arguments = fakeExtensionArgs{} -func (fa fakeExtensionArgs) Convert() (otelconfig.Extension, error) { - settings := otelconfig.NewExtensionSettings(otelconfig.NewComponentID("testcomponent")) - return &settings, nil +func (fa fakeExtensionArgs) Convert() (otelcomponent.Config, error) { + return &struct{}{}, nil } -func (fa fakeExtensionArgs) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (fa fakeExtensionArgs) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } -func (fa fakeExtensionArgs) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (fa fakeExtensionArgs) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/config.go b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/config.go index 43bd18d5bc71..75e907170263 100644 --- a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/config.go +++ b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/config.go @@ -18,7 +18,6 @@ import ( "errors" "time" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/config/confighttp" ) @@ -32,7 +31,6 @@ var ( // Config has the configuration for the extension enabling the health check // extension, used to report the health status of the service. type Config struct { - config.ExtensionSettings `mapstructure:",squash"` *confighttp.HTTPServerSettings `mapstructure:"http"` *configgrpc.GRPCServerSettings `mapstructure:"grpc"` @@ -55,8 +53,6 @@ type Source struct { Contents string `mapstructure:"contents"` } -var _ config.Extension = (*Config)(nil) - // Validate checks if the extension configuration is valid func (cfg *Config) Validate() error { if cfg.HTTPServerSettings == nil && cfg.GRPCServerSettings == nil { diff --git a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/config_test.go b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/config_test.go index 27b1455eaf67..c208e9f4a7ea 100644 --- a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/config_test.go +++ b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/config_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/config" + otelcomponent "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/confignet" @@ -32,13 +32,12 @@ func TestLoadConfig(t *testing.T) { t.Parallel() tests := []struct { - id config.ComponentID - expected config.Extension + id otelcomponent.ID + expected otelcomponent.Config }{ { - id: config.NewComponentID(typeStr), + id: otelcomponent.NewID(typeStr), expected: &Config{ - ExtensionSettings: config.NewExtensionSettings(config.NewComponentID(typeStr)), HTTPServerSettings: &confighttp.HTTPServerSettings{Endpoint: ":5778"}, GRPCServerSettings: &configgrpc.GRPCServerSettings{NetAddr: confignet.NetAddr{ Endpoint: ":14250", @@ -52,9 +51,8 @@ func TestLoadConfig(t *testing.T) { }, }, { - id: config.NewComponentIDWithName(typeStr, "1"), + id: otelcomponent.NewIDWithName(typeStr, "1"), expected: &Config{ - ExtensionSettings: config.NewExtensionSettings(config.NewComponentID(typeStr)), HTTPServerSettings: &confighttp.HTTPServerSettings{Endpoint: ":5778"}, GRPCServerSettings: &configgrpc.GRPCServerSettings{NetAddr: confignet.NetAddr{ Endpoint: ":14250", @@ -75,8 +73,8 @@ func TestLoadConfig(t *testing.T) { cfg := factory.CreateDefaultConfig() sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, config.UnmarshalExtension(sub, cfg)) - assert.NoError(t, cfg.Validate()) + require.NoError(t, otelcomponent.UnmarshalConfig(sub, cfg)) + assert.NoError(t, otelcomponent.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) }) } diff --git a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/extension.go b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/extension.go index acf4390fa012..e149aecbbb9d 100644 --- a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/extension.go +++ b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/extension.go @@ -22,14 +22,14 @@ import ( "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/strategystore" "github.com/jaegertracing/jaeger/plugin/sampling/strategystore/static" "go.opentelemetry.io/collector/component" + otelextension "go.opentelemetry.io/collector/extension" "go.uber.org/zap" - "google.golang.org/grpc" "github.com/grafana/agent/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/internal" "github.com/grafana/agent/component/otelcol/extension/jaeger_remote_sampling/internal/strategy_store" ) -var _ component.Extension = (*jrsExtension)(nil) +var _ otelextension.Extension = (*jrsExtension)(nil) type jrsExtension struct { cfg *Config @@ -73,11 +73,7 @@ func (jrse *jrsExtension) Start(ctx context.Context, host component.Host) error } if jrse.cfg.Source.Remote != nil { - opts, err := jrse.cfg.Source.Remote.ToDialOptions(host, jrse.telemetry) - if err != nil { - return fmt.Errorf("error while setting up the remote sampling source: %w", err) - } - conn, err := grpc.Dial(jrse.cfg.Source.Remote.Endpoint, opts...) + conn, err := jrse.cfg.Source.Remote.ToClientConn(ctx, host, jrse.telemetry) if err != nil { return fmt.Errorf("error while connecting to the remote sampling source: %w", err) } diff --git a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/factory.go b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/factory.go index 20e39ef6fc02..1699aa7c90d0 100644 --- a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/factory.go +++ b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/factory.go @@ -17,11 +17,11 @@ package jaegerremotesampling import ( "context" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" + otelcomponent "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/confignet" + otelextension "go.opentelemetry.io/collector/extension" ) const ( @@ -30,18 +30,17 @@ const ( ) // NewFactory creates a factory for the OIDC Authenticator extension. -func NewFactory() component.ExtensionFactory { - return component.NewExtensionFactory( +func NewFactory() otelextension.Factory { + return otelextension.NewFactory( typeStr, createDefaultConfig, createExtension, - component.StabilityLevelBeta, + otelcomponent.StabilityLevelBeta, ) } -func createDefaultConfig() config.Extension { +func createDefaultConfig() otelcomponent.Config { return &Config{ - ExtensionSettings: config.NewExtensionSettings(config.NewComponentID(typeStr)), HTTPServerSettings: &confighttp.HTTPServerSettings{ Endpoint: ":5778", }, @@ -55,6 +54,6 @@ func createDefaultConfig() config.Extension { } } -func createExtension(_ context.Context, set component.ExtensionCreateSettings, cfg config.Extension) (component.Extension, error) { +func createExtension(_ context.Context, set otelextension.CreateSettings, cfg otelcomponent.Config) (otelcomponent.Component, error) { return newExtension(cfg.(*Config), set.TelemetrySettings), nil } diff --git a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/factory_test.go b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/factory_test.go index e9aadd4e45af..dc08b4552a4e 100644 --- a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/factory_test.go +++ b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/factory_test.go @@ -20,17 +20,15 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/confignet" - "go.opentelemetry.io/collector/config/configtest" + "go.opentelemetry.io/collector/extension/extensiontest" ) func TestCreateDefaultConfig(t *testing.T) { // prepare and test expected := &Config{ - ExtensionSettings: config.NewExtensionSettings(config.NewComponentID(typeStr)), HTTPServerSettings: &confighttp.HTTPServerSettings{Endpoint: ":5778"}, GRPCServerSettings: &configgrpc.GRPCServerSettings{NetAddr: confignet.NetAddr{ Endpoint: ":14250", @@ -43,13 +41,13 @@ func TestCreateDefaultConfig(t *testing.T) { // verify assert.Equal(t, expected, cfg) - assert.NoError(t, configtest.CheckConfigStruct(cfg)) + assert.NoError(t, componenttest.CheckConfigStruct(cfg)) } func TestCreateExtension(t *testing.T) { cfg := createDefaultConfig().(*Config) - ext, err := createExtension(context.Background(), componenttest.NewNopExtensionCreateSettings(), cfg) + ext, err := createExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) assert.NoError(t, err) assert.NotNil(t, ext) } diff --git a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/internal/grpc.go b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/internal/grpc.go index b0cee22bb0df..4352f6966e8b 100644 --- a/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/internal/grpc.go +++ b/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling/internal/grpc.go @@ -26,7 +26,6 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configgrpc" "go.uber.org/zap" - "google.golang.org/grpc" "google.golang.org/grpc/health" "google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/reflection" @@ -70,11 +69,10 @@ type SamplingGRPCServer struct { } func (s *SamplingGRPCServer) Start(_ context.Context, host component.Host) error { - opts, err := s.settings.ToServerOption(host, s.telemetry) + server, err := s.settings.ToServer(host, s.telemetry) if err != nil { return err } - server := grpc.NewServer(opts...) reflection.Register(server) s.grpcServer = server diff --git a/component/otelcol/extension/jaeger_remote_sampling/internal/strategy_store/constants.go b/component/otelcol/extension/jaeger_remote_sampling/internal/strategy_store/constants.go index cbdfe09ab92d..cb6070f00ce0 100644 --- a/component/otelcol/extension/jaeger_remote_sampling/internal/strategy_store/constants.go +++ b/component/otelcol/extension/jaeger_remote_sampling/internal/strategy_store/constants.go @@ -14,9 +14,7 @@ package strategy_store -import ( - "github.com/jaegertracing/jaeger/thrift-gen/sampling" -) +import "github.com/jaegertracing/jaeger/thrift-gen/sampling" const ( // samplerTypeProbabilistic is the type of sampler that samples traces diff --git a/component/otelcol/extension/jaeger_remote_sampling/internal/strategy_store/strategy_store_test.go b/component/otelcol/extension/jaeger_remote_sampling/internal/strategy_store/strategy_store_test.go index c2d28da4e3b1..f2eb175cdfa2 100644 --- a/component/otelcol/extension/jaeger_remote_sampling/internal/strategy_store/strategy_store_test.go +++ b/component/otelcol/extension/jaeger_remote_sampling/internal/strategy_store/strategy_store_test.go @@ -19,11 +19,10 @@ import ( "fmt" "testing" + "github.com/jaegertracing/jaeger/thrift-gen/sampling" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap" - - "github.com/jaegertracing/jaeger/thrift-gen/sampling" ) // strategiesJSON returns the strategy with diff --git a/component/otelcol/extension/jaeger_remote_sampling/jaeger_remote_sampling.go b/component/otelcol/extension/jaeger_remote_sampling/jaeger_remote_sampling.go index 14973f651ff8..c582f99c9ab8 100644 --- a/component/otelcol/extension/jaeger_remote_sampling/jaeger_remote_sampling.go +++ b/component/otelcol/extension/jaeger_remote_sampling/jaeger_remote_sampling.go @@ -9,7 +9,7 @@ import ( "github.com/grafana/agent/component/otelcol/extension" "github.com/grafana/agent/component/otelcol/extension/jaeger_remote_sampling/internal/jaegerremotesampling" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -67,7 +67,7 @@ var ( ) // Convert implements extension.Arguments. -func (args Arguments) Convert() (otelconfig.Extension, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &jaegerremotesampling.Config{ HTTPServerSettings: (*otelcol.HTTPServerArguments)(args.HTTP).Convert(), GRPCServerSettings: (*otelcol.GRPCServerArguments)(args.GRPC).Convert(), @@ -81,12 +81,12 @@ func (args Arguments) Convert() (otelconfig.Extension, error) { } // Extensions implements extension.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements extension.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/internal/featuregate/install.go b/component/otelcol/internal/featuregate/install.go index fa4bcd70338b..f2d1fdb79545 100644 --- a/component/otelcol/internal/featuregate/install.go +++ b/component/otelcol/internal/featuregate/install.go @@ -17,15 +17,13 @@ import ( // Once all feature gates are removed, this package can be removed as well. func init() { - _ = enableFeatureGates(featuregate.GetRegistry()) + _ = enableFeatureGates(featuregate.GlobalRegistry()) } func enableFeatureGates(reg *featuregate.Registry) error { // TODO(marctc): temporary workaround to fix issue with traces' metrics not // being collected even flow is not enabled. - return reg.Apply(map[string]bool{ - "telemetry.useOtelForInternalMetrics": isFlowRunning(), - }) + return reg.Set("telemetry.useOtelForInternalMetrics", isFlowRunning()) } func isFlowRunning() bool { diff --git a/component/otelcol/internal/featuregate/install_test.go b/component/otelcol/internal/featuregate/install_test.go index ee0cc9bb989e..9a5f22853587 100644 --- a/component/otelcol/internal/featuregate/install_test.go +++ b/component/otelcol/internal/featuregate/install_test.go @@ -8,6 +8,6 @@ import ( ) func Test_enableFeatureGates(t *testing.T) { - err := enableFeatureGates(featuregate.GetRegistry()) + err := enableFeatureGates(featuregate.GlobalRegistry()) require.NoError(t, err, "enableFeatureGates should not have a failed. Did a feature gate get removed from upstream?") } diff --git a/component/otelcol/internal/scheduler/host.go b/component/otelcol/internal/scheduler/host.go index 31763723e9e1..377210660762 100644 --- a/component/otelcol/internal/scheduler/host.go +++ b/component/otelcol/internal/scheduler/host.go @@ -5,15 +5,15 @@ import ( "github.com/go-kit/log/level" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" ) // Host implements otelcomponent.Host for Grafana Agent Flow. type Host struct { log log.Logger - extensions map[otelconfig.ComponentID]otelcomponent.Extension - exporters map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter + extensions map[otelcomponent.ID]otelextension.Extension + exporters map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component } // NewHost creates a new Host. @@ -29,14 +29,14 @@ func NewHost(l log.Logger, opts ...HostOption) *Host { type HostOption func(*Host) // WithHostExtensions provides a custom set of extensions to the Host. -func WithHostExtensions(extensions map[otelconfig.ComponentID]otelcomponent.Extension) HostOption { +func WithHostExtensions(extensions map[otelcomponent.ID]otelextension.Extension) HostOption { return func(h *Host) { h.extensions = extensions } } // WithHostExporters provides a custom set of exporters to the Host. -func WithHostExporters(exporters map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter) HostOption { +func WithHostExporters(exporters map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component) HostOption { return func(h *Host) { h.exporters = exporters } @@ -50,18 +50,18 @@ func (h *Host) ReportFatalError(err error) { } // GetFactory implements otelcomponent.Host. -func (h *Host) GetFactory(kind otelcomponent.Kind, componentType otelconfig.Type) otelcomponent.Factory { +func (h *Host) GetFactory(kind otelcomponent.Kind, componentType otelcomponent.Type) otelcomponent.Factory { // GetFactory is used for components to create other components. It's not // clear if we want to allow this right now, so it's disabled. return nil } // GetExtensions implements otelcomponent.Host. -func (h *Host) GetExtensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (h *Host) GetExtensions() map[otelcomponent.ID]otelextension.Extension { return h.extensions } // GetExporters implements otelcomponent.Host. -func (h *Host) GetExporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (h *Host) GetExporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return h.exporters } diff --git a/component/otelcol/processor/attributes/attributes.go b/component/otelcol/processor/attributes/attributes.go index 24ce5bdae889..93f774e54b55 100644 --- a/component/otelcol/processor/attributes/attributes.go +++ b/component/otelcol/processor/attributes/attributes.go @@ -10,7 +10,7 @@ import ( "github.com/mitchellh/mapstructure" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -44,7 +44,7 @@ var ( ) // Convert implements processor.Arguments. -func (args Arguments) Convert() (otelconfig.Processor, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { input := make(map[string]interface{}) if actions := args.Actions.Convert(); len(actions) > 0 { @@ -78,18 +78,16 @@ func (args Arguments) Convert() (otelconfig.Processor, error) { return nil, err } - result.ProcessorSettings = otelconfig.NewProcessorSettings(otelconfig.NewComponentID("attributes")) - return &result, nil } // Extensions implements processor.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements processor.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/processor/attributes/attributes_test.go b/component/otelcol/processor/attributes/attributes_test.go index c9e8389f0acd..44c6bc63841a 100644 --- a/component/otelcol/processor/attributes/attributes_test.go +++ b/component/otelcol/processor/attributes/attributes_test.go @@ -2,6 +2,7 @@ package attributes_test import ( "context" + "fmt" "net" "testing" "time" @@ -14,6 +15,7 @@ import ( "github.com/grafana/agent/pkg/river" "github.com/grafana/agent/pkg/util" "github.com/grafana/dskit/backoff" + "github.com/mitchellh/mapstructure" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/client" @@ -22,6 +24,89 @@ import ( "go.opentelemetry.io/collector/pdata/ptrace" ) +// These are tests for SeverityLevel and not for the attributes processor as a whole. +// However, because Otel's LogSeverityNumberMatchProperties structure is internal +// we are not able ot test it directly. +// The only way is to create a whole attributesprocessor.Config, because that struct is public. +// This is why the test is in attributes_test.go instead of config_filter_test.go. +func TestSeverityLevelMatchesOtel(t *testing.T) { + type TestDefinition struct { + name string + cfg string + expectedOtelSevStr string + } + + var tests []TestDefinition + + for _, testInfo := range []struct { + agentSevStr string + otelSevStr string + }{ + {"TRACE", "Trace"}, + {"TRACE2", "Trace2"}, + {"TRACE3", "Trace3"}, + {"TRACE4", "Trace4"}, + {"DEBUG", "Debug"}, + {"DEBUG2", "Debug2"}, + {"DEBUG3", "Debug3"}, + {"DEBUG4", "Debug4"}, + {"INFO", "Info"}, + {"INFO2", "Info2"}, + {"INFO3", "Info3"}, + {"INFO4", "Info4"}, + {"WARN", "Warn"}, + {"WARN2", "Warn2"}, + {"WARN3", "Warn3"}, + {"WARN4", "Warn4"}, + {"ERROR", "Error"}, + {"ERROR2", "Error2"}, + {"ERROR3", "Error3"}, + {"ERROR4", "Error4"}, + {"FATAL", "Fatal"}, + {"FATAL2", "Fatal2"}, + {"FATAL3", "Fatal3"}, + {"FATAL4", "Fatal4"}, + } { + cfgTemplate := ` + match_type = "strict" + log_severity { + min = "%s" + match_undefined = true + } + ` + + newTest := TestDefinition{ + name: testInfo.agentSevStr, + cfg: fmt.Sprintf(cfgTemplate, testInfo.agentSevStr), + expectedOtelSevStr: testInfo.otelSevStr, + } + tests = append(tests, newTest) + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + var matchProperties otelcol.MatchProperties + err := river.Unmarshal([]byte(tt.cfg), &matchProperties) + + require.NoError(t, err) + + input := make(map[string]interface{}) + + matchConfig, err := matchProperties.Convert() + require.NoError(t, err) + input["include"] = matchConfig + + var result attributesprocessor.Config + err = mapstructure.Decode(input, &result) + require.NoError(t, err) + + require.Equal(t, tt.expectedOtelSevStr, result.MatchConfig.Include.LogSeverityNumber.Min.String()) + }) + } +} + // A lot of the TestDecode tests were inspired by tests in the Otel repo: // https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.63.0/processor/attributesprocessor/testdata/config.yaml @@ -445,7 +530,7 @@ func Test_Hash(t *testing.T) { }, { "key": "user.email", - "value": { "stringValue": "36687c352204c27d9e228a9b34d00c8a1d36a000" } + "value": { "stringValue": "0925f997eb0d742678f66d2da134d15d842d57722af5f7605c4785cb5358831b" } }] }] }] diff --git a/component/otelcol/processor/batch/batch.go b/component/otelcol/processor/batch/batch.go index f0168ef69061..54a5260134c2 100644 --- a/component/otelcol/processor/batch/batch.go +++ b/component/otelcol/processor/batch/batch.go @@ -9,7 +9,7 @@ import ( "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/processor" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/processor/batchprocessor" ) @@ -60,22 +60,21 @@ func (args *Arguments) Validate() error { } // Convert implements processor.Arguments. -func (args Arguments) Convert() (otelconfig.Processor, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &batchprocessor.Config{ - ProcessorSettings: otelconfig.NewProcessorSettings(otelconfig.NewComponentID("batch")), - Timeout: args.Timeout, - SendBatchSize: args.SendBatchSize, - SendBatchMaxSize: args.SendBatchMaxSize, + Timeout: args.Timeout, + SendBatchSize: args.SendBatchSize, + SendBatchMaxSize: args.SendBatchMaxSize, }, nil } // Extensions implements processor.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements processor.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/processor/memorylimiter/memorylimiter.go b/component/otelcol/processor/memorylimiter/memorylimiter.go index 44251034acd6..edf3bb1016d0 100644 --- a/component/otelcol/processor/memorylimiter/memorylimiter.go +++ b/component/otelcol/processor/memorylimiter/memorylimiter.go @@ -10,7 +10,7 @@ import ( "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/processor" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/processor/memorylimiterprocessor" ) @@ -91,10 +91,8 @@ func (args *Arguments) Validate() error { } // Convert implements processor.Arguments. -func (args Arguments) Convert() (otelconfig.Processor, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &memorylimiterprocessor.Config{ - ProcessorSettings: otelconfig.NewProcessorSettings(otelconfig.NewComponentID("memory_limiter")), - CheckInterval: args.CheckInterval, MemoryLimitMiB: uint32(args.MemoryLimit / units.Mebibyte), MemorySpikeLimitMiB: uint32(args.MemorySpikeLimit / units.Mebibyte), @@ -104,12 +102,12 @@ func (args Arguments) Convert() (otelconfig.Processor, error) { } // Extensions implements processor.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements processor.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/processor/processor.go b/component/otelcol/processor/processor.go index 6bf920d4a317..32dec14352fb 100644 --- a/component/otelcol/processor/processor.go +++ b/component/otelcol/processor/processor.go @@ -17,7 +17,8 @@ import ( "github.com/grafana/agent/pkg/util/zapadapter" "github.com/prometheus/client_golang/prometheus" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" + otelprocessor "go.opentelemetry.io/collector/processor" sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/sdk/metric" @@ -31,15 +32,15 @@ type Arguments interface { // Convert converts the Arguments into an OpenTelemetry Collector processor // configuration. - Convert() (otelconfig.Processor, error) + Convert() (otelcomponent.Config, error) // Extensions returns the set of extensions that the configured component is // allowed to use. - Extensions() map[otelconfig.ComponentID]otelcomponent.Extension + Extensions() map[otelcomponent.ID]otelextension.Extension // Exporters returns the set of exporters that are exposed to the configured // component. - Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter + Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component // NextConsumers returns the set of consumers to send data to. NextConsumers() *otelcol.ConsumerArguments @@ -52,7 +53,7 @@ type Processor struct { cancel context.CancelFunc opts component.Options - factory otelcomponent.ProcessorFactory + factory otelprocessor.Factory consumer *lazyconsumer.Consumer sched *scheduler.Scheduler @@ -70,7 +71,7 @@ var ( // // The registered component must be registered to export the // otelcol.ConsumerExports type, otherwise New will panic. -func New(opts component.Options, f otelcomponent.ProcessorFactory, args Arguments) (*Processor, error) { +func New(opts component.Options, f otelprocessor.Factory, args Arguments) (*Processor, error) { ctx, cancel := context.WithCancel(context.Background()) consumer := lazyconsumer.New(ctx) @@ -130,7 +131,7 @@ func (p *Processor) Update(args component.Arguments) error { return err } - settings := otelcomponent.ProcessorCreateSettings{ + settings := otelprocessor.CreateSettings{ TelemetrySettings: otelcomponent.TelemetrySettings{ Logger: zapadapter.New(p.opts.Logger), @@ -161,7 +162,7 @@ func (p *Processor) Update(args component.Arguments) error { // supported telemetry signals. var components []otelcomponent.Component - var tracesProcessor otelcomponent.TracesProcessor + var tracesProcessor otelprocessor.Traces if len(next.Traces) > 0 { tracesProcessor, err = p.factory.CreateTracesProcessor(p.ctx, settings, processorConfig, nextTraces) if err != nil && !errors.Is(err, otelcomponent.ErrDataTypeIsNotSupported) { @@ -171,7 +172,7 @@ func (p *Processor) Update(args component.Arguments) error { } } - var metricsProcessor otelcomponent.MetricsProcessor + var metricsProcessor otelprocessor.Metrics if len(next.Metrics) > 0 { metricsProcessor, err = p.factory.CreateMetricsProcessor(p.ctx, settings, processorConfig, nextMetrics) if err != nil && !errors.Is(err, otelcomponent.ErrDataTypeIsNotSupported) { @@ -181,7 +182,7 @@ func (p *Processor) Update(args component.Arguments) error { } } - var logsProcessor otelcomponent.LogsProcessor + var logsProcessor otelprocessor.Logs if len(next.Logs) > 0 { logsProcessor, err = p.factory.CreateLogsProcessor(p.ctx, settings, processorConfig, nextLogs) if err != nil && !errors.Is(err, otelcomponent.ErrDataTypeIsNotSupported) { diff --git a/component/otelcol/processor/processor_test.go b/component/otelcol/processor/processor_test.go index 0a760ef7aa04..bebec5b274a9 100644 --- a/component/otelcol/processor/processor_test.go +++ b/component/otelcol/processor/processor_test.go @@ -14,9 +14,10 @@ import ( "github.com/grafana/agent/pkg/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" otelconsumer "go.opentelemetry.io/collector/consumer" + otelextension "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/pdata/ptrace" + otelprocessor "go.opentelemetry.io/collector/processor" ) func TestProcessor(t *testing.T) { @@ -98,7 +99,7 @@ type testEnvironment struct { func newTestEnvironment( t *testing.T, - fp otelcomponent.TracesProcessor, + fp otelprocessor.Traces, onTracesConsumer func(t otelconsumer.Traces), ) *testEnvironment { @@ -111,19 +112,19 @@ func newTestEnvironment( Build: func(opts component.Options, args component.Arguments) (component.Component, error) { // Create a factory which always returns our instance of fakeProcessor // defined above. - factory := otelcomponent.NewProcessorFactory( + factory := otelprocessor.NewFactory( "testcomponent", - func() otelconfig.Processor { + func() otelcomponent.Config { res, err := fakeProcessorArgs{}.Convert() require.NoError(t, err) return res }, - otelcomponent.WithTracesProcessor(func( + otelprocessor.WithTraces(func( _ context.Context, - _ otelcomponent.ProcessorCreateSettings, - _ otelconfig.Processor, + _ otelprocessor.CreateSettings, + _ otelcomponent.Config, t otelconsumer.Traces, - ) (otelcomponent.TracesProcessor, error) { + ) (otelprocessor.Traces, error) { onTracesConsumer(t) return fp, nil @@ -154,16 +155,15 @@ type fakeProcessorArgs struct { var _ processor.Arguments = fakeProcessorArgs{} -func (fa fakeProcessorArgs) Convert() (otelconfig.Processor, error) { - settings := otelconfig.NewProcessorSettings(otelconfig.NewComponentID("testcomponent")) - return &settings, nil +func (fa fakeProcessorArgs) Convert() (otelcomponent.Config, error) { + return &struct{}{}, nil } -func (fa fakeProcessorArgs) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (fa fakeProcessorArgs) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } -func (fa fakeProcessorArgs) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (fa fakeProcessorArgs) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } @@ -178,7 +178,7 @@ type fakeProcessor struct { ConsumeTracesFunc func(ctx context.Context, td ptrace.Traces) error } -var _ otelcomponent.TracesProcessor = (*fakeProcessor)(nil) +var _ otelprocessor.Traces = (*fakeProcessor)(nil) func (fe *fakeProcessor) Start(ctx context.Context, host otelcomponent.Host) error { if fe.StartFunc != nil { diff --git a/component/otelcol/processor/tail_sampling/tail_sampling.go b/component/otelcol/processor/tail_sampling/tail_sampling.go index e91d253d2d7e..60ea4006575a 100644 --- a/component/otelcol/processor/tail_sampling/tail_sampling.go +++ b/component/otelcol/processor/tail_sampling/tail_sampling.go @@ -10,7 +10,7 @@ import ( "github.com/grafana/agent/component/otelcol/processor" tsp "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -66,34 +66,27 @@ func (args *Arguments) Validate() error { } // Convert implements processor.Arguments. -func (args Arguments) Convert() (otelconfig.Processor, error) { - // TODO: Get rid of mapstructure once tailsamplingprocessor.Config has all public types - var otelConfig tsp.Config - +func (args Arguments) Convert() (otelcomponent.Config, error) { var otelPolicyCfgs []tsp.PolicyCfg for _, policyCfg := range args.PolicyCfgs { otelPolicyCfgs = append(otelPolicyCfgs, policyCfg.Convert()) } - mustDecodeMapStructure(map[string]interface{}{ - "decision_wait": args.DecisionWait, - "num_traces": args.NumTraces, - "expected_new_traces_per_sec": args.ExpectedNewTracesPerSec, - "policies": otelPolicyCfgs, - }, &otelConfig) - - otelConfig.ProcessorSettings = otelconfig.NewProcessorSettings(otelconfig.NewComponentID("tail_sampling")) - - return &otelConfig, nil + return &tsp.Config{ + DecisionWait: args.DecisionWait, + NumTraces: args.NumTraces, + ExpectedNewTracesPerSec: args.ExpectedNewTracesPerSec, + PolicyCfgs: otelPolicyCfgs, + }, nil } // Extensions implements processor.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements processor.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/receiver/jaeger/jaeger.go b/component/otelcol/receiver/jaeger/jaeger.go index f0630c77538e..ce8dfd306775 100644 --- a/component/otelcol/receiver/jaeger/jaeger.go +++ b/component/otelcol/receiver/jaeger/jaeger.go @@ -11,9 +11,9 @@ import ( "github.com/grafana/agent/component/otelcol/receiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" otelconfiggrpc "go.opentelemetry.io/collector/config/configgrpc" otelconfighttp "go.opentelemetry.io/collector/config/confighttp" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -55,9 +55,8 @@ func (args *Arguments) Validate() error { } // Convert implements receiver.Arguments. -func (args Arguments) Convert() (otelconfig.Receiver, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &jaegerreceiver.Config{ - ReceiverSettings: otelconfig.NewReceiverSettings(otelconfig.NewComponentID("jaeger")), Protocols: jaegerreceiver.Protocols{ GRPC: args.Protocols.GRPC.Convert(), ThriftHTTP: args.Protocols.ThriftHTTP.Convert(), @@ -69,7 +68,7 @@ func (args Arguments) Convert() (otelconfig.Receiver, error) { } // Extensions implements receiver.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { if args.RemoteSampling == nil { return nil } @@ -77,7 +76,7 @@ func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Exte } // Exporters implements receiver.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/receiver/kafka/kafka.go b/component/otelcol/receiver/kafka/kafka.go index 3dcdd4863c93..af86cbb3a4cc 100644 --- a/component/otelcol/receiver/kafka/kafka.go +++ b/component/otelcol/receiver/kafka/kafka.go @@ -11,7 +11,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -82,10 +82,8 @@ func (args *Arguments) SetToDefault() { } // Convert implements receiver.Arguments. -func (args Arguments) Convert() (otelconfig.Receiver, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &kafkareceiver.Config{ - ReceiverSettings: otelconfig.NewReceiverSettings(otelconfig.NewComponentID("kafka")), - Brokers: args.Brokers, ProtocolVersion: args.ProtocolVersion, Topic: args.Topic, @@ -101,12 +99,12 @@ func (args Arguments) Convert() (otelconfig.Receiver, error) { } // Extensions implements receiver.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements receiver.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/receiver/loki/loki.go b/component/otelcol/receiver/loki/loki.go index 197ed75f46fb..a46296e3f5ba 100644 --- a/component/otelcol/receiver/loki/loki.go +++ b/component/otelcol/receiver/loki/loki.go @@ -13,9 +13,9 @@ import ( "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/internal/fanoutconsumer" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry" + loki_translator "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/plog" ) func init() { @@ -83,11 +83,11 @@ func (c *Component) Run(ctx context.Context) error { case <-ctx.Done(): return nil case entry := <-c.receiver.Chan(): - stanzaEntry := parsePromtailEntry(entry) - plogEntry := adapter.Convert(stanzaEntry) + + logs := convertLokiEntryToPlog(entry) // TODO(@tpaschalis) Is there any more handling to be done here? - err := c.logsSink.ConsumeLogs(ctx, plogEntry) + err := c.logsSink.ConsumeLogs(ctx, logs) if err != nil { level.Error(c.opts.Logger).Log("msg", "failed to consume log entries", "err", err) } @@ -106,34 +106,32 @@ func (c *Component) Update(newConfig component.Arguments) error { return nil } -// parsePromtailEntry creates new stanza.Entry from promtail entry -func parsePromtailEntry(inputEntry loki.Entry) *entry.Entry { - outputEntry := entry.New() - outputEntry.Body = inputEntry.Entry.Line - outputEntry.Timestamp = inputEntry.Entry.Timestamp +// Create a new Otlp Logs entry from a Promtail entry +func convertLokiEntryToPlog(lokiEntry loki.Entry) plog.Logs { + logs := plog.NewLogs() + + lr := logs.ResourceLogs().AppendEmpty().ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + + if filename, exists := lokiEntry.Labels["filename"]; exists { + filenameStr := string(filename) + // The `promtailreceiver` from the opentelemetry-collector-contrib + // repo adds these two labels based on these "semantic conventions + // for log media". + // https://opentelemetry.io/docs/reference/specification/logs/semantic_conventions/media/ + // We're keeping them as well, but we're also adding the `filename` + // attribute so that it can be used from the + // `loki.attribute.labels` hint for when the opposite OTel -> Loki + // transformation happens. + lr.Attributes().PutStr("log.file.path", filenameStr) + lr.Attributes().PutStr("log.file.name", path.Base(filenameStr)) + // TODO(@tpaschalis) Remove the addition of "log.file.path" and "log.file.name", + // because the Collector doesn't do it and we would be more in line with it. + } var lbls []string - for key, val := range inputEntry.Labels { - valStr := string(val) + for key := range lokiEntry.Labels { keyStr := string(key) - switch key { - case "filename": - outputEntry.AddAttribute("filename", valStr) - lbls = append(lbls, "filename") - // The `promtailreceiver` from the opentelemetry-collector-contrib - // repo adds these two labels based on these "semantic conventions - // for log media". - // https://opentelemetry.io/docs/reference/specification/logs/semantic_conventions/media/ - // We're keeping them as well, but we're also adding the `filename` - // attribute so that it can be used from the - // `loki.attribute.labels` hint for when the opposite OTel -> Loki - // transformation happens. - outputEntry.AddAttribute("log.file.path", valStr) - outputEntry.AddAttribute("log.file.name", path.Base(valStr)) - default: - lbls = append(lbls, keyStr) - outputEntry.AddAttribute(keyStr, valStr) - } + lbls = append(lbls, keyStr) } if len(lbls) > 0 { @@ -142,7 +140,10 @@ func parsePromtailEntry(inputEntry loki.Entry) *entry.Entry { // re-define it. // It is used to detect which attributes should be promoted to labels // when transforming back from OTel -> Loki. - outputEntry.AddAttribute(hintAttributes, strings.Join(lbls, ",")) + lr.Attributes().PutStr(hintAttributes, strings.Join(lbls, ",")) } - return outputEntry + + loki_translator.ConvertEntryToLogRecord(&lokiEntry.Entry, &lr, lokiEntry.Labels, true) + + return logs } diff --git a/component/otelcol/receiver/opencensus/opencensus.go b/component/otelcol/receiver/opencensus/opencensus.go index df1498f61cc6..9f3b6cafcb8f 100644 --- a/component/otelcol/receiver/opencensus/opencensus.go +++ b/component/otelcol/receiver/opencensus/opencensus.go @@ -8,7 +8,7 @@ import ( "github.com/grafana/agent/component/otelcol/receiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/extension" ) func init() { @@ -54,22 +54,20 @@ func (args *Arguments) SetToDefault() { } // Convert implements receiver.Arguments. -func (args Arguments) Convert() (otelconfig.Receiver, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &opencensusreceiver.Config{ - ReceiverSettings: otelconfig.NewReceiverSettings(otelconfig.NewComponentID("opencensus")), - CorsOrigins: args.CorsAllowedOrigins, GRPCServerSettings: *args.GRPC.Convert(), }, nil } // Extensions implements receiver.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]extension.Extension { return nil } // Exporters implements receiver.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/receiver/otlp/otlp.go b/component/otelcol/receiver/otlp/otlp.go index 260aaa5574e0..7c6252692c8a 100644 --- a/component/otelcol/receiver/otlp/otlp.go +++ b/component/otelcol/receiver/otlp/otlp.go @@ -7,7 +7,7 @@ import ( "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/receiver" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/receiver/otlpreceiver" ) @@ -35,9 +35,8 @@ type Arguments struct { var _ receiver.Arguments = Arguments{} // Convert implements receiver.Arguments. -func (args Arguments) Convert() (otelconfig.Receiver, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &otlpreceiver.Config{ - ReceiverSettings: otelconfig.NewReceiverSettings(otelconfig.NewComponentID("otlp")), Protocols: otlpreceiver.Protocols{ GRPC: (*otelcol.GRPCServerArguments)(args.GRPC).Convert(), HTTP: (*otelcol.HTTPServerArguments)(args.HTTP).Convert(), @@ -46,12 +45,12 @@ func (args Arguments) Convert() (otelconfig.Receiver, error) { } // Extensions implements receiver.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements receiver.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/receiver/prometheus/internal/appendable.go b/component/otelcol/receiver/prometheus/internal/appendable.go index 7e0a9c4a0ed1..e709bf41a336 100644 --- a/component/otelcol/receiver/prometheus/internal/appendable.go +++ b/component/otelcol/receiver/prometheus/internal/appendable.go @@ -22,9 +22,9 @@ import ( "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/obsreport" + "go.opentelemetry.io/collector/receiver" ) // appendable translates Prometheus scraping diffs into OpenTelemetry format. @@ -35,19 +35,19 @@ type appendable struct { startTimeMetricRegex *regexp.Regexp externalLabels labels.Labels - settings component.ReceiverCreateSettings + settings receiver.CreateSettings obsrecv *obsreport.Receiver } // NewAppendable returns a storage.Appendable instance that emits metrics to the sink. func NewAppendable( sink consumer.Metrics, - set component.ReceiverCreateSettings, + set receiver.CreateSettings, gcInterval time.Duration, useStartTimeMetric bool, startTimeMetricRegex *regexp.Regexp, - receiverID config.ComponentID, - externalLabels labels.Labels) storage.Appendable { + receiverID component.ID, + externalLabels labels.Labels) (storage.Appendable, error) { var metricAdjuster MetricsAdjuster if !useStartTimeMetric { @@ -56,6 +56,11 @@ func NewAppendable( metricAdjuster = NewStartTimeMetricAdjuster(set.Logger, startTimeMetricRegex) } + obsrecv, err := obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: receiverID, Transport: transport, ReceiverCreateSettings: set}) + if err != nil { + return nil, err + } + return &appendable{ sink: sink, settings: set, @@ -63,8 +68,8 @@ func NewAppendable( useStartTimeMetric: useStartTimeMetric, startTimeMetricRegex: startTimeMetricRegex, externalLabels: externalLabels, - obsrecv: obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: receiverID, Transport: transport, ReceiverCreateSettings: set}), - } + obsrecv: obsrecv, + }, nil } func (o *appendable) Appender(ctx context.Context) storage.Appender { diff --git a/component/otelcol/receiver/prometheus/internal/metrics_adjuster.go b/component/otelcol/receiver/prometheus/internal/metrics_adjuster.go index 4add5fd9f157..1c0df5817a5b 100644 --- a/component/otelcol/receiver/prometheus/internal/metrics_adjuster.go +++ b/component/otelcol/receiver/prometheus/internal/metrics_adjuster.go @@ -16,16 +16,20 @@ package internal // import "github.com/open-telemetry/opentelemetry-collector-co import ( "errors" - "strings" "sync" "time" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" semconv "go.opentelemetry.io/collector/semconv/v1.6.1" "go.uber.org/zap" ) +// The code in this file has been heavily inspired by Otel Collector: +// https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/prometheusreceiver/internal/metrics_adjuster.go +// In case of issues or changes check the file against the Collector to see if it was also updated. + // Notes on garbage collection (gc): // // Job-level gc: @@ -88,7 +92,7 @@ type summaryInfo struct { type timeseriesKey struct { name string - attributes string + attributes [16]byte aggTemporality pmetric.AggregationTemporality } @@ -130,16 +134,16 @@ func (tsm *timeseriesMap) get(metric pmetric.Metric, kv pcommon.Map) (*timeserie } // Create a unique timeseries signature consisting of the metric name and label values. -func getAttributesSignature(kv pcommon.Map) string { - labelValues := make([]string, 0, kv.Len()) - kv.Sort().Range(func(_ string, attrValue pcommon.Value) bool { +func getAttributesSignature(m pcommon.Map) [16]byte { + clearedMap := pcommon.NewMap() + m.Range(func(k string, attrValue pcommon.Value) bool { value := attrValue.Str() if value != "" { - labelValues = append(labelValues, value) + clearedMap.PutStr(k, value) } return true }) - return strings.Join(labelValues, ",") + return pdatautil.MapHash(clearedMap) } // Remove timeseries that have aged out. diff --git a/component/otelcol/receiver/prometheus/internal/metrics_adjuster_test.go b/component/otelcol/receiver/prometheus/internal/metrics_adjuster_test.go index 5bbfa70fd96d..2504bc721226 100644 --- a/component/otelcol/receiver/prometheus/internal/metrics_adjuster_test.go +++ b/component/otelcol/receiver/prometheus/internal/metrics_adjuster_test.go @@ -19,6 +19,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/pdata/pmetric" semconv "go.opentelemetry.io/collector/semconv/v1.8.0" "go.uber.org/zap" @@ -653,6 +654,13 @@ type metricsAdjusterTest struct { adjusted pmetric.Metrics } +func marshalMetric(t *testing.T, m pmetric.Metrics) string { + jm := &pmetric.JSONMarshaler{} + bytes, err := jm.MarshalMetrics(m) + assert.NoError(t, err) + return string(bytes) +} + func runScript(t *testing.T, ma MetricsAdjuster, job, instance string, tests []*metricsAdjusterTest) { for _, test := range tests { t.Run(test.description, func(t *testing.T) { @@ -666,7 +674,7 @@ func runScript(t *testing.T, ma MetricsAdjuster, job, instance string, tests []* // Add the instance/job to the expected metrics as well. test.adjusted.ResourceMetrics().At(0).Resource().Attributes().PutStr(semconv.AttributeServiceInstanceID, instance) test.adjusted.ResourceMetrics().At(0).Resource().Attributes().PutStr(semconv.AttributeServiceName, job) - assert.EqualValues(t, test.adjusted, adjusted) + require.JSONEq(t, marshalMetric(t, test.adjusted), marshalMetric(t, adjusted)) }) } } diff --git a/component/otelcol/receiver/prometheus/internal/prom_to_otlp_test.go b/component/otelcol/receiver/prometheus/internal/prom_to_otlp_test.go index 17108c878bc5..63f167ca5363 100644 --- a/component/otelcol/receiver/prometheus/internal/prom_to_otlp_test.go +++ b/component/otelcol/receiver/prometheus/internal/prom_to_otlp_test.go @@ -283,9 +283,8 @@ func TestCreateNodeAndResourcePromToOTLP(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { got := CreateResource(tt.job, tt.instance, tt.sdLabels) - got.Attributes().Sort() - tt.want.Attributes().Sort() - require.Equal(t, tt.want, got) + require.Equal(t, tt.want.Attributes().AsRaw(), got.Attributes().AsRaw()) + require.Equal(t, tt.want.DroppedAttributesCount(), got.DroppedAttributesCount()) }) } } diff --git a/component/otelcol/receiver/prometheus/internal/transaction.go b/component/otelcol/receiver/prometheus/internal/transaction.go index de22d359f192..f584a1120948 100644 --- a/component/otelcol/receiver/prometheus/internal/transaction.go +++ b/component/otelcol/receiver/prometheus/internal/transaction.go @@ -28,11 +28,11 @@ import ( "github.com/prometheus/prometheus/model/value" "github.com/prometheus/prometheus/scrape" "github.com/prometheus/prometheus/storage" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/obsreport" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/receiver" "go.uber.org/zap" ) @@ -58,7 +58,7 @@ func newTransaction( metricAdjuster MetricsAdjuster, sink consumer.Metrics, externalLabels labels.Labels, - settings component.ReceiverCreateSettings, + settings receiver.CreateSettings, obsrecv *obsreport.Receiver) *transaction { return &transaction{ diff --git a/component/otelcol/receiver/prometheus/internal/transaction_test.go b/component/otelcol/receiver/prometheus/internal/transaction_test.go index 9748d37a7fbc..deb47ff989d5 100644 --- a/component/otelcol/receiver/prometheus/internal/transaction_test.go +++ b/component/otelcol/receiver/prometheus/internal/transaction_test.go @@ -26,12 +26,12 @@ import ( "github.com/prometheus/prometheus/scrape" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/obsreport" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/receiver/receivertest" ) const ( @@ -61,24 +61,24 @@ var ( ) func TestTransactionCommitWithoutAdding(t *testing.T) { - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) assert.NoError(t, tr.Commit()) } func TestTransactionRollbackDoesNothing(t *testing.T) { - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) assert.NoError(t, tr.Rollback()) } func TestTransactionUpdateMetadataDoesNothing(t *testing.T) { - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) _, err := tr.UpdateMetadata(0, labels.New(), metadata.Metadata{}) assert.NoError(t, err) } func TestTransactionAppendNoTarget(t *testing.T) { badLabels := labels.FromStrings(model.MetricNameLabel, "counter_test") - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) _, err := tr.Append(0, badLabels, time.Now().Unix()*1000, 1.0) assert.Error(t, err) } @@ -88,7 +88,7 @@ func TestTransactionAppendNoMetricName(t *testing.T) { model.InstanceLabel: "localhost:8080", model.JobLabel: "test2", }) - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) _, err := tr.Append(0, jobNotFoundLb, time.Now().Unix()*1000, 1.0) assert.ErrorIs(t, err, errMetricNameNotFound) @@ -96,7 +96,7 @@ func TestTransactionAppendNoMetricName(t *testing.T) { } func TestTransactionAppendEmptyMetricName(t *testing.T) { - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, consumertest.NewNop(), nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) _, err := tr.Append(0, labels.FromMap(map[string]string{ model.InstanceLabel: "localhost:8080", model.JobLabel: "test2", @@ -107,7 +107,7 @@ func TestTransactionAppendEmptyMetricName(t *testing.T) { func TestTransactionAppendResource(t *testing.T) { sink := new(consumertest.MetricsSink) - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, sink, nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, sink, nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) _, err := tr.Append(0, labels.FromMap(map[string]string{ model.InstanceLabel: "localhost:8080", model.JobLabel: "test", @@ -136,7 +136,7 @@ func TestTransactionCommitErrorWhenAdjusterError(t *testing.T) { }) sink := new(consumertest.MetricsSink) adjusterErr := errors.New("adjuster error") - tr := newTransaction(scrapeCtx, &errorAdjuster{err: adjusterErr}, sink, nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &errorAdjuster{err: adjusterErr}, sink, nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) _, err := tr.Append(0, goodLabels, time.Now().Unix()*1000, 1.0) assert.NoError(t, err) assert.ErrorIs(t, tr.Commit(), adjusterErr) @@ -145,7 +145,7 @@ func TestTransactionCommitErrorWhenAdjusterError(t *testing.T) { // Ensure that we reject duplicate label keys. See https://github.com/open-telemetry/wg-prometheus/issues/44. func TestTransactionAppendDuplicateLabels(t *testing.T) { sink := new(consumertest.MetricsSink) - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, sink, nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, sink, nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) dupLabels := labels.FromStrings( model.InstanceLabel, "0.0.0.0:8855", @@ -163,7 +163,7 @@ func TestTransactionAppendDuplicateLabels(t *testing.T) { func TestTransactionAppendHistogramNoLe(t *testing.T) { sink := new(consumertest.MetricsSink) - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, sink, nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, sink, nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) goodLabels := labels.FromStrings( model.InstanceLabel, "0.0.0.0:8855", @@ -177,7 +177,7 @@ func TestTransactionAppendHistogramNoLe(t *testing.T) { func TestTransactionAppendSummaryNoQuantile(t *testing.T) { sink := new(consumertest.MetricsSink) - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, sink, nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, sink, nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) goodLabels := labels.FromStrings( model.InstanceLabel, "0.0.0.0:8855", @@ -189,12 +189,15 @@ func TestTransactionAppendSummaryNoQuantile(t *testing.T) { require.ErrorIs(t, err, errEmptyQuantileLabel) } -func nopObsRecv() *obsreport.Receiver { - return obsreport.NewReceiver(obsreport.ReceiverSettings{ - ReceiverID: config.NewComponentID("prometheus"), +func nopObsRecv(t *testing.T) *obsreport.Receiver { + res, err := obsreport.NewReceiver(obsreport.ReceiverSettings{ + ReceiverID: component.NewID("prometheus"), Transport: transport, - ReceiverCreateSettings: componenttest.NewNopReceiverCreateSettings(), + ReceiverCreateSettings: receivertest.NewNopCreateSettings(), }) + + assert.NoError(t, err) + return res } func TestMetricBuilderCounters(t *testing.T) { @@ -1025,7 +1028,7 @@ func (tt buildTestData) run(t *testing.T) { st := ts for i, page := range tt.inputs { sink := new(consumertest.MetricsSink) - tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, sink, nil, componenttest.NewNopReceiverCreateSettings(), nopObsRecv()) + tr := newTransaction(scrapeCtx, &startTimeAdjuster{startTime: startTimestamp}, sink, nil, receivertest.NewNopCreateSettings(), nopObsRecv(t)) for _, pt := range page.pts { // set ts for testing pt.t = st diff --git a/component/otelcol/receiver/prometheus/prometheus.go b/component/otelcol/receiver/prometheus/prometheus.go index 334205bcb70f..68c046a900db 100644 --- a/component/otelcol/receiver/prometheus/prometheus.go +++ b/component/otelcol/receiver/prometheus/prometheus.go @@ -18,8 +18,8 @@ import ( "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" - "go.opentelemetry.io/otel/metric" + otelreceiver "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/otel/metric/noop" "go.opentelemetry.io/otel/trace" ) @@ -102,13 +102,13 @@ func (c *Component) Update(newConfig component.Arguments) error { gcInterval = 5 * time.Minute ) - settings := otelcomponent.ReceiverCreateSettings{ + settings := otelreceiver.CreateSettings{ TelemetrySettings: otelcomponent.TelemetrySettings{ Logger: zapadapter.New(c.opts.Logger), // TODO(tpaschalis): expose tracing and logging statistics. TracerProvider: trace.NewNoopTracerProvider(), - MeterProvider: metric.NewNoopMeterProvider(), + MeterProvider: noop.NewMeterProvider(), }, BuildInfo: otelcomponent.BuildInfo{ @@ -119,15 +119,18 @@ func (c *Component) Update(newConfig component.Arguments) error { } metricsSink := fanoutconsumer.Metrics(cfg.Output.Metrics) - appendable := internal.NewAppendable( + appendable, err := internal.NewAppendable( metricsSink, settings, gcInterval, useStartTimeMetric, startTimeMetricRegex, - otelconfig.NewComponentID(otelconfig.Type(c.opts.ID)), + otelcomponent.NewID(otelcomponent.Type(c.opts.ID)), labels.Labels{}, ) + if err != nil { + return err + } c.appendable = appendable // Export the receiver. diff --git a/component/otelcol/receiver/receiver.go b/component/otelcol/receiver/receiver.go index 943973ce2b01..64b111bfc46d 100644 --- a/component/otelcol/receiver/receiver.go +++ b/component/otelcol/receiver/receiver.go @@ -16,7 +16,8 @@ import ( "github.com/grafana/agent/pkg/util/zapadapter" "github.com/prometheus/client_golang/prometheus" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/extension" + otelreceiver "go.opentelemetry.io/collector/receiver" sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/sdk/metric" @@ -30,15 +31,15 @@ type Arguments interface { // Convert converts the Arguments into an OpenTelemetry Collector receiver // configuration. - Convert() (otelconfig.Receiver, error) + Convert() (otelcomponent.Config, error) // Extensions returns the set of extensions that the configured component is // allowed to use. - Extensions() map[otelconfig.ComponentID]otelcomponent.Extension + Extensions() map[otelcomponent.ID]extension.Extension // Exporters returns the set of exporters that are exposed to the configured // component. - Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter + Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component // NextConsumers returns the set of consumers to send data to. NextConsumers() *otelcol.ConsumerArguments @@ -51,7 +52,7 @@ type Receiver struct { cancel context.CancelFunc opts component.Options - factory otelcomponent.ReceiverFactory + factory otelreceiver.Factory sched *scheduler.Scheduler collector *lazycollector.Collector @@ -69,7 +70,7 @@ var ( // If the registered Flow component registers exported fields, it is the // responsibility of the caller to export values when needed; the Receiver // component never exports any values. -func New(opts component.Options, f otelcomponent.ReceiverFactory, args Arguments) (*Receiver, error) { +func New(opts component.Options, f otelreceiver.Factory, args Arguments) (*Receiver, error) { ctx, cancel := context.WithCancel(context.Background()) // Create a lazy collector where metrics from the upstream component will be @@ -119,7 +120,7 @@ func (r *Receiver) Update(args component.Arguments) error { return err } - settings := otelcomponent.ReceiverCreateSettings{ + settings := otelreceiver.CreateSettings{ TelemetrySettings: otelcomponent.TelemetrySettings{ Logger: zapadapter.New(r.opts.Logger), diff --git a/component/otelcol/receiver/receiver_test.go b/component/otelcol/receiver/receiver_test.go index 0b69e6800995..1eaaaae64c2f 100644 --- a/component/otelcol/receiver/receiver_test.go +++ b/component/otelcol/receiver/receiver_test.go @@ -13,9 +13,10 @@ import ( "github.com/grafana/agent/pkg/util" "github.com/stretchr/testify/require" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" otelconsumer "go.opentelemetry.io/collector/consumer" + otelextension "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/pdata/ptrace" + otelreceiver "go.opentelemetry.io/collector/receiver" ) func TestReceiver(t *testing.T) { @@ -72,15 +73,15 @@ func newTestEnvironment(t *testing.T, onTracesConsumer func(t otelconsumer.Trace Build: func(opts component.Options, args component.Arguments) (component.Component, error) { // Create a factory which always returns our instance of fakeReceiver // defined above. - factory := otelcomponent.NewReceiverFactory( + factory := otelreceiver.NewFactory( "testcomponent", - func() otelconfig.Receiver { return nil }, - otelcomponent.WithTracesReceiver(func( - ctx context.Context, - rcs otelcomponent.ReceiverCreateSettings, - r otelconfig.Receiver, + func() otelcomponent.Config { return nil }, + otelreceiver.WithTraces(func( + _ context.Context, + _ otelreceiver.CreateSettings, + _ otelcomponent.Config, t otelconsumer.Traces, - ) (otelcomponent.TracesReceiver, error) { + ) (otelreceiver.Traces, error) { onTracesConsumer(t) return nil, nil @@ -111,16 +112,15 @@ type fakeReceiverArgs struct { var _ receiver.Arguments = fakeReceiverArgs{} -func (fa fakeReceiverArgs) Convert() (otelconfig.Receiver, error) { - settings := otelconfig.NewReceiverSettings(otelconfig.NewComponentID("testcomponent")) - return &settings, nil +func (fa fakeReceiverArgs) Convert() (otelcomponent.Config, error) { + return &struct{}{}, nil } -func (fa fakeReceiverArgs) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (fa fakeReceiverArgs) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } -func (fa fakeReceiverArgs) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (fa fakeReceiverArgs) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/component/otelcol/receiver/zipkin/zipkin.go b/component/otelcol/receiver/zipkin/zipkin.go index eeed092fa16d..6c652840850e 100644 --- a/component/otelcol/receiver/zipkin/zipkin.go +++ b/component/otelcol/receiver/zipkin/zipkin.go @@ -7,7 +7,7 @@ import ( "github.com/grafana/agent/component/otelcol/receiver" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver" otelcomponent "go.opentelemetry.io/collector/component" - otelconfig "go.opentelemetry.io/collector/config" + otelextension "go.opentelemetry.io/collector/extension" ) func init() { @@ -49,22 +49,20 @@ func (args *Arguments) SetToDefault() { } // Convert implements receiver.Arguments. -func (args Arguments) Convert() (otelconfig.Receiver, error) { +func (args Arguments) Convert() (otelcomponent.Config, error) { return &zipkinreceiver.Config{ - ReceiverSettings: otelconfig.NewReceiverSettings(otelconfig.NewComponentID("zipkin")), - ParseStringTags: args.ParseStringTags, HTTPServerSettings: *args.HTTPServer.Convert(), }, nil } // Extensions implements receiver.Arguments. -func (args Arguments) Extensions() map[otelconfig.ComponentID]otelcomponent.Extension { +func (args Arguments) Extensions() map[otelcomponent.ID]otelextension.Extension { return nil } // Exporters implements receiver.Arguments. -func (args Arguments) Exporters() map[otelconfig.DataType]map[otelconfig.ComponentID]otelcomponent.Exporter { +func (args Arguments) Exporters() map[otelcomponent.DataType]map[otelcomponent.ID]otelcomponent.Component { return nil } diff --git a/docs/sources/flow/reference/components/otelcol.auth.bearer.md b/docs/sources/flow/reference/components/otelcol.auth.bearer.md index 240fd1276beb..a3dd7a32381a 100644 --- a/docs/sources/flow/reference/components/otelcol.auth.bearer.md +++ b/docs/sources/flow/reference/components/otelcol.auth.bearer.md @@ -29,6 +29,10 @@ otelcol.auth.bearer "LABEL" { Name | Type | Description | Default | Required ---- | ---- | ----------- | ------- | -------- `token` | `secret` | Bearer token to use for authenticating requests. | | yes +`scheme` | `string` | Authentication scheme name. | "Bearer" | no + +When sending the token, the value of `scheme` is prepended to the `token` value. +The string is then sent out as either a header (in case of HTTP) or as metadata (in case of gRPC). ## Exported fields @@ -47,10 +51,14 @@ configuration. `otelcol.auth.bearer` does not expose any component-specific debug information. -## Example +## Examples + +### Default scheme via gRPC transport + +The example below configures [otelcol.exporter.otlp][] to use a bearer token authentication. -This example configures [otelcol.exporter.otlp][] to use bearer token -authentication: +If we assume that the value of the `API_KEY` environment variable is `SECRET_API_KEY`, then +the `Authorization` RPC metadata is set to `Bearer SECRET_API_KEY`. ```river otelcol.exporter.otlp "example" { @@ -65,4 +73,26 @@ otelcol.auth.bearer "creds" { } ``` +### Custom scheme via HTTP transport + +The example below configures [otelcol.exporter.otlphttp][] to use a bearer token authentication. + +If we assume that the value of the `API_KEY` environment variable is `SECRET_API_KEY`, then +the `Authorization` HTTP header is set to `MyScheme SECRET_API_KEY`. + +```river +otelcol.exporter.otlphttp "example" { + client { + endpoint = "my-otlp-grpc-server:4317" + auth = otelcol.auth.bearer.creds.handler + } +} + +otelcol.auth.bearer "creds" { + token = env("API_KEY") + scheme = "MyScheme" +} +``` + [otelcol.exporter.otlp]: {{< relref "./otelcol.exporter.otlp.md" >}} +[otelcol.exporter.otlphttp]: {{< relref "./otelcol.exporter.otlphttp.md" >}} diff --git a/go.mod b/go.mod index bfb1078c5883..48506149f94c 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( cloud.google.com/go/pubsub v1.30.0 - contrib.go.opencensus.io/exporter/prometheus v0.4.2 + contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 github.com/Azure/go-autorest/autorest v0.11.29 @@ -14,7 +14,7 @@ require ( github.com/Shopify/sarama v1.38.1 github.com/alecthomas/kingpin/v2 v2.3.2 github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 - github.com/aws/aws-sdk-go v1.44.249 + github.com/aws/aws-sdk-go v1.44.274 github.com/aws/aws-sdk-go-v2 v1.18.1 github.com/aws/aws-sdk-go-v2/config v1.18.27 github.com/aws/aws-sdk-go-v2/service/s3 v1.34.1 @@ -28,7 +28,7 @@ require ( github.com/coreos/go-systemd/v22 v22.5.0 github.com/cortexproject/cortex v1.11.0 github.com/davidmparrott/kafka_exporter/v2 v2.0.1 - github.com/docker/docker v23.0.5+incompatible + github.com/docker/docker v24.0.2+incompatible github.com/docker/go-connections v0.4.0 github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 github.com/fatih/color v1.14.1 @@ -63,7 +63,7 @@ require ( github.com/grafana/tail v0.0.0-20230328181249-aa6682d7843a github.com/grafana/vmware_exporter v0.0.4-beta github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 - github.com/hashicorp/consul/api v1.18.0 + github.com/hashicorp/consul/api v1.20.0 github.com/hashicorp/go-cleanhttp v0.5.2 github.com/hashicorp/go-discover v0.0.0-20220105235006-b95dfa40aaed github.com/hashicorp/go-multierror v1.1.1 @@ -81,7 +81,7 @@ require ( github.com/iamseth/oracledb_exporter v0.0.0-20230504204552-f801dc432dcf github.com/infinityworks/github-exporter v0.0.0-20210802160115-284088c21e7d github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6 - github.com/jaegertracing/jaeger v1.38.1 + github.com/jaegertracing/jaeger v1.41.0 github.com/jmespath/go-jmespath v0.4.0 github.com/json-iterator/go v1.1.12 github.com/klauspost/compress v1.16.6 @@ -98,25 +98,25 @@ require ( github.com/oklog/run v1.1.0 github.com/olekukonko/tablewriter v0.0.5 github.com/oliver006/redis_exporter v1.51.0 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/loadbalancingexporter v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.61.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.61.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension v0.61.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.63.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.63.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/loadbalancingexporter v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.79.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.79.0 github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e github.com/opentracing-contrib/go-stdlib v1.0.0 github.com/opentracing/opentracing-go v1.2.0 @@ -145,12 +145,12 @@ require ( github.com/prometheus/snmp_exporter v0.20.1-0.20220111173215-83399c23888f github.com/prometheus/statsd_exporter v0.22.8 github.com/richardartoul/molecule v1.0.1-0.20221107223329-32cfee06a052 - github.com/rs/cors v1.8.3 - github.com/shirou/gopsutil/v3 v3.22.9 + github.com/rs/cors v1.9.0 + github.com/shirou/gopsutil/v3 v3.23.5 github.com/sijms/go-ora/v2 v2.7.3 github.com/sirupsen/logrus v1.9.3 github.com/spaolacci/murmur3 v1.1.0 - github.com/spf13/cobra v1.6.1 + github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/testcontainers/testcontainers-go v0.20.2-0.20230615142642-c175df34bd1d github.com/testcontainers/testcontainers-go/modules/k3s v0.0.0-20230615142642-c175df34bd1d @@ -162,21 +162,21 @@ require ( github.com/wk8/go-ordered-map v0.2.0 github.com/xdg-go/scram v1.1.2 github.com/zeebo/xxh3 v1.0.2 - go.opencensus.io v0.24.0 - go.opentelemetry.io/collector v0.63.1 - go.opentelemetry.io/collector/exporter/loggingexporter v0.75.0 - go.opentelemetry.io/collector/exporter/otlpexporter v0.63.0 - go.opentelemetry.io/collector/exporter/otlphttpexporter v0.0.0-00010101000000-000000000000 - go.opentelemetry.io/collector/pdata v0.63.1 - go.opentelemetry.io/collector/semconv v0.63.1 + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/collector v0.80.0 + go.opentelemetry.io/collector/exporter/loggingexporter v0.79.0 + go.opentelemetry.io/collector/exporter/otlpexporter v0.79.0 + go.opentelemetry.io/collector/exporter/otlphttpexporter v0.79.0 + go.opentelemetry.io/collector/pdata v1.0.0-rcv0013 + go.opentelemetry.io/collector/semconv v0.79.0 go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.36.4 - go.opentelemetry.io/otel v1.15.0 + go.opentelemetry.io/otel v1.16.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.2 - go.opentelemetry.io/otel/exporters/prometheus v0.33.0 - go.opentelemetry.io/otel/metric v0.34.0 - go.opentelemetry.io/otel/sdk v1.11.2 - go.opentelemetry.io/otel/sdk/metric v0.33.0 - go.opentelemetry.io/otel/trace v1.15.0 + go.opentelemetry.io/otel/exporters/prometheus v0.39.0 + go.opentelemetry.io/otel/metric v1.16.0 + go.opentelemetry.io/otel/sdk v1.16.0 + go.opentelemetry.io/otel/sdk/metric v0.39.0 + go.opentelemetry.io/otel/trace v1.16.0 go.opentelemetry.io/proto/otlp v0.19.0 go.uber.org/atomic v1.11.0 go.uber.org/goleak v1.2.1 @@ -189,7 +189,7 @@ require ( golang.org/x/sys v0.9.0 golang.org/x/text v0.10.0 golang.org/x/time v0.3.0 - google.golang.org/api v0.114.0 + google.golang.org/api v0.125.0 google.golang.org/grpc v1.56.0 google.golang.org/protobuf v1.30.0 gopkg.in/yaml.v2 v2.4.0 @@ -201,14 +201,14 @@ require ( k8s.io/client-go v0.27.2 k8s.io/component-base v0.27.2 k8s.io/klog/v2 v2.90.1 - k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 + k8s.io/utils v0.0.0-20230308161112-d77c459e9343 sigs.k8s.io/controller-runtime v0.15.0 sigs.k8s.io/yaml v1.3.0 ) require ( cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.0 // indirect + cloud.google.com/go/compute v1.19.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.13.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -240,13 +240,12 @@ require ( github.com/Microsoft/hcsshim v0.9.8 // indirect github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/ProtonMail/go-crypto v0.0.0-20210920160938-87db9fbc61c7 // indirect - github.com/VividCortex/gohistogram v1.0.0 // indirect github.com/acomagu/bufpipe v1.0.3 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/andybalholm/brotli v1.0.5 // indirect - github.com/antonmedv/expr v1.9.0 // indirect + github.com/antonmedv/expr v1.12.5 // indirect github.com/apache/thrift v0.18.1 // indirect - github.com/armon/go-metrics v0.4.0 // indirect + github.com/armon/go-metrics v0.4.1 // indirect github.com/armon/go-radix v1.0.0 // indirect github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect @@ -272,13 +271,13 @@ require ( github.com/boynux/squid-exporter v1.10.5-0.20230618153315-c1fae094e18e github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee // indirect github.com/cenkalti/backoff/v3 v3.0.0 // indirect - github.com/cenkalti/backoff/v4 v4.2.0 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/checkpoint-restore/go-criu/v5 v5.3.0 // indirect github.com/cilium/ebpf v0.10.0 // indirect github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 // indirect - github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc // indirect + github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195 // indirect github.com/containerd/cgroups v1.1.0 // indirect github.com/containerd/console v1.0.3 // indirect github.com/containerd/containerd v1.6.19 // indirect @@ -294,7 +293,7 @@ require ( github.com/dennwc/varint v1.0.0 // indirect github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/digitalocean/godo v1.95.0 // indirect + github.com/digitalocean/godo v1.97.0 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect github.com/docker/cli v23.0.3+incompatible // indirect github.com/docker/distribution v2.8.2+incompatible // indirect @@ -311,8 +310,8 @@ require ( github.com/ema/qdisc v0.0.0-20230120214811-5b708f463de3 // indirect github.com/emicklei/go-restful/v3 v3.10.1 // indirect github.com/emirpasic/gods v1.12.0 // indirect - github.com/envoyproxy/go-control-plane v0.10.3 // indirect - github.com/envoyproxy/protoc-gen-validate v0.9.1 // indirect + github.com/envoyproxy/go-control-plane v0.11.0 // indirect + github.com/envoyproxy/protoc-gen-validate v0.10.0 // indirect github.com/euank/go-kmsg-parser v2.0.0+incompatible // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect @@ -339,7 +338,7 @@ require ( github.com/go-openapi/swag v0.22.3 // indirect github.com/go-openapi/validate v0.22.0 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect - github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 // indirect + github.com/go-resty/resty/v2 v2.7.0 // indirect github.com/go-zookeeper/zk v1.0.3 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect @@ -351,31 +350,29 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/gomodule/redigo v1.8.9 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/dnsmasq_exporter v0.2.1-0.20230620100026-44b14480804a github.com/google/flatbuffers v23.5.26+incompatible // indirect github.com/google/gnostic v0.6.9 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.7.1 // indirect - github.com/gophercloud/gophercloud v1.1.1 // indirect + github.com/googleapis/gax-go/v2 v2.10.0 // indirect + github.com/gophercloud/gophercloud v1.2.0 // indirect github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect - github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gosnmp/gosnmp v1.34.0 // indirect github.com/grafana/gomemcache v0.0.0-20230105173749-11f792309e1f // indirect github.com/grafana/loki/pkg/push v0.0.0-20230127102416-571f88bc5765 // indirect github.com/grobie/gomemcache v0.0.0-20201204163352-08d7c80fcac6 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/cronexpr v1.1.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-envparse v0.1.0 // indirect - github.com/hashicorp/go-hclog v1.3.1 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-msgpack v0.5.5 // indirect - github.com/hashicorp/go-plugin v1.4.5 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/go-retryablehttp v0.7.2 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-secure-stdlib/awsutil v0.1.6 // indirect @@ -385,16 +382,15 @@ require ( github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.3 github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/mdns v1.0.4 // indirect github.com/hashicorp/memberlist v0.5.0 // indirect - github.com/hashicorp/nomad/api v0.0.0-20230124213148-69fd1a0e4bf7 // indirect + github.com/hashicorp/nomad/api v0.0.0-20230308192510-48e7d70fcd4b // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/hashicorp/vault/sdk v0.5.1 // indirect github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443 // indirect github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d // indirect - github.com/hetznercloud/hcloud-go v1.39.0 // indirect + github.com/hetznercloud/hcloud-go v1.41.0 // indirect github.com/hodgesds/perf-utils v0.7.0 // indirect github.com/huandu/xstrings v1.3.3 // indirect github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973 // indirect @@ -402,7 +398,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/infinityworks/go-common v0.0.0-20170820165359-7f20a140fd37 // indirect github.com/influxdata/telegraf v1.16.3 // indirect - github.com/ionos-cloud/sdk-go/v6 v6.1.3 // indirect + github.com/ionos-cloud/sdk-go/v6 v6.1.4 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgconn v1.13.0 // indirect github.com/jackc/pgio v1.0.0 // indirect @@ -428,13 +424,13 @@ require ( github.com/karrick/godirwalk v1.17.0 // indirect github.com/kevinburke/ssh_config v1.1.0 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect - github.com/knadh/koanf v1.4.4 // indirect + github.com/knadh/koanf v1.5.0 // indirect github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b // indirect github.com/krallistic/kazoo-go v0.0.0-20170526135507-a15279744f4e // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165 // indirect github.com/leoluk/perflib_exporter v0.2.0 // indirect - github.com/linode/linodego v1.12.0 // indirect + github.com/linode/linodego v1.14.1 // indirect github.com/lufia/iostat v1.2.1 // indirect github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -462,21 +458,20 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/morikuni/aec v1.0.0 // indirect - github.com/mostynb/go-grpc-compression v1.1.17 // indirect + github.com/mostynb/go-grpc-compression v1.1.18 // indirect github.com/mrunalp/fileutils v0.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/ncabatoff/go-seq v0.0.0-20180805175032-b08ef85ed833 // indirect github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2 // indirect - github.com/observiq/ctimefmt v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.63.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.63.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.63.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.63.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.63.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.63.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.63.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.79.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.79.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.79.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.79.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.79.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.79.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.79.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc3 // indirect github.com/opencontainers/runc v1.1.5 // indirect @@ -505,7 +500,7 @@ require ( github.com/safchain/ethtool v0.3.0 // indirect github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da // indirect github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.12 // indirect + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.14 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646 // indirect github.com/sercand/kuberesolver v2.4.0+incompatible // indirect @@ -526,10 +521,10 @@ require ( github.com/subosito/gotenv v1.4.2 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect github.com/tencentcloud/tencentcloud-sdk-go v1.0.162 // indirect - github.com/tg123/go-htpasswd v1.2.0 // indirect + github.com/tg123/go-htpasswd v1.2.1 // indirect github.com/thanos-io/thanos v0.30.0 // indirect - github.com/tklauser/go-sysconf v0.3.10 // indirect - github.com/tklauser/numcpus v0.5.0 // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect + github.com/tklauser/numcpus v0.6.0 // indirect github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/vertica/vertica-sql-go v1.3.0 // indirect @@ -550,13 +545,13 @@ require ( github.com/xeipuuv/gojsonschema v1.2.0 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect github.com/xo/dburl v0.13.0 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect go.etcd.io/etcd/api/v3 v3.5.7 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect go.etcd.io/etcd/client/v3 v3.5.7 // indirect go.mongodb.org/mongo-driver v1.11.2 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.4 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect golang.org/x/mod v0.11.0 // indirect golang.org/x/sync v0.3.0 // indirect @@ -564,9 +559,9 @@ require ( golang.org/x/tools v0.10.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect - gonum.org/v1/gonum v0.12.0 // indirect + gonum.org/v1/gonum v0.13.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect + google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect @@ -580,15 +575,37 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) +require ( + go.opentelemetry.io/collector/component v0.80.0 + go.opentelemetry.io/collector/confmap v0.80.0 + go.opentelemetry.io/collector/consumer v0.80.0 + go.opentelemetry.io/collector/exporter v0.80.0 + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0013 + go.opentelemetry.io/collector/processor/batchprocessor v0.80.0 + go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.80.0 + go.opentelemetry.io/collector/receiver v0.80.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.79.0 +) + require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 // indirect github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect + github.com/alecthomas/participle/v2 v2.0.0 // indirect github.com/apache/arrow/go/v12 v12.0.1 // indirect + github.com/gobwas/glob v0.2.3 // indirect github.com/goccy/go-json v0.10.2 // indirect + github.com/google/s2a-go v0.1.4 // indirect + github.com/iancoleman/strcase v0.2.0 // indirect github.com/klauspost/asmfmt v1.3.2 // indirect github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.79.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.79.0 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/tilinna/clock v1.1.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.17.0 // indirect + go.opentelemetry.io/otel/bridge/opencensus v0.39.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect ) @@ -664,12 +681,11 @@ exclude google.golang.org/grpc/examples v0.0.0-20200728065043-dfc0c05b2da9 // Some funtionalities of the collector have been made internal and it's more difficult to build and configure pipelines in the newer versions. // This is a temporary solution while a new configuration design is discussed for the collector (ref: https://github.com/open-telemetry/opentelemetry-collector/issues/3482). replace ( - go.opentelemetry.io/collector => github.com/grafana/opentelemetry-collector v0.4.1-0.20230412190723-62ec42799a7d - go.opentelemetry.io/collector/config/configtls => github.com/grafana/opentelemetry-collector/config/configtls v0.4.1-0.20230412190723-62ec42799a7d - go.opentelemetry.io/collector/exporter/loggingexporter => github.com/grafana/opentelemetry-collector/exporter/loggingexporter v0.0.0-20230412190723-62ec42799a7d - go.opentelemetry.io/collector/exporter/otlpexporter => github.com/grafana/opentelemetry-collector/exporter/otlpexporter v0.0.0-20230412190723-62ec42799a7d - go.opentelemetry.io/collector/exporter/otlphttpexporter => github.com/grafana/opentelemetry-collector/exporter/otlphttpexporter v0.0.0-20230412190723-62ec42799a7d - go.opentelemetry.io/collector/pdata => github.com/grafana/opentelemetry-collector/pdata v0.0.0-20230412190723-62ec42799a7d + go.opentelemetry.io/collector => github.com/ptodev/opentelemetry-collector v0.0.0-20230608105454-0c02b84d03d4 + go.opentelemetry.io/collector/exporter/otlpexporter => github.com/ptodev/opentelemetry-collector/exporter/otlpexporter v0.0.0-20230608105454-0c02b84d03d4 + go.opentelemetry.io/collector/exporter/otlphttpexporter => github.com/ptodev/opentelemetry-collector/exporter/otlphttpexporter v0.0.0-20230608105454-0c02b84d03d4 + go.opentelemetry.io/collector/featuregate => github.com/ptodev/opentelemetry-collector/featuregate v0.0.0-20230608105454-0c02b84d03d4 + go.opentelemetry.io/collector/pdata => github.com/ptodev/opentelemetry-collector/pdata v0.0.0-20230608105454-0c02b84d03d4 ) // Required until https://github.com/weaveworks/common/pull/240 is merged diff --git a/go.sum b/go.sum index 5ae62b04e917..5f5ddd007151 100644 --- a/go.sum +++ b/go.sum @@ -121,8 +121,8 @@ cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= -cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ= -cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= +cloud.google.com/go/compute v1.19.3 h1:DcTwsFgGev/wV5+q8o2fzgcHOaac+DKGC91ZlvpsQds= +cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= @@ -234,7 +234,6 @@ cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6 cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= @@ -410,6 +409,7 @@ github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMb github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 h1:V8krnnfGj4pV65YLUm3C0/8bl7V5Nry2Pwvy3ru/wLc= github.com/Azure/azure-amqp-common-go/v3 v3.0.0/go.mod h1:SY08giD/XbhTz07tJdpw1SoxQXHPN30+DI3Z04SYqyg= github.com/Azure/azure-event-hubs-go/v3 v3.2.0/go.mod h1:BPIIJNH/l/fVHYq3Rm6eg4clbrULrQ3q7+icmqHyyLc= github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= @@ -518,7 +518,6 @@ github.com/ChannelMeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61 h1:N5 github.com/ChannelMeter/iso8601duration v0.0.0-20150204201828-8da3af7a2a61/go.mod h1:GnKXcK+7DYNy/8w2Ex//Uql4IgfaU82Cd5rWKb7ah00= github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0= github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DataDog/datadog-go v0.0.0-20160329135253-cc2f4770f4d6/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -572,7 +571,6 @@ github.com/Microsoft/hcsshim v0.9.8 h1:lf7xxK2+Ikbj9sVf2QZsouGjRjEp2STj1yDHgoVtU github.com/Microsoft/hcsshim v0.9.8/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= -github.com/Mottl/ctimefmt v0.0.0-20190803144728-fd2ac23a585a/go.mod h1:eyj2WSIdoPMPs2eNTLpSmM6Nzqo4V80/d6jHpnJ1SAI= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.0.1/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= @@ -615,9 +613,13 @@ github.com/aerospike/aerospike-client-go v1.27.0/go.mod h1:zj8LBEnWBDOVEIJt8LvaR github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= github.com/alecthomas/kingpin/v2 v2.3.1/go.mod h1:oYL5vtsvEHZGHxU7DMp32Dvx+qL+ptGn6lWaot2vCNE= github.com/alecthomas/kingpin/v2 v2.3.2 h1:H0aULhgmSzN8xQ3nX1uxtdlTHYoPLu5AhHxWrKI6ocU= github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= +github.com/alecthomas/participle/v2 v2.0.0 h1:Fgrq+MbuSsJwIkw3fEj9h75vDP0Er5JzepJ0/HNHv0g= +github.com/alecthomas/participle/v2 v2.0.0/go.mod h1:rAKZdJldHu8084ojcWevWAL8KmEU+AT+Olodb+WoN2Y= +github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -642,8 +644,8 @@ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHG github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antonmedv/expr v1.9.0 h1:j4HI3NHEdgDnN9p6oI6Ndr0G5QryMY0FNxT4ONrFDGU= -github.com/antonmedv/expr v1.9.0/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8= +github.com/antonmedv/expr v1.12.5 h1:Fq4okale9swwL3OeLLs9WD9H6GbgBLJyN/NUHRv+n0E= +github.com/antonmedv/expr v1.12.5/go.mod h1:FPC8iWArxls7axbVLsW+kpg1mz29A1b2M6jt+hZfDkU= github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -659,8 +661,8 @@ github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD github.com/armon/go-metrics v0.3.6/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-proxyproto v0.0.0-20190211145416-68259f75880e/go.mod h1:QmP9hvJ91BbJmGVGSbutW19IC0Q9phDCLGaomwTJbgU= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= @@ -695,8 +697,8 @@ github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm github.com/aws/aws-sdk-go v1.42.8/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.44.156/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go v1.44.187/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go v1.44.249 h1:UbUvh/oYHdAD3vZjNi316M0NIupJsrqAcJckVuhaCB8= -github.com/aws/aws-sdk-go v1.44.249/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.274 h1:vfreSv19e/9Ka9YytOzgzJasrRZfX7dnttLlbh8NKeA= +github.com/aws/aws-sdk-go v1.44.274/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.7.0/go.mod h1:tb9wi5s61kTDA5qCkcDbt3KRVV74GGslQkl/DRdX/P4= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= @@ -811,8 +813,9 @@ github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3 github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= @@ -862,8 +865,9 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc h1:PYXxkRUBGUMa5xgMVMDl62vEklZvKpVaxQeN9ie7Hfk= github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195 h1:58f1tJ1ra+zFINPlwLWvQsR9CzAKt2e+EWV2yX9oXQ4= +github.com/cncf/xds/go v0.0.0-20230310173818-32f1caf87195/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= @@ -1037,7 +1041,6 @@ github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0S github.com/dannykopping/go-kit-log v0.2.2-0.20221002180827-5591c1641b6b h1:G8g9mAKEj9O3RsU6Hd/ow6lIcHarlcUl5omV6sFKEOU= github.com/dannykopping/go-kit-log v0.2.2-0.20221002180827-5591c1641b6b/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -1070,8 +1073,9 @@ github.com/dhui/dktest v0.3.0/go.mod h1:cyzIUfGsBEbZ6BT7tnXqAShHSXCZhSNmFl70sZ7c github.com/digitalocean/godo v1.1.1/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= github.com/digitalocean/godo v1.7.5/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= github.com/digitalocean/godo v1.10.0/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= -github.com/digitalocean/godo v1.95.0 h1:S48/byPKui7RHZc1wYEPfRvkcEvToADNb5I3guu95xg= github.com/digitalocean/godo v1.95.0/go.mod h1:NRpFznZFvhHjBoqZAaOD3khVzsJ3EibzKqFL4R60dmA= +github.com/digitalocean/godo v1.97.0 h1:p9w1yCcWMZcxFSLPToNGXA96WfUVLXqoHti6GzVomL4= +github.com/digitalocean/godo v1.97.0/go.mod h1:NRpFznZFvhHjBoqZAaOD3khVzsJ3EibzKqFL4R60dmA= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= @@ -1098,8 +1102,8 @@ github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompati github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.21+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.23+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v23.0.5+incompatible h1:DaxtlTJjFSnLOXVNUBU1+6kXGz2lpDoEAH6QoxaSg8k= -github.com/docker/docker v23.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v24.0.2+incompatible h1:eATx+oLz9WdNVkQrr0qjQ8HvRJ4bOOxfzEo8R+dA3cg= +github.com/docker/docker v24.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -1169,12 +1173,14 @@ github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3 github.com/envoyproxy/go-control-plane v0.0.0-20180919002855-2137d9196328/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/go-control-plane v0.10.3 h1:xdCVXxEe0Y3FQith+0cj2irwZudqGYvecuLB1HtdexY= github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= +github.com/envoyproxy/go-control-plane v0.11.0 h1:jtLewhRR2vMRNnq2ZZUoCjUlgut+Y0+sDDWPOfwOi1o= +github.com/envoyproxy/go-control-plane v0.11.0/go.mod h1:VnHyVMpzcLvCFt9yUz1UnCwHLhwx1WguiVDV7pTG/tI= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= -github.com/envoyproxy/protoc-gen-validate v0.9.1 h1:PS7VIOgmSVhWUEeZwTe7z7zouA22Cr590PzXKbZHOVY= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= +github.com/envoyproxy/protoc-gen-validate v0.10.0 h1:oIfnZFdC0YhpNNEX+SuIqko4cqqVZeN9IGTrhZje83Y= +github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/ericchiang/k8s v1.2.0/go.mod h1:/OmBgSq2cd9IANnsGHGlEz27nwMZV2YxlpXuQtU3Bz4= github.com/euank/go-kmsg-parser v2.0.0+incompatible h1:cHD53+PLQuuQyLZeriD1V/esuG4MuU0Pjs5y6iknohY= github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw= @@ -1223,7 +1229,6 @@ github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= -github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -1237,8 +1242,6 @@ github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXt github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= -github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -1426,8 +1429,9 @@ github.com/go-redis/redis/v8 v8.9.0/go.mod h1:ik7vb7+gm8Izylxu6kf6wG26/t2VljgCfS github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhYRFk24TvhTZWU0q8lfCojxZQFi3Ou7+uY= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= +github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= +github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v0.0.0-20180618115901-749ddf1598b4/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -1473,6 +1477,7 @@ github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/V github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/goburrow/modbus v0.1.0/go.mod h1:Kx552D5rLIS8E7TyUwQ/UdHEqvX5T8tyiGBTlzMcZBg= github.com/goburrow/serial v0.1.0/go.mod h1:sAiqG0nRVswsm1C97xsttiYCzSLBmUZ/VSlVLZJ8haA= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= @@ -1646,6 +1651,8 @@ github.com/google/pprof v0.0.0-20230111200839-76d1ae5aea2b/go.mod h1:dDKJzRmX4S3 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg= github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -1671,8 +1678,8 @@ github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= -github.com/googleapis/gax-go/v2 v2.7.1 h1:gF4c0zjUP2H/s/hEGyLA3I0fA2ZWjzYiONAD6cvPr8A= -github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.10.0 h1:ebSgKfMxynOdxw8QQuFOKMgomqeLGPqNLQox2bo42zg= +github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= @@ -1682,8 +1689,9 @@ github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 github.com/gopcua/opcua v0.1.12/go.mod h1:a6QH4F9XeODklCmWuvaOdL8v9H0d73CEKUHWVZLQyE8= github.com/gophercloud/gophercloud v0.0.0-20180828235145-f29afc2cceca/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v1.1.1 h1:MuGyqbSxiuVBqkPZ3+Nhbytk1xZxhmfCB2Rg1cJWFWM= github.com/gophercloud/gophercloud v1.1.1/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= +github.com/gophercloud/gophercloud v1.2.0 h1:1oXyj4g54KBg/kFtCdMM6jtxSzeIyg8wv4z1HoGPp1E= +github.com/gophercloud/gophercloud v1.2.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -1692,7 +1700,6 @@ github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORR github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -1730,16 +1737,6 @@ github.com/grafana/loki/pkg/push v0.0.0-20230127102416-571f88bc5765 h1:VXitROTlm github.com/grafana/loki/pkg/push v0.0.0-20230127102416-571f88bc5765/go.mod h1:DhJMrd2QInI/1CNtTN43BZuTmkccdizW1jZ+F6aHkhY= github.com/grafana/mysqld_exporter v0.12.2-0.20201015182516-5ac885b2d38a h1:D5NSR64/6xMXnSFD9y1m1DPYIcBcHvtfeuI9/M/0qtI= github.com/grafana/mysqld_exporter v0.12.2-0.20201015182516-5ac885b2d38a/go.mod h1:rjb/swXiCWLlC3gWlyugy/xEOZioF5PclbB8sf/9p/Q= -github.com/grafana/opentelemetry-collector v0.4.1-0.20230412190723-62ec42799a7d h1:z/131GeRamIt55y/n+nr6kkA97JXYwssaQFYolD7ZI4= -github.com/grafana/opentelemetry-collector v0.4.1-0.20230412190723-62ec42799a7d/go.mod h1:FZC9Px2N5CRiOG1VWH4XvkDeFx+Bu5tO8+gaqDSfXAA= -github.com/grafana/opentelemetry-collector/exporter/loggingexporter v0.0.0-20230412190723-62ec42799a7d h1:tLFGE4XLxwDGYYNwN7iRJ2XwHB7cKZ1VcMpuLFgg6U8= -github.com/grafana/opentelemetry-collector/exporter/loggingexporter v0.0.0-20230412190723-62ec42799a7d/go.mod h1:6oJfuPkBexwG3jm4FcGLL7LgPjdLLdsI87Q+Q3RKEfY= -github.com/grafana/opentelemetry-collector/exporter/otlpexporter v0.0.0-20230412190723-62ec42799a7d h1:O8h5amH5wCZeGCtZFbT0EaBiOhaMSoqU6Vlnr20qOxw= -github.com/grafana/opentelemetry-collector/exporter/otlpexporter v0.0.0-20230412190723-62ec42799a7d/go.mod h1:GmcFit55Pd4dck4KHIp2TZfJzx5RHLYvbhWrREz+UhY= -github.com/grafana/opentelemetry-collector/exporter/otlphttpexporter v0.0.0-20230412190723-62ec42799a7d h1:HKtyWrFvVvrMWn9BA9fcB8QgG9O3kJMeA2Jsxm8WzLo= -github.com/grafana/opentelemetry-collector/exporter/otlphttpexporter v0.0.0-20230412190723-62ec42799a7d/go.mod h1:GbE0IhSPvKRe3868XUG7sYdyvqAgfj6ESKFz9kaAnrM= -github.com/grafana/opentelemetry-collector/pdata v0.0.0-20230412190723-62ec42799a7d h1:Fbxo2JIdS4qSWWkypyiMHRdX0oEykyyEC/5Va1Sjq5A= -github.com/grafana/opentelemetry-collector/pdata v0.0.0-20230412190723-62ec42799a7d/go.mod h1:IzvXUGQml2mrnvdb8zIlEW3qQs9oFLdD2hLwJdZ+pek= github.com/grafana/perflib_exporter v0.1.1-0.20230511173423-6166026bd090 h1:Ko80Xcl7xo1eYqkqLUb9AVVCLGVmuQp2jOV69hEEeZw= github.com/grafana/perflib_exporter v0.1.1-0.20230511173423-6166026bd090/go.mod h1:MinSWm88jguXFFrGsP56PtleUb4Qtm4tNRH/wXNXRTI= github.com/grafana/phlare/api v0.1.2 h1:1jrwd3KnsXMzj/tJih9likx5EvbY3pbvLbDqAAYem30= @@ -1782,8 +1779,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.1/go.mod h1:G+WkljZi4mflcqVxYSgvt8MNctRQHjEH8ubKtt1Ka3w= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 h1:gDLXvp5S9izjldquuoAhDzccbskOL6tDC5jMSyx3zxE= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2/go.mod h1:7pdNwVWBBHGiCxa9lAszqCJMbfTISJ7oMftp8+UGV08= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= @@ -1799,14 +1796,15 @@ github.com/hashicorp/consul/api v1.9.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/F github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= -github.com/hashicorp/consul/api v1.18.0 h1:R7PPNzTCeN6VuQNDwwhZWJvzCtGSrNpJqfb22h3yH9g= github.com/hashicorp/consul/api v1.18.0/go.mod h1:owRRGJ9M5xReDC5nfT8FTJrNAPbT4NM6p/k+d03q2v4= +github.com/hashicorp/consul/api v1.20.0 h1:9IHTjNVSZ7MIwjlW3N3a7iGiykCMDpxZu8jsxFJh0yc= +github.com/hashicorp/consul/api v1.20.0/go.mod h1:nR64eD44KQ59Of/ECwt2vUmIK2DKsDzAwTmwmLl8Wpo= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.7.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/consul/sdk v0.13.0 h1:lce3nFlpv8humJL8rNrrGHYSKc3q+Kxfeg3Ii1m6ZWU= github.com/hashicorp/consul/sdk v0.13.0/go.mod h1:0hs/l5fOVhJy/VdcoaNqUSi2AUs95eF5WKtv+EYIQqE= +github.com/hashicorp/consul/sdk v0.13.1 h1:EygWVWWMczTzXGpO93awkHFzfUka6hLYJ0qhETd+6lY= github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c= github.com/hashicorp/cronexpr v1.1.1/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -1832,8 +1830,8 @@ github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39 github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.3.1 h1:vDwF1DFNZhntP4DAjuTpOw3uEgMUpXh1pB5fW9DqHpo= -github.com/hashicorp/go-hclog v1.3.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -1851,8 +1849,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/go-plugin v0.0.0-20180331002553-e8d22c780116/go.mod h1:JSqWYsict+jzcj0+xElxyrBQRPNoiWQuddnxArJ7XHQ= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-plugin v1.4.5 h1:oTE/oQR4eghggRg8VY7PAz3dr++VwDNBGCcOfIvHpBo= -github.com/hashicorp/go-plugin v1.4.5/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-retryablehttp v0.0.0-20180531211321-3b087ef2d313/go.mod h1:fXcdFsQoipQa7mwORhKad5jmDCeSy/RCGzWA08PO0lM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= @@ -1920,8 +1918,9 @@ github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOn github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69/go.mod h1:/z+jUGRBlwVpUZfjute9jWaF6/HuhjuFQuL1YXzVD1Q= -github.com/hashicorp/nomad/api v0.0.0-20230124213148-69fd1a0e4bf7 h1:XOdd3JHyeQnBRxotBo9ibxBFiYGuYhQU25s/YeV2cTU= github.com/hashicorp/nomad/api v0.0.0-20230124213148-69fd1a0e4bf7/go.mod h1:xYYd4dybIhRhhzDemKx7Ddt8CvCosgrEek8YM7/cF0A= +github.com/hashicorp/nomad/api v0.0.0-20230308192510-48e7d70fcd4b h1:EkuSTU8c/63q4LMayj8ilgg/4I5PXDFVcnqKfs9qcwI= +github.com/hashicorp/nomad/api v0.0.0-20230308192510-48e7d70fcd4b/go.mod h1:bKUb1ytds5KwUioHdvdq9jmrDqCThv95si0Ub7iNeBg= github.com/hashicorp/raft v1.0.1-0.20190409200437-d9fe23f7d472/go.mod h1:DVSAWItjLjTOkVbSpWQ0j0kUADIvDaCtBxIcbNAQLkI= github.com/hashicorp/raft-boltdb v0.0.0-20150201200839-d1e82c1ec3f1/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= github.com/hashicorp/serf v0.8.1/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= @@ -1962,8 +1961,10 @@ github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d/go.mod h1:+NfK9FKe github.com/heroku/rollrus v0.2.0/go.mod h1:B3MwEcr9nmf4xj0Sr5l9eSht7wLKMa1C+9ajgAU79ek= github.com/heroku/x v0.0.55 h1:LSXseirdcQaVobauVkRLbN1VnxVmRQgRABrDA1Cz2Q8= github.com/heroku/x v0.0.55/go.mod h1:YZxbWdDeSewnf/CDZM2UXCZZPU9JZfObfms5FT3P8NA= -github.com/hetznercloud/hcloud-go v1.39.0 h1:RUlzI458nGnPR6dlcZlrsGXYC1hQlFbKdm8tVtEQQB0= github.com/hetznercloud/hcloud-go v1.39.0/go.mod h1:mepQwR6va27S3UQthaEPGS86jtzSY9xWL1e9dyxXpgA= +github.com/hetznercloud/hcloud-go v1.41.0 h1:KJGFRRc68QiVu4PrEP5BmCQVveCP2CM26UGQUKGpIUs= +github.com/hetznercloud/hcloud-go v1.41.0/go.mod h1:NaHg47L6C77mngZhwBG652dTAztYrsZ2/iITJKhQkHA= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs= github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E= github.com/hodgesds/perf-utils v0.0.8/go.mod h1:F6TfvsbtrF88i++hou29dTXlI2sfsJv+gRZDtmTJkAs= @@ -1977,6 +1978,7 @@ github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOc github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/iamseth/oracledb_exporter v0.0.0-20230504204552-f801dc432dcf h1:lIYeFWgKJhxvCg1aiDm5I2v/NTSuAVICVOBSgXRprY0= github.com/iamseth/oracledb_exporter v0.0.0-20230504204552-f801dc432dcf/go.mod h1:h28Du+ajurFyjewagn5xG+6E28oCBbCAkLan5H9UYTo= +github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -1993,7 +1995,6 @@ github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/infinityworks/go-common v0.0.0-20170820165359-7f20a140fd37 h1:Lm6kyC3JBiJQvJrus66He0E4viqDc/m5BdiFNSkIFfU= @@ -2008,8 +2009,9 @@ github.com/influxdata/telegraf v1.16.3 h1:x0qeuSGGMg5y+YqP/5ZHwXZu3bcBrO8AAQOTNl github.com/influxdata/telegraf v1.16.3/go.mod h1:fX/6k7qpIqzVPWyeIamb0wN5hbwc0ANUaTS80lPYFB8= github.com/influxdata/toml v0.0.0-20190415235208-270119a8ce65/go.mod h1:zApaNFpP/bTpQItGZNNUMISDMDAnTXu9UqJ4yT3ocz8= github.com/influxdata/wlog v0.0.0-20160411224016-7c63b0a71ef8/go.mod h1:/2NMgWB1DHM1ti/gqhOlg+LJeBVk6FqR5aVGYY0hlwI= -github.com/ionos-cloud/sdk-go/v6 v6.1.3 h1:vb6yqdpiqaytvreM0bsn2pXw+1YDvEk2RKSmBAQvgDQ= github.com/ionos-cloud/sdk-go/v6 v6.1.3/go.mod h1:Ox3W0iiEz0GHnfY9e5LmAxwklsxguuNFEUSu0gVRTME= +github.com/ionos-cloud/sdk-go/v6 v6.1.4 h1:BJHhFA8Q1SZC7VOXqKKr2BV2ysQ2/4hlk1e4hZte7GY= +github.com/ionos-cloud/sdk-go/v6 v6.1.4/go.mod h1:Ox3W0iiEz0GHnfY9e5LmAxwklsxguuNFEUSu0gVRTME= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -2061,8 +2063,8 @@ github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jaegertracing/jaeger v1.38.1 h1:IunKLJl9Imgpxh3ZL+SD+E7KHYAkaeiOnjay9YeUl3o= -github.com/jaegertracing/jaeger v1.38.1/go.mod h1:T5RFOZgRQBXR9rpQq8HsiIg39gu0DAYGQbDzpKw9gU8= +github.com/jaegertracing/jaeger v1.41.0 h1:vVNky8dP46M2RjGaZ7qRENqylW+tBFay3h57N16Ip7M= +github.com/jaegertracing/jaeger v1.41.0/go.mod h1:SIkAT75iVmA9U+mESGYuMH6UQv6V9Qy4qxo0lwfCQAc= github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da h1:FjHUJJ7oBW4G/9j1KzlHaXL09LyMVM9rupS39lncbXk= github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da/go.mod h1:ks+b9deReOc7jgqp+e7LuFiCBH6Rm5hL32cLcEAArb4= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= @@ -2163,15 +2165,14 @@ github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdY github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/knadh/koanf v1.4.4 h1:d2jY5nCCeoaiqvEKSBW9rEc93EfNy/XWgWsSB3j7JEA= -github.com/knadh/koanf v1.4.4/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= +github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= +github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08/go.mod h1:dFWs1zEqDjFtnBXsd1vPOZaLsESovai349994nHx3e0= github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00= github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= @@ -2220,13 +2221,12 @@ github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linode/linodego v0.7.1/go.mod h1:ga11n3ivecUrPCHN0rANxKmfWBJVkOXfLMZinAbj2sY= -github.com/linode/linodego v1.12.0 h1:33mOIrZ+gVva14gyJMKPZ85mQGovAvZCEP1ftgmFBjA= github.com/linode/linodego v1.12.0/go.mod h1:NJlzvlNtdMRRkXb0oN6UWzUkj6t+IBsyveHgZ5Ppjyk= +github.com/linode/linodego v1.14.1 h1:uGxQyy0BidoEpLGdvfi4cPgEW+0YUFsEGrLEhcTfjNc= +github.com/linode/linodego v1.14.1/go.mod h1:NJlzvlNtdMRRkXb0oN6UWzUkj6t+IBsyveHgZ5Ppjyk= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= github.com/lovoo/gcloud-opentracing v0.3.0/go.mod h1:ZFqk2y38kMDDikZPAK7ynTTGuyt17nSPdS3K5e+ZTBY= github.com/lstoll/grpce v1.7.0/go.mod h1:XiCWl3R+avNCT7KsTjv3qCblgsSqd0SC4ymySrH226g= -github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s= -github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lufia/iostat v1.1.0/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg= github.com/lufia/iostat v1.2.1 h1:tnCdZBIglgxD47RyD55kfWQcJMGzO+1QBziSQfesf2k= github.com/lufia/iostat v1.2.1/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg= @@ -2284,7 +2284,6 @@ github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPn github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= @@ -2411,8 +2410,8 @@ github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mostynb/go-grpc-compression v1.1.17 h1:N9t6taOJN3mNTTi0wDf4e3lp/G/ON1TP67Pn0vTUA9I= -github.com/mostynb/go-grpc-compression v1.1.17/go.mod h1:FUSBr0QjKqQgoDG/e0yiqlR6aqyXC39+g/hFLDfSsEY= +github.com/mostynb/go-grpc-compression v1.1.18 h1:4a9UFaq3GvZO64ZRWPhxbJhAMsbDNIGznsSA3v1oO8U= +github.com/mostynb/go-grpc-compression v1.1.18/go.mod h1:U/0nmev+iFgBJ/jsVEeJi4UzoGrixmDcsfmMB6JsROg= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/mrunalp/fileutils v0.5.0 h1:NKzVxiH7eSk+OQ4M+ZYW1K6h27RUV3MI6NUTsHhU6Z4= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= @@ -2463,8 +2462,6 @@ github.com/nsqio/go-nsq v1.0.7/go.mod h1:XP5zaUs3pqf+Q71EqUJs3HYfBIqfK6G83WQMdNN github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/observiq/ctimefmt v1.0.0 h1:r7vTJ+Slkrt9fZ67mkf+mA6zAdR5nGIJRMTzkUyvilk= -github.com/observiq/ctimefmt v1.0.0/go.mod h1:mxi62//WbSpG/roCO1c6MqZ7zQTvjVtYheqHN3eOjvc= github.com/ohler55/ojg v1.18.7 h1:sC7zy0usEiWa6bvx3NU1yZH4kCA2F3Qzs6iiDX4+xdk= github.com/ohler55/ojg v1.18.7/go.mod h1:uHcD1ErbErC27Zhb5Df2jUjbseLLcmOCo6oxSr3jZxo= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= @@ -2523,61 +2520,65 @@ github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.63.0 h1:jQ/nnQsgQ9PHX8nWMmieQk0RzJc9sXiJFSqot/e2W50= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.63.0/go.mod h1:BKCTvibAeX1qg5d64WxY5Z+jdQDJ0lkpwtJc4NTuHvo= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.63.0 h1:cGWIMHWZD+zTylhTM6kMqwXWOALyuJYodp+dedLCgq8= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.63.0/go.mod h1:OTl+s8uwxAT+AHHMsAEU5J5rxmcmywlDToUOEXL/9sI= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/loadbalancingexporter v0.63.0 h1:9/wXqfG/rEJ+orDLcZ4Vs2jX8RDaa6Vm1LfaNkrl2Vk= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/loadbalancingexporter v0.63.0/go.mod h1:bU01tQTTwH5KHwrfFvIZN1RtCvCEr5Tcv3ISU+hVbkw= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.63.0 h1:xW8ymxJumYgn26Yf3TFxHNtv2VXOuN0baqxx00pf/Y4= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.63.0/go.mod h1:DsOrvNEMZvbHJjmYk9ZQ6HFi0/7kO9yu+GV+Y2cxjsk= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.61.0 h1:O02J3B6hkVtftbtXCbkEyaQm1mDu5k6VoVOghJgN95o= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.61.0/go.mod h1:lSpO0oRJvNEbAdKbKIqJ7Lb+Tfj6XI9N415E0ATAMYE= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.61.0 h1:s3Xc8ncFd8E4va9xDIXoEYzoBILSe2bdGwxMuS6MVBE= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.61.0/go.mod h1:AlW4Z/pvtLqP0PtLzuh1I5ifJXEsSWTTj0g194BEsQA= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension v0.61.0 h1:JMkOySvXivup4MNLB8FhdxmloQlJoxEm4FqUI+fk0Tg= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension v0.61.0/go.mod h1:+Yjsoz9iiXiPPChQnGCW710kkrMNwApF6s3AwIFVby0= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.63.0 h1:rF8UuIGWZMi0LugBGrPzQCpQiwi96AA0xY5beCEskVA= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.63.0/go.mod h1:cKToSzuvHNDTPH94Y24z3LsNP/f9adbzobUOpfAJ4CI= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.63.0 h1:5iAXWskfOYsj4BO9avGO1RyBmCYRSUb4bY+pn1zIQjw= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.63.0/go.mod h1:xKj9JaEbmfyD6DkyMf4kHB7QUWxkbmnlh4MqLMvdot4= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.63.0 h1:/VP8ntb3Kjx2v2+vmrZTNAAnJOwCIfHpcPaFem3+NCY= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.63.0 h1:NsaYjgHJVTkjef8ZTkuYWATDFvBZU7wfVcMQsXUHbVM= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.63.0 h1:2jXMdfJ36Hs7QuzlhvC9wi9xFCJ9q0a40qjPaFEsDI8= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.63.0/go.mod h1:Vo92E1v3sPewq/74L573iW9dCJl40na+Heum93YGbPQ= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.63.0 h1:fFwJGoSCkiKmAT8fbIzMZwhoabB5S/7VOvD5B/jZuCQ= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.63.0/go.mod h1:vbltCC8k3EUnIwhh6QARUcSKqpXMrMaEs0gdqRVWAl8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.63.0 h1:qSdRMT9BUNEM3u/OKjg+btzTQQZeXzzgp9GGVf1CXFY= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.63.0/go.mod h1:5ZKBQ9B/qM4XmJLHC1B5H5KdVVbTgnEZp9EAzIsm+/w= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.63.0 h1:17Bw6z1FOtHeK446eAHHt6TBzmpYaufCMuEDpbZAAyA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.63.0/go.mod h1:UDUauqPQgqflOJVnOD3Ut4iVuTaGg1Y9G6yA+mRCXF8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.63.0 h1:2/DBbtCcEFOg2h64UkO2cMFrDFD5CzhYizUxm7dLOEY= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.63.0/go.mod h1:wiWJHLJlVUk5yOmhZvyk9XqoPcVWnFHZzQkEHamA8CE= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.63.0 h1:XzKVij0Zmwei9a3ktwWk11GMX0FX+WGDg3cw9/tytmw= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.63.0/go.mod h1:w5rHiSvZJ110BJE/xLQxtlCGEELhfJ46dPR7XAHBXHE= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki v0.63.0 h1:I8F8AEPyXeAMNLVaajKvO2mB7u1bTA/LqdDlfJCYGcY= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki v0.63.0/go.mod h1:abIg0b0KukLnR6owOmUsJRlhy12/x2DhwKmjWNTueCY= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.63.0 h1:8BZjkVilBkS7SdrwF+u/ZdE6T6Xy9tuFx+dqhn7d+Nc= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.63.0/go.mod h1:5dGHcdbTljgvIX05yeobiBQEDqVaLWRxJ8FfaHH0sXw= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.63.0 h1:dtk8VTTTLozsrvNcOryh0s2XxrpqiInxSvIRCnRrKgo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.63.0/go.mod h1:eTefEk6tf9cn1ur+sEHh7ygghfatOf/kDL7KRyLiowo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.63.0 h1:4QCzLDflK3Bz1eMS20Cho7cC9MW7tSJZiIK1TI7b3XA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.63.0/go.mod h1:AL75UWqPct104ab4juSg8ChVTFq8hYqPtq8uP7aM2DQ= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.63.0 h1:6+LmD1djirBkC8rKDQoSEYcYaGNfdPvwxQvfJrjHtNM= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.63.0/go.mod h1:7ZuYh9HCR5n4338uRfgxK6Z9QTHzSi8jl+x8d4SufWQ= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.63.0 h1:fvp7yVS0ZTp6zxdz2bmvJkBuJXT1Tzq+mB7oEqSESFA= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.63.0/go.mod h1:70eVH1LWKSL7MafpvXii6QnT3SGQTjqvFw2QDl22zDY= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.63.0 h1:MrqLE1hlP/CYrcUdCjjdtGRqCCw0n/musLUM0qVBpU0= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.63.0/go.mod h1:tgeOki/yf4uvIcQrQrol/VPwWF2vf1sv/iPGgucz0d0= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.63.0 h1:s4/A9iJGi0scBpsueBgInA9Z8z8QrHvoHJYQ/DqLIgM= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.63.0/go.mod h1:6B3JPKJrLa8Ulo7h2vklZxsJVRaphH+3sz0dm6qT/Vg= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.63.0 h1:VxurDk8lbNINp6V/CZwqifawkJHEMbZRPtaSq+ngM/M= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.63.0/go.mod h1:7xar8bAMqJXa1CB06G2DJCvEBW/xYflMozWgP2jlZ+I= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.63.0 h1:RIXEUx2f/gUpBzui/yKG5Y7Infin8YVdvrbigZaL4oE= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.63.0/go.mod h1:5jOmWkwFoj+8scyAp5NMKgZzcorIhD54Bwn/05N5wuM= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.63.0 h1:ZbozlgAgr+Ozn6AAI4BJ3+zIKDX4tFBYFxMhsEnrt6Y= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.63.0 h1:sj7UU3LMKQ5DILVUq/qRht1tG9bYKNyg6xV0jhtrQkk= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.63.0/go.mod h1:gTJP/fLyVLz3DBNn2ZdRGWFy4u6DFJvZqcjyd35IwZg= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.79.0 h1:Sjz3KURpjrBPQkvwQiV02na8aATCBAX778c3ZGCMe2I= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.79.0/go.mod h1:ThNKKFNiiiYu+7X2rS7+nAxmuAPasflpnP2YfRQnA+A= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.79.0 h1:ZnMXlPr89HVj5HttFJbElyhlS/Em17pQ2rjtpxFv7oY= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.79.0/go.mod h1:5+6okkKWFKvkWTMgDS1NYpcmdvNnj8Pm4Ln+Njr1+6o= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/loadbalancingexporter v0.79.0 h1:d1Y/1y+t95+ESZygemii05j5qdfeSd8z5Gxhn5FLoJ8= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/loadbalancingexporter v0.79.0/go.mod h1:9nlVKQim3X8lYAIQxSwtaJnkxdCIjMECyB45zUN7NmQ= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.79.0 h1:WDTgjxG1Ho5Aip0Gx6ZltTCsEqtF9ydyc+A7VpYshrI= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.79.0/go.mod h1:nB1tsarX+1UiBKjDmZ4BgUslCtTI1aZhdwX5gU4r2Fw= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.79.0 h1:Mci/bnPNBl4k1qXx8iqvXjPJvwmmW82AtWsJ4lc4uKM= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.79.0/go.mod h1:oTHjRYegHhIlYN5vQdH3aauDChKpkzBTnA4zYcAyR2Y= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.79.0 h1:mjEoGk44kLrQixF4XIXLWdgRjJzyncHO6TyOvHspt6w= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.79.0/go.mod h1:2YgPCfKEBePXKBje83ORqCDxsIoiFjamCvCF2C7l29o= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension v0.79.0 h1:GbQLphSDQ947g/I3248Ww4MD8v6VFACcLGsfj2F6HUg= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension v0.79.0/go.mod h1:7dEWh1aCP3rEuCWBJOJsDtBlBdn+mAeuNCH1HkMo7e4= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.79.0 h1:MV39KCt9Q4LeRcifYFyiV26bxvM7/lA2M4gD6FTAx9E= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.79.0/go.mod h1:rdkIWLgjUibqWOtzfJ2rSkSkJRDt0LTB9pC+WdcMQoE= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.79.0 h1:U5su5S9VGosvc+4yl40thX6zKi+lCo8FZsxZbaE7vVI= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.79.0/go.mod h1:ScXqPVU2e9cIh2yhcbIb7Rq7/7rrrkHLNreoX40p+GQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.79.0 h1:MRs7tZ9I29OwPPMTg0uLG+URsV9kClGY/sJ3D9PCrA8= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.79.0 h1:OZPeakqoSZ1yRlmGBlWi9kISx/9PJzlNLGLutFPOQY0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.79.0/go.mod h1:VOHKYi1wm+/c2wZA3mY1Grd4eYP8uS//EV0yHBbGfGw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.79.0 h1:weM5gVbHIbjYoQ8yZNRCc6CJVJbDKtlrSvHULVApiJ4= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.79.0/go.mod h1:Lv4lLbiq+dS9yABBNVfd0lAdgv9RGZCNWBJvfPXsRaQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.79.0 h1:GUJzejawtyOk9Iz9XJQ6ihdIIftfO2vTgQ84HdrcAiE= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.79.0/go.mod h1:JM8fR/4ZuVIsjmtHHvBU547gluTv0D5ACUuMxbhm/J8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.79.0 h1:2ugYXH+7ovErx+U4bWv4rtY5T6LEzAgCQ6pApQWWzhE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.79.0/go.mod h1:qR9fhN7MglOcLiGU5ioYAEDiYKbcoQUJ8uW4uPJ4Ork= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.79.0 h1:fbh6YUVwOKhLa+kEbuH5jXqLXNkdyu96BwvaUVabOjc= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.79.0/go.mod h1:dDcTzcj8ra6wjk9YNOULEcUlQl9amjME35hpLdThuL0= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.79.0 h1:YtkbJjknfMJ4UKXdaUBTw37QLxYXuVMmozqPFTM0XPI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.79.0 h1:Cao5mD7NFJsMLM40lisqJ4Iy3+v+JOq+8cR79/Uki94= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.79.0/go.mod h1:/wfeJfzu3oAkC2boitFR3dZcnwNtwzryI/SW1LIhDLo= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.79.0 h1:R9lB4lMuDaCJP9l6SiOA9u0GPJm5nV5Fefb9cPo9gZQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.79.0/go.mod h1:KBcxvUZWwgSPwdH3oOub7NGNnwu673UdMDXtgn9xjvU= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.79.0 h1:litBmOODNZ5k8XE09FD3T1KOIASXqk7ktIyxyM9xLIs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.79.0/go.mod h1:Zyqr3oq5gK99+nqA6WwHxj1ZnaFj+uj0EFY9BzR9QCU= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki v0.79.0 h1:B97BW8izqXW3JfUP+EK1hn2JLmzdvgemhlqZ9rPHKrE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki v0.79.0/go.mod h1:7ZWD014FW/XHxfBQln8Hol7I3+XBirRB/NlyKBT22nI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.79.0 h1:Xazghy2LA9FSYM7LLBizZcSajffhF7l8jV2RY8fG58c= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.79.0/go.mod h1:apQSxsBwQSK6jcnShW0ntruGCZ63WcDdhuvdMSO+Qkk= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.79.0 h1:F6rc6ivh6EoHlaSaWDom7dKN7b5e2Zss5TNi1S2QR8A= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.79.0/go.mod h1:owoAzfn0tUVguGxqc1s25IrEdiAbon5fZGoUfgAuylQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.79.0 h1:Jtlu4zds7fc9rEoAxGdOAOehh7GOoLUJJQpraK9o33M= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.79.0/go.mod h1:97Zpt/TbjbjSP1zlYn/kBxLW63M+hUwTbWP2JWwA6zU= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.79.0 h1:yh/hTQZ7YtSwKf0Va5UbHaWesCIeSAjQoNEJJdLL0e8= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.79.0/go.mod h1:AOrl9w94z4x9oLjpeXITU/OMGu6tmqKD8gbom0i+920= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.79.0 h1:s3dQ07Cmoc/sdLc3nA3snsKzqUFLuwqs8ThCmPT/BrQ= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.79.0/go.mod h1:QEVVlMjhC7eAM89/3LAZgMcojCUAttcb80enYOJhTts= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.79.0 h1:0ebTn+X7H3oLWq6RoloGhT0pBeedi/jjPb3g89g2/dI= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.79.0/go.mod h1:k8QEENqRXPNxTRKtHu+BJyAMBbxgdOuU31UjDPP+3V0= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.79.0 h1:OTyFAMBK6mTkLf3rLDWfCnwAM4NddyXmx7pM4miu5+Q= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.79.0/go.mod h1:i1rw6P/VduJL4EehAbNnSBzOuFCUr+ejT684D9IGE0g= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.79.0 h1:EzfuL607RcT2+Ch46ZVZTl0xOgT6po3UB7b19+Q8lRM= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.79.0/go.mod h1:SFKlHoiTkncUGTt2glmiNCeg974+593ak6kD8lBfyKo= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.79.0 h1:KxfE5QeuqqKzuI+1h8S9pobXXxoPo6MnpimSTaw5ccc= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.79.0/go.mod h1:p7Rul1UuvcNDtpGVThttYYZNrMgniEsLX3wZkwDjNbM= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.79.0 h1:+mJSVctdGemxKt2O6ZaccrNEiWQ7OCRuGfD+9nUEZRg= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.79.0 h1:7GYBt7dmeGgBPifrEjaMrKZHtXUgx82hAF7Swfwbf2k= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.79.0/go.mod h1:mY11E+69xT/T2VB65TMk/54/ZAeVNDqGlpCjKkWpAR8= github.com/openconfig/gnmi v0.0.0-20180912164834-33a1865c3029/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -2673,7 +2674,6 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= @@ -2820,6 +2820,16 @@ github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9 github.com/prometheus/statsd_exporter v0.22.8 h1:Qo2D9ZzaQG+id9i5NYNGmbf1aa/KxKbB9aKfMS+Yib0= github.com/prometheus/statsd_exporter v0.22.8/go.mod h1:/DzwbTEaFTE0Ojz5PqcSk6+PFHOPWGxdXVr6yC8eFOM= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/ptodev/opentelemetry-collector v0.0.0-20230608105454-0c02b84d03d4 h1:J7QsCRaCRUikS9KgYJvEqwlwbQpzu70ADuUB3vn1PAU= +github.com/ptodev/opentelemetry-collector v0.0.0-20230608105454-0c02b84d03d4/go.mod h1:ms0HzXEL07MlE7Tba9WYQ3hhS5JuVBRW+5QM2MDzNAg= +github.com/ptodev/opentelemetry-collector/exporter/otlpexporter v0.0.0-20230608105454-0c02b84d03d4 h1:4XlJCXO21deNU5CP/9b07Bt2GSR5ESHimFYocUtEdQw= +github.com/ptodev/opentelemetry-collector/exporter/otlpexporter v0.0.0-20230608105454-0c02b84d03d4/go.mod h1:zYW9hrPtqDQS4YPeRJV3CAUfRX05/EzMi70aVVdL51M= +github.com/ptodev/opentelemetry-collector/exporter/otlphttpexporter v0.0.0-20230608105454-0c02b84d03d4 h1:Z2K6RxvCHCVD9LO7dZarvGg2hjXrZEVZks92affwcUA= +github.com/ptodev/opentelemetry-collector/exporter/otlphttpexporter v0.0.0-20230608105454-0c02b84d03d4/go.mod h1:uWTeG4e+7asfhMZ8tGvIUDcDgx5vILeUH/0RI9BUAWw= +github.com/ptodev/opentelemetry-collector/featuregate v0.0.0-20230608105454-0c02b84d03d4 h1:x0RQtv4HcV6VxgvJpSt352xL5e6+9MuBR0jj3OYJtxY= +github.com/ptodev/opentelemetry-collector/featuregate v0.0.0-20230608105454-0c02b84d03d4/go.mod h1:0mE3mDLmUrOXVoNsuvj+7dV14h/9HFl/Fy9YTLoLObo= +github.com/ptodev/opentelemetry-collector/pdata v0.0.0-20230608105454-0c02b84d03d4 h1:R4xWaZx2uNjWIpbaBzV7EqxNwPuvbJmc39gs6CpnSgM= +github.com/ptodev/opentelemetry-collector/pdata v0.0.0-20230608105454-0c02b84d03d4/go.mod h1:0J5SebctoOSo+5fdRWc7TKu0wc7nDbZ6I603WKY24sg= github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1/go.mod h1:JaY6n2sDr+z2WTsXkOmNRUfDy6FN0L6Nk7x06ndm4tY= github.com/rcrowley/go-metrics v0.0.0-20160613154715-cfa5a85e9f0a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -2836,8 +2846,6 @@ github.com/rfratto/go-yaml v0.0.0-20211119180816-77389c3526dc/go.mod h1:rMzeXFmW github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/richardartoul/molecule v1.0.1-0.20221107223329-32cfee06a052 h1:Qp27Idfgi6ACvFQat5+VJvlYToylpM/hcyLBI3WaKPA= github.com/richardartoul/molecule v1.0.1-0.20221107223329-32cfee06a052/go.mod h1:uvX/8buq8uVeiZiFht+0lqSLBHF+uGV8BrTv8W/SIwk= -github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498/go.mod h1:6lkG1x+13OShEf0EaOCaTQYyB7d5nSbb181KtjlS+84= -github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8= github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= @@ -2854,8 +2862,8 @@ github.com/rollbar/rollbar-go v1.0.2/go.mod h1:AcFs5f0I+c71bpHlXNNDbOWJiKwjFDtIS github.com/rollbar/rollbar-go v1.2.0/go.mod h1:czC86b8U4xdUH7W2C6gomi2jutLm8qK0OtrF5WMvpcc= github.com/rs/cors v1.8.0/go.mod h1:EBwu+T5AvHOcXwvZIkQFjUN6s8Czyqw12GL/Y0tUyRM= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= +github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= @@ -2874,12 +2882,12 @@ github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5A github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sanity-io/litter v1.2.0/go.mod h1:JF6pZUFgu2Q0sBZ+HSV35P8TVPI1TTzEwyu9FXAw2W4= github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.12 h1:Aaz4T7dZp7cB2cv7D/tGtRdSMh48sRaDYr7Jh0HV4qQ= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.12/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.14 h1:yFl3jyaSVLNYXlnNYM5z2pagEk1dYQhfr1p20T1NyKY= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.14/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= @@ -2896,11 +2904,14 @@ github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX github.com/shirou/gopsutil v0.0.0-20181107111621-48177ef5f880/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v2.20.9+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.21.9/go.mod h1:YWp/H8Qs5fVmf17v7JNZzA0mPJ+mS2e9JdiUF9LlKzQ= -github.com/shirou/gopsutil/v3 v3.22.9 h1:yibtJhIVEMcdw+tCTbOPiF1VcsuDeTE4utJ8Dm4c5eA= -github.com/shirou/gopsutil/v3 v3.22.9/go.mod h1:bBYl1kjgEJpWpxeHmLI+dVHWtyAwfcmSBLDsp2TNT8A= +github.com/shirou/gopsutil/v3 v3.23.5 h1:5SgDCeQ0KW0S4N0znjeM/eFHXXOKyv2dVNgRq/c9P6Y= +github.com/shirou/gopsutil/v3 v3.23.5/go.mod h1:Ng3Maa27Q2KARVJ0SPZF5NdrQSC3XHKP8IIWrHgMeLY= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= -github.com/shoenig/test v0.6.0 h1:rU0ymLHmCRqz14gABce/DzYryKU+uaWqobCBvAY6DtU= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.0/go.mod h1:xYtyGBC5Q3kzCNyJg/SjgNpfAa2kvmgA0i5+lQso8x0= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v0.0.0-20200105231215-408a2507e114/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= @@ -2970,8 +2981,8 @@ github.com/spf13/cobra v0.0.2/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -3004,7 +3015,6 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -3018,6 +3028,7 @@ github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807 h1:LUsDduamlucuNnWcaTbXQ6aLILFcLXADpOzeEH3U+OI= @@ -3042,8 +3053,8 @@ github.com/testcontainers/testcontainers-go v0.20.2-0.20230615142642-c175df34bd1 github.com/testcontainers/testcontainers-go v0.20.2-0.20230615142642-c175df34bd1d/go.mod h1:c1ez3WVRHq7T/Aj+X3TIipFBwkBaNT5iNCY8+1b83Ng= github.com/testcontainers/testcontainers-go/modules/k3s v0.0.0-20230615142642-c175df34bd1d h1:KyYCHo9iBoQYw5AzcozD/77uNbFlRjTmMTA7QjSxHOQ= github.com/testcontainers/testcontainers-go/modules/k3s v0.0.0-20230615142642-c175df34bd1d/go.mod h1:Pa91ahCbzRB6d9FBi6UAjurTEm7WmyBVeuklLkwAKKs= -github.com/tg123/go-htpasswd v1.2.0 h1:UKp34m9H467/xklxUxU15wKRru7fwXoTojtxg25ITF0= -github.com/tg123/go-htpasswd v1.2.0/go.mod h1:h7IzlfpvIWnVJhNZ0nQ9HaFxHb7pn5uFJYLlEUJa2sM= +github.com/tg123/go-htpasswd v1.2.1 h1:i4wfsX1KvvkyoMiHZzjS0VzbAPWfxzI8INcZAKtutoU= +github.com/tg123/go-htpasswd v1.2.1/go.mod h1:erHp1B86KXdwQf1X5ZrLb7erXZnWueEQezb2dql4q58= github.com/thanos-io/thanos v0.19.1-0.20211126105533-c5505f5eaa7d/go.mod h1:sfnKJG7cDA41ixNL4gsTJEa3w9Qt8lwAjw+dqRMSDG0= github.com/thanos-io/thanos v0.30.0 h1:/0XFg7yPF9UXrnDdiC7xASG7NocKE0uoxGZf0B20Utw= github.com/thanos-io/thanos v0.30.0/go.mod h1:ve1mHR1dhCRqQlp0C5g+AFENoNu9GA4gtq1+Og6nuzc= @@ -3053,13 +3064,14 @@ github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0 github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tilinna/clock v1.1.0 h1:6IQQQCo6KoBxVudv6gwtY8o4eDfhHo8ojA5dP0MfhSs= +github.com/tilinna/clock v1.1.0/go.mod h1:ZsP7BcY7sEEz7ktc0IVy8Us6boDrK8VradlKRUGfOao= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= -github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= -github.com/tklauser/numcpus v0.5.0 h1:ooe7gN0fg6myJ0EKoTAf5hebTZrH52px3New/D9iJ+A= -github.com/tklauser/numcpus v0.5.0/go.mod h1:OGzpTxpcIMNGYQdit2BYL1pvk/dSOaJWjKoflh+RQjo= +github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= +github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -3175,8 +3187,8 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t github.com/yuin/gopher-lua v0.0.0-20180630135845-46796da1b0b4/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ= -github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -3243,25 +3255,50 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector/semconv v0.63.1 h1:o9Zz/vwqT85XXYf9XTIXa0qkmfEY8b/JMm4lXf+dwpc= -go.opentelemetry.io/collector/semconv v0.63.1/go.mod h1:5o9yhOa+ABt7g2E5JABDxGZ1PQPbtfxrKNbYn+LOTXU= +go.opentelemetry.io/collector/component v0.80.0 h1:yL+YJDnsAYF8Yviu4MceqNfQN16PDi8hIMUEllxNBlA= +go.opentelemetry.io/collector/component v0.80.0/go.mod h1:4BMtyTmTmw7u3GCibdI+DY8S3q+Hk3W6CLTOk+WHoGU= +go.opentelemetry.io/collector/confmap v0.80.0 h1:OJapAGOdvyUiovMH5yL860s3ULo9eC21hP/Jl2FXbK0= +go.opentelemetry.io/collector/confmap v0.80.0/go.mod h1:L2d3LUsKYxAAORcpuXjW/Pln95vmw5p6lWDf6Pr/fUg= +go.opentelemetry.io/collector/consumer v0.80.0 h1:IQfkrNvZ6/ZkfQs/d6JENgfYPE3g3NcVcy1eC8nku58= +go.opentelemetry.io/collector/consumer v0.80.0/go.mod h1://MinWlTMlL44B8WvUzLnYWBKgxfgGE8grpxoUiL9aQ= +go.opentelemetry.io/collector/exporter v0.80.0 h1:BjwrMGhlrJ6IyhOOkPruzycCk7dv6vuf+VORzsVtcLI= +go.opentelemetry.io/collector/exporter v0.80.0/go.mod h1:qcvFsxN8AaSxJ60WxSF0zGUTCMhGBWY3Coa9iiONWbg= +go.opentelemetry.io/collector/exporter/loggingexporter v0.79.0 h1:rPoHM4n6y93vBJkEXjo5x7jVTNUsM9EO5gbh3fBx1IE= +go.opentelemetry.io/collector/exporter/loggingexporter v0.79.0/go.mod h1:t2/u+KL8R+q9OAEHts1Qr3PpWnqQFXAOdTh4NecOa1I= +go.opentelemetry.io/collector/extension v0.80.0 h1:Nx2QpwBAwcEcCVpqqqJIzpkhniGRhLC5Tr5s+e5H5p0= +go.opentelemetry.io/collector/extension/zpagesextension v0.79.0 h1:I1DIomwNnNecBBSKLR3O0OlEqbPNCtMw48tAfj39VKM= +go.opentelemetry.io/collector/processor/batchprocessor v0.80.0 h1:B3phgqGYRbAM1ZjR7OlAS4hK1XcM2/FDLvzOCycyE6A= +go.opentelemetry.io/collector/processor/batchprocessor v0.80.0/go.mod h1:Qx1iqTNROrUIzecHbbQenO3NacvkKknnZzikD5qUFOg= +go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.80.0 h1:ZK9GRIjqHB74LIUwhCUv7tWO0HlVMdqpo0kTNs2TkF8= +go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.80.0/go.mod h1:Saosjjmi1q1vkLJ8EH/jTvhp37/tTPDa2Sa28G8jCqk= +go.opentelemetry.io/collector/receiver v0.80.0 h1:+dJn57mWaksgKDnR06mAu5aReOcqg1pdgC6zqqLmtZ4= +go.opentelemetry.io/collector/receiver v0.80.0/go.mod h1:DsyjwQZjlcbwoY4Kq4yx1tNL8Z4d8E7e4tbQYzBUw/g= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.79.0 h1:LWYxlRuczwT5+YwBGDzA7Sb4rM5RpdeO/CzO4qQ6lVE= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.79.0/go.mod h1:Zd+Ks3E1Z/YHFSGk/M0E6RqeV4cJIHruFjdr+XVy6S8= +go.opentelemetry.io/collector/semconv v0.79.0 h1:74pzP4c7xWk9Eihs14kEQvE4m4hHgXrQ/YbWkdn1bVY= +go.opentelemetry.io/collector/semconv v0.79.0/go.mod h1:TlYPtzvsXyHOgr5eATi43qEMqwSmIziivJB2uctKswo= go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.36.4 h1:gn5Cf5XpnENThRBjAHq6vuENFo+l9qwnEMqwmanIYuY= go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.36.4/go.mod h1:f26RulijcxdgrGSYep0AykXM9ZkWoKVtInstDYUR8EU= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.4 h1:PRXhsszxTt5bbPriTjmaweWUsAnJYeWBhUMLRetUgBU= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.4/go.mod h1:05eWWy6ZWzmpeImD3UowLTB3VjDMU1yxQ+ENuVWDM3c= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0 h1:yt2NKzK7Vyo6h0+X8BA4FpreZQTlVEIarnsBP/H5mzs= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0 h1:ZOLJc06r4CB42laIXg/7udr0pbZyuAihN10A/XuiQRY= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0/go.mod h1:5z+/ZWJQKXa9YT34fQNx5K8Hd1EoIhvtUygUQPqEOgQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0/go.mod h1:+ARmXlUlc51J7sZeCBkBJNdHGySrdOzgzxp6VWRWM1U= -go.opentelemetry.io/contrib/propagators/b3 v1.11.1 h1:icQ6ttRV+r/2fnU46BIo/g/mPu6Rs5Ug8Rtohe3KqzI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0 h1:pginetY7+onl4qN1vl0xW/V/v6OBZ0vVdH+esuJgvmM= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0/go.mod h1:XiYsayHc36K3EByOO6nbAXnAWbrUxdjUROCEeeROOH8= +go.opentelemetry.io/contrib/propagators/b3 v1.17.0 h1:ImOVvHnku8jijXqkwCSyYKRDt2YrnGXD4BbhcpfbfJo= +go.opentelemetry.io/contrib/propagators/b3 v1.17.0/go.mod h1:IkfUfMpKWmynvvE0264trz0sf32NRTZL4nuAN9AbWRc= +go.opentelemetry.io/contrib/zpages v0.42.0 h1:hFscXKQ9PTjyIVmAr6zIV8cMoiEeR9lPIwPVqHi8+5Q= go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= go.opentelemetry.io/otel v1.0.0-RC1/go.mod h1:x9tRa9HK4hSSq7jf2TKbqFbtt58/TGk0f9XiEYISI1I= go.opentelemetry.io/otel v1.0.0-RC3/go.mod h1:Ka5j3ua8tZs4Rkq4Ex3hwgBgOchyPVq5S6P2lz//nKQ= go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= -go.opentelemetry.io/otel v1.15.0 h1:NIl24d4eiLJPM0vKn4HjLYM+UZf6gSfi9Z+NmCxkWbk= -go.opentelemetry.io/otel v1.15.0/go.mod h1:qfwLEbWhLPk5gyWrne4XnF0lC8wtywbuJbgfAE3zbek= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/bridge/opencensus v0.39.0 h1:YHivttTaDhbZIHuPlg1sWsy2P5gj57vzqPfkHItgbwQ= +go.opentelemetry.io/otel/bridge/opencensus v0.39.0/go.mod h1:vZ4537pNjFDXEx//WldAR6Ro2LC8wwmFC76njAXwNPE= go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.2/go.mod h1:rqbht/LlhVBgn5+k3M5QK96K5Xb0DvXpMJ5SFQpY6uw= go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.22.0/go.mod h1:gIp6+vQxqmh6Vd/mucqnsaFpOuVycQAS/BBXMKzJk0w= @@ -3272,38 +3309,40 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.2 h1:fqR1kli93643au1RKo0 go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.2/go.mod h1:5Qn6qvgkMsLDX+sYK64rHb1FPhpn0UtxF+ouX1uhyJE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.2/go.mod h1:jWZUM2MWhWCJ9J9xVbRx7tzK1mXKpAlze4CeulycwVY= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.11.2/go.mod h1:GZWSQQky8AgdJj50r1KJm8oiQiIPaAX7uZCFQX9GzC8= -go.opentelemetry.io/otel/exporters/prometheus v0.33.0 h1:xXhPj7SLKWU5/Zd4Hxmd+X1C4jdmvc0Xy+kvjFx2z60= -go.opentelemetry.io/otel/exporters/prometheus v0.33.0/go.mod h1:ZSmYfKdYWEdSDBB4njLBIwTf4AU2JNsH3n2quVQDebI= +go.opentelemetry.io/otel/exporters/prometheus v0.39.0 h1:whAaiHxOatgtKd+w0dOi//1KUxj3KoPINZdtDaDj3IA= +go.opentelemetry.io/otel/exporters/prometheus v0.39.0/go.mod h1:4jo5Q4CROlCpSPsXLhymi+LYrDXd2ObU5wbKayfZs7Y= go.opentelemetry.io/otel/internal/metric v0.22.0/go.mod h1:7qVuMihW/ktMonEfOvBXuh6tfMvvEyoIDgeJNRloYbQ= go.opentelemetry.io/otel/internal/metric v0.23.0/go.mod h1:z+RPiDJe30YnCrOhFGivwBS+DU1JU/PiLKkk4re2DNY= go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/metric v0.22.0/go.mod h1:KcsUkBiYGW003DJ+ugd2aqIRIfjabD9jeOUXqsAtrq0= go.opentelemetry.io/otel/metric v0.23.0/go.mod h1:G/Nn9InyNnIv7J6YVkQfpc0JCfKBNJaERBGw08nqmVQ= -go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8= go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/oteltest v1.0.0-RC1/go.mod h1:+eoIG0gdEOaPNftuy1YScLr1Gb4mL/9lpDkZ0JjMRq4= go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= go.opentelemetry.io/otel/sdk v1.0.0-RC1/go.mod h1:kj6yPn7Pgt5ByRuwesbaWcRLA+V7BSDg3Hf8xRvsvf8= go.opentelemetry.io/otel/sdk v1.0.0-RC3/go.mod h1:78H6hyg2fka0NYT9fqGuFLvly2yCxiBXDJAgLKo/2Us= go.opentelemetry.io/otel/sdk v1.11.1/go.mod h1:/l3FE4SupHJ12TduVjUkZtlfFqDCQJlOlithYrdktys= -go.opentelemetry.io/otel/sdk v1.11.2 h1:GF4JoaEx7iihdMFu30sOyRx52HDHOkl9xQ8SMqNXUiU= go.opentelemetry.io/otel/sdk v1.11.2/go.mod h1:wZ1WxImwpq+lVRo4vsmSOxdd+xwoUJ6rqyLc3SyX9aU= +go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= +go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= go.opentelemetry.io/otel/sdk/export/metric v0.22.0/go.mod h1:a14rf2CiHSn9xjB6cHuv0HoZGl5C4w2PAgl+Lja1VzU= go.opentelemetry.io/otel/sdk/export/metric v0.23.0/go.mod h1:SuMiREmKVRIwFKq73zvGTvwFpxb/ZAYkMfyqMoOtDqs= go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= go.opentelemetry.io/otel/sdk/metric v0.22.0/go.mod h1:LzkI0G0z6KhEagqmzgk3bw/dglE2Tk2OXs455UMcI0s= go.opentelemetry.io/otel/sdk/metric v0.23.0/go.mod h1:wa0sKK13eeIFW+0OFjcC3S1i7FTRRiLAXe1kjBVbhwg= -go.opentelemetry.io/otel/sdk/metric v0.33.0 h1:oTqyWfksgKoJmbrs2q7O7ahkJzt+Ipekihf8vhpa9qo= -go.opentelemetry.io/otel/sdk/metric v0.33.0/go.mod h1:xdypMeA21JBOvjjzDUtD0kzIcHO/SPez+a8HOzJPGp0= +go.opentelemetry.io/otel/sdk/metric v0.39.0 h1:Kun8i1eYf48kHH83RucG93ffz0zGV1sh46FAScOTuDI= +go.opentelemetry.io/otel/sdk/metric v0.39.0/go.mod h1:piDIRgjcK7u0HCL5pCA4e74qpK/jk3NiUoAHATVAmiI= go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.opentelemetry.io/otel/trace v1.0.0-RC1/go.mod h1:86UHmyHWFEtWjfWPSbu0+d0Pf9Q6e1U+3ViBOc+NXAg= go.opentelemetry.io/otel/trace v1.0.0-RC3/go.mod h1:VUt2TUYd8S2/ZRX09ZDFZQwn2RqfMB5MzO17jBojGxo= go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= -go.opentelemetry.io/otel/trace v1.15.0 h1:5Fwje4O2ooOxkfyqI/kJwxWotggDLix4BSAvpE1wlpo= -go.opentelemetry.io/otel/trace v1.15.0/go.mod h1:CUsmE2Ht1CRkvE8OsMESvraoZrrcgD1J2W8GV1ev0Y4= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.9.0/go.mod h1:1vKfU9rv61e9EVGthD1zNvUbiwPcimSsOPU9brfSHJg= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= @@ -3352,7 +3391,6 @@ golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -3392,6 +3430,7 @@ golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -3535,6 +3574,7 @@ golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -3650,7 +3690,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -3792,6 +3831,7 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -3949,8 +3989,8 @@ gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJ gonum.org/v1/gonum v0.0.0-20190502212712-4a2eb0188cbc/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o= -gonum.org/v1/gonum v0.12.0/go.mod h1:73TDxJfAAHeA8Mk9mf8NlIppyhQNo5GLTcYeqgo2lvY= +gonum.org/v1/gonum v0.13.0 h1:a0T3bh+7fhRyqeNbiC3qVHYmkiQgit3wnNan/2c0HMM= +gonum.org/v1/gonum v0.13.0/go.mod h1:/WPYRckkfWrhWefxyYTfrTtQR0KH4iyHNuzxqXAKyAU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -4012,8 +4052,8 @@ google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/O9MY= -google.golang.org/api v0.114.0 h1:1xQPji6cO2E2vLiI+C/XiFAnsn1WV3mjaEwGLhi3grE= -google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= +google.golang.org/api v0.125.0 h1:7xGvEY4fyWbhWMHf3R2/4w7L4fXyfpRGE9g6lp8+DCk= +google.golang.org/api v0.125.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -4159,10 +4199,10 @@ google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZV google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 h1:x1vNwUhVOcsYoKyEGCZBH694SBmmBjA2EfauFVEI2+M= -google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a h1:HiYVD+FGJkTo+9zj1gqz0anapsa1JxjiSrN+BJKyUmE= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= @@ -4330,8 +4370,8 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 h1:kmDqav+P+/5e1i9tFfHq1qcF3sOrDp+YEkVDAHu7Jwk= -k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230308161112-d77c459e9343 h1:m7tbIjXGcGIAtpmQr7/NAi7RsWoW3E7Zcm4jI1HicTc= +k8s.io/utils v0.0.0-20230308161112-d77c459e9343/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= modernc.org/httpfs v1.0.0/go.mod h1:BSkfoMUcahSijQD5J/Vu4UMOxzmEf5SNRwyXC4PJBEw= modernc.org/libc v1.3.1/go.mod h1:f8sp9GAfEyGYh3lsRIKtBh/XwACdFvGznxm6GJmQvXk= modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= diff --git a/pkg/flow/tracing/tracing.go b/pkg/flow/tracing/tracing.go index 33034b421515..8304ff8261be 100644 --- a/pkg/flow/tracing/tracing.go +++ b/pkg/flow/tracing/tracing.go @@ -14,7 +14,7 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlptrace" "go.opentelemetry.io/otel/sdk/resource" tracesdk "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "go.opentelemetry.io/otel/trace" ) diff --git a/pkg/integrations/v2/app_agent_receiver/payload.go b/pkg/integrations/v2/app_agent_receiver/payload.go index d2c1f6f3a5e6..2dcce0133e93 100644 --- a/pkg/integrations/v2/app_agent_receiver/payload.go +++ b/pkg/integrations/v2/app_agent_receiver/payload.go @@ -1,6 +1,7 @@ package app_agent_receiver import ( + "encoding/hex" "fmt" "sort" "strconv" @@ -153,11 +154,11 @@ func SpanToKeyVal(s ptrace.Span) *KeyVal { KeyValAdd(kv, "end_timestamp", s.StartTimestamp().AsTime().String()) } KeyValAdd(kv, "kind", "span") - KeyValAdd(kv, "traceID", s.TraceID().HexString()) - KeyValAdd(kv, "spanID", s.SpanID().HexString()) + KeyValAdd(kv, "traceID", hex.EncodeToString([]byte(s.TraceID().String()))) + KeyValAdd(kv, "spanID", hex.EncodeToString([]byte(s.SpanID().String()))) KeyValAdd(kv, "span_kind", s.Kind().String()) KeyValAdd(kv, "name", s.Name()) - KeyValAdd(kv, "parent_spanID", s.ParentSpanID().HexString()) + KeyValAdd(kv, "parent_spanID", hex.EncodeToString([]byte(s.ParentSpanID().String()))) s.Attributes().Range(func(k string, v pcommon.Value) bool { KeyValAdd(kv, "attr_"+k, fmt.Sprintf("%v", v)) return true diff --git a/pkg/traces/automaticloggingprocessor/automaticloggingprocessor.go b/pkg/traces/automaticloggingprocessor/automaticloggingprocessor.go index 97ccc6852886..3ea6c0d8c58a 100644 --- a/pkg/traces/automaticloggingprocessor/automaticloggingprocessor.go +++ b/pkg/traces/automaticloggingprocessor/automaticloggingprocessor.go @@ -2,6 +2,7 @@ package automaticloggingprocessor import ( "context" + "encoding/hex" "errors" "fmt" "strconv" @@ -21,6 +22,7 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" semconv "go.opentelemetry.io/collector/semconv/v1.6.1" "go.uber.org/atomic" ) @@ -53,7 +55,7 @@ type automaticLoggingProcessor struct { logger log.Logger } -func newTraceProcessor(nextConsumer consumer.Traces, cfg *AutomaticLoggingConfig) (component.TracesProcessor, error) { +func newTraceProcessor(nextConsumer consumer.Traces, cfg *AutomaticLoggingConfig) (processor.Traces, error) { logger := log.With(util.Logger, "component", "traces automatic logging") if nextConsumer == nil { @@ -122,7 +124,7 @@ func (p *automaticLoggingProcessor) ConsumeTraces(ctx context.Context, td ptrace lastTraceID := "" for k := 0; k < spanLen; k++ { span := ss.Spans().At(k) - traceID := span.TraceID().HexString() + traceID := hex.EncodeToString([]byte(span.TraceID().String())) if p.cfg.Spans { keyValues := append(p.spanKeyVals(span), p.processKeyVals(rs.Resource(), svc)...) diff --git a/pkg/traces/automaticloggingprocessor/automaticloggingprocessor_test.go b/pkg/traces/automaticloggingprocessor/automaticloggingprocessor_test.go index 85e0873f7007..2457125cf699 100644 --- a/pkg/traces/automaticloggingprocessor/automaticloggingprocessor_test.go +++ b/pkg/traces/automaticloggingprocessor/automaticloggingprocessor_test.go @@ -164,7 +164,7 @@ func TestProcessKeyVals(t *testing.T) { require.NoError(t, err) process := pcommon.NewResource() - process.Attributes().Sort().FromRaw(tc.processAttrs) + process.Attributes().FromRaw(tc.processAttrs) actual := p.(*automaticLoggingProcessor).processKeyVals(process, tc.svc) assert.Equal(t, tc.expected, actual) diff --git a/pkg/traces/automaticloggingprocessor/factory.go b/pkg/traces/automaticloggingprocessor/factory.go index ef375d8f9d45..34aaebc0f3ba 100644 --- a/pkg/traces/automaticloggingprocessor/factory.go +++ b/pkg/traces/automaticloggingprocessor/factory.go @@ -7,8 +7,8 @@ import ( "github.com/grafana/agent/pkg/logs" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/processor" ) // TypeStr is the unique identifier for the Automatic Logging processor. @@ -16,8 +16,6 @@ const TypeStr = "automatic_logging" // Config holds the configuration for the Automatic Logging processor. type Config struct { - config.ProcessorSettings `mapstructure:",squash"` - LoggingConfig *AutomaticLoggingConfig `mapstructure:"automatic_logging"` } @@ -106,26 +104,24 @@ const ( ) // NewFactory returns a new factory for the Attributes processor. -func NewFactory() component.ProcessorFactory { - return component.NewProcessorFactory( +func NewFactory() processor.Factory { + return processor.NewFactory( TypeStr, createDefaultConfig, - component.WithTracesProcessor(createTraceProcessor, component.StabilityLevelUndefined), + processor.WithTraces(createTraceProcessor, component.StabilityLevelUndefined), ) } -func createDefaultConfig() config.Processor { - return &Config{ - ProcessorSettings: config.NewProcessorSettings(config.NewComponentIDWithName(TypeStr, TypeStr)), - } +func createDefaultConfig() component.Config { + return &Config{} } func createTraceProcessor( _ context.Context, - cp component.ProcessorCreateSettings, - cfg config.Processor, + cp processor.CreateSettings, + cfg component.Config, nextConsumer consumer.Traces, -) (component.TracesProcessor, error) { +) (processor.Traces, error) { oCfg := cfg.(*Config) return newTraceProcessor(nextConsumer, oCfg.LoggingConfig) diff --git a/pkg/traces/config.go b/pkg/traces/config.go index 9d0c1ea537ff..472f65f3ea22 100644 --- a/pkg/traces/config.go +++ b/pkg/traces/config.go @@ -24,15 +24,17 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver" "github.com/prometheus/client_golang/prometheus" prom_config "github.com/prometheus/common/config" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" - "go.opentelemetry.io/collector/config/configtest" + "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/confmap" + otelexporter "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/otlpexporter" "go.opentelemetry.io/collector/exporter/otlphttpexporter" + "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/otelcol" + otelprocessor "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/batchprocessor" + "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/otlpreceiver" - "go.opentelemetry.io/collector/service/external/configunmarshaler" "go.uber.org/multierr" "github.com/grafana/agent/pkg/logs" @@ -46,7 +48,9 @@ import ( ) const ( - spanMetricsPipelineName = "metrics/spanmetrics" + spanMetricsPipelineType = "metrics" + spanMetricsPipelineName = "spanmetrics" + spanMetricsPipelineFullName = spanMetricsPipelineType + "/" + spanMetricsPipelineName // defaultDecisionWait is the default time to wait for a trace before making a sampling decision defaultDecisionWait = time.Second * 5 @@ -575,7 +579,7 @@ func formatPolicies(cfg []policy) ([]map[string]interface{}, error) { return policies, nil } -func (c *InstanceConfig) otelConfig() (*config.Config, error) { +func (c *InstanceConfig) otelConfig() (*otelcol.Config, error) { otelMapStructure := map[string]interface{}{} if len(c.Receivers) == 0 { @@ -676,7 +680,7 @@ func (c *InstanceConfig) otelConfig() (*config.Config, error) { } processors["spanmetrics"] = spanMetrics - pipelines[spanMetricsPipelineName] = map[string]interface{}{ + pipelines[spanMetricsPipelineFullName] = map[string]interface{}{ "receivers": []string{noopreceiver.TypeStr}, "exporters": []string{exporterName}, } @@ -800,26 +804,20 @@ func (c *InstanceConfig) otelConfig() (*config.Config, error) { return nil, fmt.Errorf("failed to validate factories: %w", err) } - configMap := confmap.NewFromStringMap(otelMapStructure) - otelCfg, err := configunmarshaler.Unmarshal(configMap, factories) - if err != nil { - return nil, fmt.Errorf("failed to load OTel config: %w", err) - } - - return otelCfg, nil + return otelcolConfigFromStringMap(otelMapStructure, &factories) } // tracingFactories() only creates the needed factories. if we decide to add support for a new // processor, exporter, receiver we need to add it here -func tracingFactories() (component.Factories, error) { - extensions, err := component.MakeExtensionFactoryMap( +func tracingFactories() (otelcol.Factories, error) { + extensions, err := extension.MakeFactoryMap( oauth2clientauthextension.NewFactory(), ) if err != nil { - return component.Factories{}, err + return otelcol.Factories{}, err } - receivers, err := component.MakeReceiverFactoryMap( + receivers, err := receiver.MakeFactoryMap( jaegerreceiver.NewFactory(), zipkinreceiver.NewFactory(), otlpreceiver.NewFactory(), @@ -829,10 +827,10 @@ func tracingFactories() (component.Factories, error) { pushreceiver.NewFactory(), ) if err != nil { - return component.Factories{}, err + return otelcol.Factories{}, err } - exporters, err := component.MakeExporterFactoryMap( + exporters, err := otelexporter.MakeFactoryMap( otlpexporter.NewFactory(), otlphttpexporter.NewFactory(), jaegerexporter.NewFactory(), @@ -841,10 +839,10 @@ func tracingFactories() (component.Factories, error) { remotewriteexporter.NewFactory(), ) if err != nil { - return component.Factories{}, err + return otelcol.Factories{}, err } - processors, err := component.MakeProcessorFactoryMap( + processors, err := otelprocessor.MakeFactoryMap( batchprocessor.NewFactory(), attributesprocessor.NewFactory(), promsdprocessor.NewFactory(), @@ -854,10 +852,10 @@ func tracingFactories() (component.Factories, error) { servicegraphprocessor.NewFactory(), ) if err != nil { - return component.Factories{}, err + return otelcol.Factories{}, err } - return component.Factories{ + return otelcol.Factories{ Extensions: extensions, Receivers: receivers, Processors: processors, @@ -911,22 +909,46 @@ func orderProcessors(processors []string, splitPipelines bool) [][]string { } } +func otelcolConfigFromStringMap(otelMapStructure map[string]interface{}, factories *otelcol.Factories) (*otelcol.Config, error) { + configMap := confmap.NewFromStringMap(otelMapStructure) + otelCfg, err := otelcol.Unmarshal(configMap, *factories) + if err != nil { + return nil, fmt.Errorf("failed to load OTel config: %w", err) + } + + res := otelcol.Config{ + Receivers: otelCfg.Receivers.Configs(), + Processors: otelCfg.Processors.Configs(), + Exporters: otelCfg.Exporters.Configs(), + Connectors: otelCfg.Connectors.Configs(), + Extensions: otelCfg.Extensions.Configs(), + Service: otelCfg.Service, + } + + if err := res.Validate(); err != nil { + return nil, err + } + + return &res, nil +} + // Code taken from OTel's service/configcheck.go // https://github.com/grafana/opentelemetry-collector/blob/0.40-grafana/service/configcheck.go#L26-L43 -func validateConfigFromFactories(factories component.Factories) error { +func validateConfigFromFactories(factories otelcol.Factories) error { var errs error + //TODO: We should not use componenttest in non-test code for _, factory := range factories.Receivers { - errs = multierr.Append(errs, configtest.CheckConfigStruct(factory.CreateDefaultConfig())) + errs = multierr.Append(errs, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) } for _, factory := range factories.Processors { - errs = multierr.Append(errs, configtest.CheckConfigStruct(factory.CreateDefaultConfig())) + errs = multierr.Append(errs, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) } for _, factory := range factories.Exporters { - errs = multierr.Append(errs, configtest.CheckConfigStruct(factory.CreateDefaultConfig())) + errs = multierr.Append(errs, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) } for _, factory := range factories.Extensions { - errs = multierr.Append(errs, configtest.CheckConfigStruct(factory.CreateDefaultConfig())) + errs = multierr.Append(errs, componenttest.CheckConfigStruct(factory.CreateDefaultConfig())) } return errs diff --git a/pkg/traces/config_test.go b/pkg/traces/config_test.go index a6041a403d35..30285c316b8e 100644 --- a/pkg/traces/config_test.go +++ b/pkg/traces/config_test.go @@ -9,9 +9,8 @@ import ( "github.com/grafana/agent/pkg/traces/pushreceiver" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/config" - "go.opentelemetry.io/collector/confmap" - "go.opentelemetry.io/collector/service/external/configunmarshaler" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/otelcol" "gopkg.in/yaml.v2" ) @@ -321,6 +320,7 @@ receivers: protocols: grpc: remote_sampling: + host_endpoint: example:54321 strategy_file: file_path tls: insecure: true @@ -336,6 +336,7 @@ receivers: protocols: grpc: remote_sampling: + host_endpoint: example:54321 strategy_file: file_path tls: insecure: true @@ -1459,8 +1460,7 @@ service: factories, err := tracingFactories() require.NoError(t, err) - configMap := confmap.NewFromStringMap(otelMapStructure) - expectedConfig, err := configunmarshaler.Unmarshal(configMap, factories) + expectedConfig, err := otelcolConfigFromStringMap(otelMapStructure, &factories) require.NoError(t, err) // Exporters/Receivers/Processors in the config's service.Pipelines, as well as @@ -1468,7 +1468,7 @@ service: sortService(actualConfig) sortService(expectedConfig) - assert.Equal(t, expectedConfig, actualConfig) + assert.Equal(t, *expectedConfig, *actualConfig) }) } } @@ -1478,7 +1478,7 @@ func TestProcessorOrder(t *testing.T) { tt := []struct { name string cfg string - expectedProcessors map[string][]config.ComponentID + expectedProcessors map[component.ID][]component.ID }{ { name: "no processors", @@ -1492,8 +1492,8 @@ remote_write: headers: x-some-header: Some value! `, - expectedProcessors: map[string][]config.ComponentID{ - "traces": nil, + expectedProcessors: map[component.ID][]component.ID{ + component.NewID("traces"): nil, }, }, { @@ -1536,16 +1536,16 @@ tail_sampling: service_graphs: enabled: true `, - expectedProcessors: map[string][]config.ComponentID{ - "traces": { - config.NewComponentID("attributes"), - config.NewComponentID("spanmetrics"), - config.NewComponentID("service_graphs"), - config.NewComponentID("tail_sampling"), - config.NewComponentID("automatic_logging"), - config.NewComponentID("batch"), + expectedProcessors: map[component.ID][]component.ID{ + component.NewID("traces"): { + component.NewID("attributes"), + component.NewID("spanmetrics"), + component.NewID("service_graphs"), + component.NewID("tail_sampling"), + component.NewID("automatic_logging"), + component.NewID("batch"), }, - spanMetricsPipelineName: nil, + component.NewIDWithName(spanMetricsPipelineType, spanMetricsPipelineName): nil, }, }, { @@ -1596,18 +1596,18 @@ load_balancing: service_graphs: enabled: true `, - expectedProcessors: map[string][]config.ComponentID{ - "traces/0": { - config.NewComponentID("attributes"), - config.NewComponentID("spanmetrics"), + expectedProcessors: map[component.ID][]component.ID{ + component.NewIDWithName("traces", "0"): { + component.NewID("attributes"), + component.NewID("spanmetrics"), }, - "traces/1": { - config.NewComponentID("service_graphs"), - config.NewComponentID("tail_sampling"), - config.NewComponentID("automatic_logging"), - config.NewComponentID("batch"), + component.NewIDWithName("traces", "1"): { + component.NewID("service_graphs"), + component.NewID("tail_sampling"), + component.NewID("automatic_logging"), + component.NewID("batch"), }, - spanMetricsPipelineName: nil, + component.NewIDWithName(spanMetricsPipelineType, spanMetricsPipelineName): nil, }, }, { @@ -1647,16 +1647,16 @@ load_balancing: hostname: agent port: 4318 `, - expectedProcessors: map[string][]config.ComponentID{ - "traces/0": { - config.NewComponentID("attributes"), - config.NewComponentID("spanmetrics"), + expectedProcessors: map[component.ID][]component.ID{ + component.NewIDWithName("traces", "0"): { + component.NewID("attributes"), + component.NewID("spanmetrics"), }, - "traces/1": { - config.NewComponentID("automatic_logging"), - config.NewComponentID("batch"), + component.NewIDWithName("traces", "1"): { + component.NewID("automatic_logging"), + component.NewID("batch"), }, - spanMetricsPipelineName: nil, + component.NewIDWithName(spanMetricsPipelineType, spanMetricsPipelineName): nil, }, }, } @@ -1671,13 +1671,13 @@ load_balancing: actualConfig, err := cfg.otelConfig() require.NoError(t, err) - require.Equal(t, len(tc.expectedProcessors), len(actualConfig.Pipelines)) - for k := range tc.expectedProcessors { - if len(tc.expectedProcessors[k]) > 0 { - componentID, err := config.NewComponentIDFromString(k) - require.NoError(t, err) + require.Equal(t, len(tc.expectedProcessors), len(actualConfig.Service.Pipelines)) + for componentID := range tc.expectedProcessors { + if len(tc.expectedProcessors[componentID]) > 0 { + assert.NotNil(t, tc.expectedProcessors) + assert.NotNil(t, actualConfig.Service.Pipelines[componentID]) - assert.Equal(t, tc.expectedProcessors[k], actualConfig.Pipelines[componentID].Processors) + assert.Equal(t, tc.expectedProcessors[componentID], actualConfig.Service.Pipelines[componentID].Processors) } } }) @@ -1820,13 +1820,15 @@ func TestCreatingPushReceiver(t *testing.T) { receivers: jaeger: protocols: - grpc:` + grpc: +remote_write: + - endpoint: example.com:12345` cfg := InstanceConfig{} err := yaml.Unmarshal([]byte(test), &cfg) assert.Nil(t, err) otel, err := cfg.otelConfig() assert.Nil(t, err) - assert.Contains(t, otel.Service.Pipelines[config.NewComponentID("traces")].Receivers, config.NewComponentID(pushreceiver.TypeStr)) + assert.Contains(t, otel.Service.Pipelines[component.NewID("traces")].Receivers, component.NewID(pushreceiver.TypeStr)) } func TestUnmarshalYAMLEmptyOTLP(t *testing.T) { @@ -1852,10 +1854,10 @@ receivers: // sortService is a helper function to lexicographically sort all // the possibly unsorted elements of a given cfg.Service -func sortService(cfg *config.Config) { +func sortService(cfg *otelcol.Config) { sort.Slice(cfg.Service.Extensions, func(i, j int) bool { return cfg.Service.Extensions[i].String() > cfg.Service.Extensions[j].String() }) - for _, pipeline := range cfg.Pipelines { + for _, pipeline := range cfg.Service.Pipelines { sort.Slice(pipeline.Exporters, func(i, j int) bool { return pipeline.Exporters[i].String() > pipeline.Exporters[j].String() }) sort.Slice(pipeline.Receivers, func(i, j int) bool { return pipeline.Receivers[i].String() > pipeline.Receivers[j].String() }) sort.Slice(pipeline.Processors, func(i, j int) bool { return pipeline.Processors[i].String() > pipeline.Processors[j].String() }) diff --git a/pkg/traces/contextkeys/keys.go b/pkg/traces/contextkeys/keys.go index a6049731de8a..a43342d09eb7 100644 --- a/pkg/traces/contextkeys/keys.go +++ b/pkg/traces/contextkeys/keys.go @@ -8,7 +8,4 @@ const ( // Metrics is used to pass instance.Manager through the context Metrics - - // PrometheusRegisterer is used to pass prometheus.Registerer through the context - PrometheusRegisterer ) diff --git a/pkg/traces/instance.go b/pkg/traces/instance.go index 04316a709179..0075112c466e 100644 --- a/pkg/traces/instance.go +++ b/pkg/traces/instance.go @@ -6,48 +6,44 @@ import ( "sync" "time" - "github.com/prometheus/client_golang/prometheus" - "go.opencensus.io/stats/view" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" - "go.opentelemetry.io/collector/service/extensions" - "go.opentelemetry.io/collector/service/external/pipelines" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/collector/connector" + otelexporter "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/featuregate" + "go.opentelemetry.io/collector/otelcol" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/collector/service" "go.uber.org/zap" + "go.uber.org/zap/zapcore" "github.com/grafana/agent/pkg/build" "github.com/grafana/agent/pkg/logs" "github.com/grafana/agent/pkg/metrics/instance" "github.com/grafana/agent/pkg/traces/automaticloggingprocessor" "github.com/grafana/agent/pkg/traces/contextkeys" + "github.com/grafana/agent/pkg/traces/internal/traceutils" + "github.com/grafana/agent/pkg/traces/servicegraphprocessor" "github.com/grafana/agent/pkg/util" + prom_client "github.com/prometheus/client_golang/prometheus" + "go.opentelemetry.io/otel/trace" ) // Instance wraps the OpenTelemetry collector to enable tracing pipelines type Instance struct { - mut sync.Mutex - cfg InstanceConfig - logger *zap.Logger - metricViews []*view.View - - extensions *extensions.Extensions - pipelines *pipelines.Pipelines - factories component.Factories -} + mut sync.Mutex + cfg InstanceConfig + logger *zap.Logger -var _ component.Host = (*Instance)(nil) + factories otelcol.Factories + service *service.Service +} // NewInstance creates and starts an instance of tracing pipelines. -func NewInstance(logsSubsystem *logs.Logs, reg prometheus.Registerer, cfg InstanceConfig, logger *zap.Logger, promInstanceManager instance.Manager) (*Instance, error) { - var err error - +func NewInstance(logsSubsystem *logs.Logs, reg prom_client.Registerer, cfg InstanceConfig, logger *zap.Logger, promInstanceManager instance.Manager) (*Instance, error) { instance := &Instance{} instance.logger = logger - instance.metricViews, err = newMetricViews(reg) - if err != nil { - return nil, fmt.Errorf("failed to create metric views: %w", err) - } if err := instance.ApplyConfig(logsSubsystem, promInstanceManager, reg, cfg); err != nil { return nil, err @@ -56,7 +52,7 @@ func NewInstance(logsSubsystem *logs.Logs, reg prometheus.Registerer, cfg Instan } // ApplyConfig updates the configuration of the Instance. -func (i *Instance) ApplyConfig(logsSubsystem *logs.Logs, promInstanceManager instance.Manager, reg prometheus.Registerer, cfg InstanceConfig) error { +func (i *Instance) ApplyConfig(logsSubsystem *logs.Logs, promInstanceManager instance.Manager, reg prom_client.Registerer, cfg InstanceConfig) error { i.mut.Lock() defer i.mut.Unlock() @@ -83,56 +79,21 @@ func (i *Instance) Stop() { defer i.mut.Unlock() i.stop() - view.Unregister(i.metricViews...) } func (i *Instance) stop() { shutdownCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() - if i.extensions != nil { - err := i.extensions.NotifyPipelineNotReady() + if i.service != nil { + err := i.service.Shutdown(shutdownCtx) if err != nil { - i.logger.Error("failed to notify extension of pipeline shutdown", zap.Error(err)) - } - } - - dependencies := []struct { - name string - shutdown func() error - }{ - { - name: "pipelines", - shutdown: func() error { - if i.pipelines == nil { - return nil - } - return i.pipelines.ShutdownAll(shutdownCtx) - }, - }, - { - name: "extensions", - shutdown: func() error { - if i.extensions == nil { - return nil - } - return i.extensions.Shutdown(shutdownCtx) - }, - }, - } - - for _, dep := range dependencies { - i.logger.Info(fmt.Sprintf("shutting down %s", dep.name)) - if err := dep.shutdown(); err != nil { - i.logger.Error(fmt.Sprintf("failed to shutdown %s", dep.name), zap.Error(err)) + i.logger.Error("failed to stop Otel service", zap.Error(err)) } } - - i.pipelines = nil - i.extensions = nil } -func (i *Instance) buildAndStartPipeline(ctx context.Context, cfg InstanceConfig, logs *logs.Logs, instManager instance.Manager, reg prometheus.Registerer) error { +func (i *Instance) buildAndStartPipeline(ctx context.Context, cfg InstanceConfig, logs *logs.Logs, instManager instance.Manager, reg prom_client.Registerer) error { // create component factories otelConfig, err := cfg.otelConfig() if err != nil { @@ -160,15 +121,10 @@ func (i *Instance) buildAndStartPipeline(ctx context.Context, cfg InstanceConfig ctx = context.WithValue(ctx, contextkeys.Logs, logs) } - if cfg.ServiceGraphs != nil { - ctx = context.WithValue(ctx, contextkeys.PrometheusRegisterer, reg) - } - factories, err := tracingFactories() if err != nil { return fmt.Errorf("failed to load tracing factories: %w", err) } - i.factories = factories appinfo := component.BuildInfo{ Command: "agent", @@ -176,52 +132,73 @@ func (i *Instance) buildAndStartPipeline(ctx context.Context, cfg InstanceConfig Version: build.Version, } - settings := component.TelemetrySettings{ - Logger: i.logger, - TracerProvider: trace.NewNoopTracerProvider(), - MeterProvider: metric.NewNoopMeterProvider(), + // useOtelForInternalMetrics is required so that the Collector service configures Collector components using the Otel SDK + // instead of OpenCensus. If this is not specified, then the OtelMetricViews and OtelMetricReader parameters which we + // pass to service.New() below will not be taken into account. This would mean that metrics from custom components such as + // the one in pkg/traces/servicegraphprocessor would not work. + // + // disableHighCardinalityMetrics is required so that we don't include labels containing ports and IP addresses in gRPC metrics. + // Example metric with high cardinality... + // rpc_server_duration_bucket{net_sock_peer_addr="127.0.0.1",net_sock_peer_port="59947",rpc_grpc_status_code="0",rpc_method="Export",rpc_service="opentelemetry.proto.collector.trace.v1.TraceService",rpc_system="grpc",traces_config="default",le="7500"} 294 + // ... the same metric when disableHighCardinalityMetrics is switched on looks like this: + // rpc_server_duration_bucket{rpc_grpc_status_code="0",rpc_method="Export",rpc_service="opentelemetry.proto.collector.trace.v1.TraceService",rpc_system="grpc",traces_config="default",le="7500"} 32 + // For more context: + // https://opentelemetry.io/docs/specs/otel/metrics/semantic_conventions/rpc-metrics/ + // https://github.com/open-telemetry/opentelemetry-go-contrib/pull/2700 + // https://github.com/open-telemetry/opentelemetry-collector/pull/6788/files + err = enableOtelFeatureGates( + "telemetry.useOtelForInternalMetrics", + "telemetry.disableHighCardinalityMetrics") + if err != nil { + return err } - // start extensions - i.extensions, err = extensions.New(ctx, extensions.Settings{ - Telemetry: settings, - BuildInfo: appinfo, - - Factories: factories.Extensions, - Configs: otelConfig.Extensions, - }, otelConfig.Service.Extensions) + promExporter, err := traceutils.PrometheusExporter(reg) + if err != nil { + return fmt.Errorf("error creating otel prometheus exporter: %w", err) + } + + i.service, err = service.New(ctx, service.Settings{ + BuildInfo: appinfo, + Receivers: receiver.NewBuilder(otelConfig.Receivers, factories.Receivers), + Processors: processor.NewBuilder(otelConfig.Processors, factories.Processors), + Exporters: otelexporter.NewBuilder(otelConfig.Exporters, factories.Exporters), + Connectors: connector.NewBuilder(otelConfig.Connectors, factories.Connectors), + Extensions: extension.NewBuilder(otelConfig.Extensions, factories.Extensions), + OtelMetricViews: servicegraphprocessor.OtelMetricViews(), + OtelMetricReader: *promExporter, + UseExternalMetricsServer: true, + TracerProvider: trace.NewNoopTracerProvider(), + //TODO: Plug in an AsyncErrorChannel to shut down the Agent in case of a fatal event + LoggingOptions: []zap.Option{ + zap.WrapCore(func(zapcore.Core) zapcore.Core { + return i.logger.Core() + }), + }, + }, otelConfig.Service) if err != nil { - i.logger.Error(fmt.Sprintf("failed to build extensions: %s", err.Error())) - return fmt.Errorf("failed to create extensions builder: %w", err) + return fmt.Errorf("failed to create Otel service: %w", err) } - err = i.extensions.Start(ctx, i) + + err = i.service.Start(ctx) if err != nil { - i.logger.Error(fmt.Sprintf("failed to start extensions: %s", err.Error())) - return fmt.Errorf("failed to start extensions: %w", err) + return fmt.Errorf("failed to start Otel service: %w", err) } - i.pipelines, err = pipelines.Build(ctx, pipelines.Settings{ - Telemetry: settings, - BuildInfo: appinfo, + return err +} - ReceiverFactories: factories.Receivers, - ReceiverConfigs: otelConfig.Receivers, - ProcessorFactories: factories.Processors, - ProcessorConfigs: otelConfig.Processors, - ExporterFactories: factories.Exporters, - ExporterConfigs: otelConfig.Exporters, +func enableOtelFeatureGates(fgNames ...string) error { + fgReg := featuregate.GlobalRegistry() - PipelineConfigs: otelConfig.Pipelines, - }) - if err != nil { - return fmt.Errorf("failed to create pipelines: %w", err) - } - if err := i.pipelines.StartAll(ctx, i); err != nil { - i.logger.Error(fmt.Sprintf("failed to start pipelines: %s", err.Error())) - return fmt.Errorf("failed to start pipelines: %w", err) + for _, fg := range fgNames { + err := fgReg.Set(fg, true) + if err != nil { + return fmt.Errorf("error setting Otel feature gate: %w", err) + } } - return i.extensions.NotifyPipelineReady() + return nil } // ReportFatalError implements component.Host @@ -230,7 +207,7 @@ func (i *Instance) ReportFatalError(err error) { } // GetFactory implements component.Host -func (i *Instance) GetFactory(kind component.Kind, componentType config.Type) component.Factory { +func (i *Instance) GetFactory(kind component.Kind, componentType component.Type) component.Factory { switch kind { case component.KindReceiver: return i.factories.Receivers[componentType] @@ -238,14 +215,3 @@ func (i *Instance) GetFactory(kind component.Kind, componentType config.Type) co return nil } } - -// GetExtensions implements component.Host -func (i *Instance) GetExtensions() map[config.ComponentID]component.Extension { - return i.extensions.GetExtensions() -} - -// GetExporters implements component.Host -func (i *Instance) GetExporters() map[config.DataType]map[config.ComponentID]component.Exporter { - // SpanMetricsProcessor needs to get the configured exporters. - return i.pipelines.GetExporters() -} diff --git a/pkg/traces/internal/traceutils/otel_meter_settings.go b/pkg/traces/internal/traceutils/otel_meter_settings.go new file mode 100644 index 000000000000..b02a3cb07a4a --- /dev/null +++ b/pkg/traces/internal/traceutils/otel_meter_settings.go @@ -0,0 +1,15 @@ +package traceutils + +import ( + "github.com/prometheus/client_golang/prometheus" + otelprom "go.opentelemetry.io/otel/exporters/prometheus" +) + +func PrometheusExporter(reg prometheus.Registerer) (*otelprom.Exporter, error) { + return otelprom.New( + otelprom.WithRegisterer(reg), + otelprom.WithoutUnits(), + otelprom.WithoutScopeInfo(), + otelprom.WithoutTargetInfo(), + otelprom.WithNamespace("traces")) +} diff --git a/pkg/traces/internal/traceutils/server.go b/pkg/traces/internal/traceutils/server.go index 1b7de08e326e..af37633fbaca 100644 --- a/pkg/traces/internal/traceutils/server.go +++ b/pkg/traces/internal/traceutils/server.go @@ -9,26 +9,28 @@ import ( "time" "github.com/grafana/agent/pkg/util" - "github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor/mocks" "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/exporter" + otelexporter "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/otelcol" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/otlpreceiver" - "go.opentelemetry.io/collector/service/external/configunmarshaler" - "go.opentelemetry.io/collector/service/external/pipelines" - "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/collector/service" "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" "gopkg.in/yaml.v3" ) // Server is a Tracing testing server that invokes a function every time a span // is received. type Server struct { - pipelines *pipelines.Pipelines + service *service.Service } // NewTestServer creates a new Server for testing, where received traces will @@ -74,21 +76,21 @@ func NewServerWithRandomPort(callback func(ptrace.Traces)) (srv *Server, addr st // trace is received. This is primarily useful for testing. func NewServer(addr string, callback func(ptrace.Traces)) (*Server, error) { conf := util.Untab(fmt.Sprintf(` -processors: - func_processor: -receivers: - otlp: - protocols: - grpc: - endpoint: %s -exporters: - noop: -service: - pipelines: - traces: - receivers: [otlp] - processors: [func_processor] - exporters: [noop] + processors: + func_processor: + receivers: + otlp: + protocols: + grpc: + endpoint: %s + exporters: + noop: + service: + pipelines: + traces: + receivers: [otlp] + processors: [func_processor] + exporters: [noop] `, addr)) var cfg map[string]interface{} @@ -96,29 +98,29 @@ service: panic("could not decode config: " + err.Error()) } - extensionsFactory, err := component.MakeExtensionFactoryMap() + extensionsFactory, err := extension.MakeFactoryMap() if err != nil { return nil, fmt.Errorf("failed to make extension factory map: %w", err) } - receiversFactory, err := component.MakeReceiverFactoryMap(otlpreceiver.NewFactory()) + receiversFactory, err := receiver.MakeFactoryMap(otlpreceiver.NewFactory()) if err != nil { return nil, fmt.Errorf("failed to make receiver factory map: %w", err) } - exportersFactory, err := component.MakeExporterFactoryMap(newNoopExporterFactory()) + exportersFactory, err := exporter.MakeFactoryMap(newNoopExporterFactory()) if err != nil { return nil, fmt.Errorf("failed to make exporter factory map: %w", err) } - processorsFactory, err := component.MakeProcessorFactoryMap( + processorsFactory, err := processor.MakeFactoryMap( newFuncProcessorFactory(callback), ) if err != nil { return nil, fmt.Errorf("failed to make processor factory map: %w", err) } - factories := component.Factories{ + factories := otelcol.Factories{ Extensions: extensionsFactory, Receivers: receiversFactory, Processors: processorsFactory, @@ -126,47 +128,43 @@ service: } configMap := confmap.NewFromStringMap(cfg) - otelCfg, err := configunmarshaler.Unmarshal(configMap, factories) + otelCfgSettings, err := otelcol.Unmarshal(configMap, factories) if err != nil { return nil, fmt.Errorf("failed to make otel config: %w", err) } - var ( - logger = zap.NewNop() - startInfo component.BuildInfo - ) - - settings := component.TelemetrySettings{ - Logger: logger, - TracerProvider: trace.NewNoopTracerProvider(), - MeterProvider: metric.NewNoopMeterProvider(), + otelCfg := otelcol.Config{ + Receivers: otelCfgSettings.Receivers.Configs(), + Processors: otelCfgSettings.Processors.Configs(), + Exporters: otelCfgSettings.Exporters.Configs(), + Connectors: otelCfgSettings.Connectors.Configs(), + Extensions: otelCfgSettings.Extensions.Configs(), + Service: otelCfgSettings.Service, } - pipelines, err := pipelines.Build(context.Background(), pipelines.Settings{ - Telemetry: settings, - BuildInfo: startInfo, - - ReceiverFactories: factories.Receivers, - ReceiverConfigs: otelCfg.Receivers, - ProcessorFactories: factories.Processors, - ProcessorConfigs: otelCfg.Processors, - ExporterFactories: factories.Exporters, - ExporterConfigs: otelCfg.Exporters, + if err := otelCfg.Validate(); err != nil { + return nil, err + } - PipelineConfigs: otelCfg.Pipelines, - }) + svc, err := service.New(context.Background(), service.Settings{ + Receivers: receiver.NewBuilder(otelCfg.Receivers, factories.Receivers), + Processors: processor.NewBuilder(otelCfg.Processors, factories.Processors), + Exporters: otelexporter.NewBuilder(otelCfg.Exporters, factories.Exporters), + Connectors: connector.NewBuilder(otelCfg.Connectors, factories.Connectors), + Extensions: extension.NewBuilder(otelCfg.Extensions, factories.Extensions), + UseExternalMetricsServer: false, + TracerProvider: trace.NewNoopTracerProvider(), + }, otelCfg.Service) if err != nil { - return nil, fmt.Errorf("failed to build pipelines: %w", err) + return nil, fmt.Errorf("failed to create Otel service: %w", err) } - h := &mocks.Host{} - h.On("GetExtensions").Return(nil) - if err := pipelines.StartAll(context.Background(), h); err != nil { - return nil, fmt.Errorf("failed to start receivers: %w", err) + if err := svc.Start(context.Background()); err != nil { + return nil, fmt.Errorf("failed to start Otel service: %w", err) } return &Server{ - pipelines: pipelines, + service: svc, }, nil } @@ -175,22 +173,21 @@ func (s *Server) Stop() error { shutdownCtx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() - return s.pipelines.ShutdownAll(shutdownCtx) + return s.service.Shutdown(shutdownCtx) } -func newFuncProcessorFactory(callback func(ptrace.Traces)) component.ProcessorFactory { - return component.NewProcessorFactory( +func newFuncProcessorFactory(callback func(ptrace.Traces)) processor.Factory { + return processor.NewFactory( "func_processor", - func() config.Processor { - processorSettings := config.NewProcessorSettings(config.NewComponentIDWithName("func_processor", "func_processor")) - return &processorSettings + func() component.Config { + return &struct{}{} }, - component.WithTracesProcessor(func( + processor.WithTraces(func( _ context.Context, - _ component.ProcessorCreateSettings, - _ config.Processor, + _ processor.CreateSettings, + _ component.Config, next consumer.Traces, - ) (component.TracesProcessor, error) { + ) (processor.Traces, error) { return &funcProcessor{ Callback: callback, @@ -219,18 +216,17 @@ func (p *funcProcessor) Capabilities() consumer.Capabilities { func (p *funcProcessor) Start(context.Context, component.Host) error { return nil } func (p *funcProcessor) Shutdown(context.Context) error { return nil } -func newNoopExporterFactory() component.ExporterFactory { - return component.NewExporterFactory( +func newNoopExporterFactory() exporter.Factory { + return exporter.NewFactory( "noop", - func() config.Exporter { - exporterSettings := config.NewExporterSettings(config.NewComponentIDWithName("noop", "noop")) - return &exporterSettings + func() component.Config { + return &struct{}{} }, - component.WithTracesExporter(func( + exporter.WithTraces(func( context.Context, - component.ExporterCreateSettings, - config.Exporter) ( - component.TracesExporter, + exporter.CreateSettings, + component.Config) ( + exporter.Traces, error) { return &noopExporter{}, nil diff --git a/pkg/traces/noopreceiver/factory.go b/pkg/traces/noopreceiver/factory.go index fa4fe4eca884..a4c247fb09bc 100644 --- a/pkg/traces/noopreceiver/factory.go +++ b/pkg/traces/noopreceiver/factory.go @@ -4,8 +4,8 @@ import ( "context" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/receiver" ) const ( @@ -14,32 +14,26 @@ const ( ) // NewFactory creates noop receiver factory. -func NewFactory() component.ReceiverFactory { - return component.NewReceiverFactory( +func NewFactory() receiver.Factory { + return receiver.NewFactory( TypeStr, createDefaultConfig, - component.WithMetricsReceiver(createMetricsReceiver, component.StabilityLevelUndefined), + receiver.WithMetrics(createMetricsReceiver, component.StabilityLevelUndefined), ) } -// Config defines configuration for noop receiver. -type Config struct { - config.Receiver `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. -} - -func createDefaultConfig() config.Receiver { - s := config.NewReceiverSettings(config.NewComponentIDWithName(TypeStr, TypeStr)) - return &s +func createDefaultConfig() component.Config { + return &struct{}{} } // noop receiver is used in the metrics pipeline so we need to // implement a metrics receiver. func createMetricsReceiver( _ context.Context, - _ component.ReceiverCreateSettings, - _ config.Receiver, + _ receiver.CreateSettings, + _ component.Config, _ consumer.Metrics, -) (component.MetricsReceiver, error) { +) (receiver.Metrics, error) { return newNoopReceiver(nil, nil, nil), nil } diff --git a/pkg/traces/noopreceiver/receiver.go b/pkg/traces/noopreceiver/receiver.go index ea9195406665..4b733559dc51 100644 --- a/pkg/traces/noopreceiver/receiver.go +++ b/pkg/traces/noopreceiver/receiver.go @@ -11,7 +11,7 @@ import ( type noopReceiver struct{} // New creates a dummy receiver. -func newNoopReceiver(_ *zap.Logger, _ *Config, _ consumer.Metrics) *noopReceiver { +func newNoopReceiver(_ *zap.Logger, _ component.Config, _ consumer.Metrics) *noopReceiver { return &noopReceiver{} } diff --git a/pkg/traces/promsdprocessor/factory.go b/pkg/traces/promsdprocessor/factory.go index 9cc88a8b6fa9..46b5e03d9871 100644 --- a/pkg/traces/promsdprocessor/factory.go +++ b/pkg/traces/promsdprocessor/factory.go @@ -6,8 +6,8 @@ import ( prom_config "github.com/prometheus/prometheus/config" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/processor" "gopkg.in/yaml.v2" ) @@ -31,33 +31,30 @@ const ( // Config holds the configuration for the Prometheus SD processor. type Config struct { - config.ProcessorSettings `mapstructure:",squash"` - ScrapeConfigs []interface{} `mapstructure:"scrape_configs"` - OperationType string `mapstructure:"operation_type"` - PodAssociations []string `mapstructure:"pod_associations"` + ScrapeConfigs []interface{} `mapstructure:"scrape_configs"` + OperationType string `mapstructure:"operation_type"` + PodAssociations []string `mapstructure:"pod_associations"` } // NewFactory returns a new factory for the Attributes processor. -func NewFactory() component.ProcessorFactory { - return component.NewProcessorFactory( +func NewFactory() processor.Factory { + return processor.NewFactory( TypeStr, createDefaultConfig, - component.WithTracesProcessor(createTraceProcessor, component.StabilityLevelUndefined), + processor.WithTraces(createTraceProcessor, component.StabilityLevelUndefined), ) } -func createDefaultConfig() config.Processor { - return &Config{ - ProcessorSettings: config.NewProcessorSettings(config.NewComponentIDWithName(TypeStr, TypeStr)), - } +func createDefaultConfig() component.Config { + return &Config{} } func createTraceProcessor( _ context.Context, - cp component.ProcessorCreateSettings, - cfg config.Processor, + cp processor.CreateSettings, + cfg component.Config, nextConsumer consumer.Traces, -) (component.TracesProcessor, error) { +) (processor.Traces, error) { oCfg := cfg.(*Config) out, err := yaml.Marshal(oCfg.ScrapeConfigs) diff --git a/pkg/traces/promsdprocessor/prom_sd_processor.go b/pkg/traces/promsdprocessor/prom_sd_processor.go index 098ab9f252d8..5f0da2c783c3 100644 --- a/pkg/traces/promsdprocessor/prom_sd_processor.go +++ b/pkg/traces/promsdprocessor/prom_sd_processor.go @@ -21,6 +21,7 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" semconv "go.opentelemetry.io/collector/semconv/v1.6.1" ) @@ -40,7 +41,7 @@ type promServiceDiscoProcessor struct { logger log.Logger } -func newTraceProcessor(nextConsumer consumer.Traces, operationType string, podAssociations []string, scrapeConfigs []*config.ScrapeConfig) (component.TracesProcessor, error) { +func newTraceProcessor(nextConsumer consumer.Traces, operationType string, podAssociations []string, scrapeConfigs []*config.ScrapeConfig) (processor.Traces, error) { ctx, cancel := context.WithCancel(context.Background()) logger := log.With(util.Logger, "component", "traces service disco") diff --git a/pkg/traces/pushreceiver/factory.go b/pkg/traces/pushreceiver/factory.go index e2748362547a..fb316b44d9f3 100644 --- a/pkg/traces/pushreceiver/factory.go +++ b/pkg/traces/pushreceiver/factory.go @@ -4,8 +4,8 @@ import ( "context" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + otelreceiver "go.opentelemetry.io/collector/receiver" ) const ( @@ -14,24 +14,23 @@ const ( ) // Type returns the receiver type that PushReceiverFactory produces -func (f Factory) Type() config.Type { +func (f Factory) Type() component.Type { return TypeStr } // NewFactory creates a new push receiver factory. -func NewFactory() component.ReceiverFactory { +func NewFactory() otelreceiver.Factory { return &Factory{} } // CreateDefaultConfig creates a default push receiver config. -func (f *Factory) CreateDefaultConfig() config.Receiver { - s := config.NewReceiverSettings(config.NewComponentIDWithName(TypeStr, TypeStr)) - return &s +func (f *Factory) CreateDefaultConfig() component.Config { + return &struct{}{} } // Factory is a factory that sneakily exposes a Traces consumer for use within the agent. type Factory struct { - component.Factory + otelreceiver.Factory Consumer consumer.Traces } @@ -53,10 +52,10 @@ func (f *Factory) TracesReceiverStability() component.StabilityLevel { // CreateTracesReceiver creates a stub receiver while also sneakily keeping a reference to the provided Traces consumer. func (f *Factory) CreateTracesReceiver( _ context.Context, - _ component.ReceiverCreateSettings, - _ config.Receiver, + _ otelreceiver.CreateSettings, + _ component.Config, c consumer.Traces, -) (component.TracesReceiver, error) { +) (otelreceiver.Traces, error) { r, err := newPushReceiver() f.Consumer = c @@ -65,15 +64,15 @@ func (f *Factory) CreateTracesReceiver( } // CreateMetricsReceiver returns an error because metrics are not supported by push receiver. -func (f *Factory) CreateMetricsReceiver(ctx context.Context, set component.ReceiverCreateSettings, - cfg config.Receiver, nextConsumer consumer.Metrics) (component.MetricsReceiver, error) { +func (f *Factory) CreateMetricsReceiver(ctx context.Context, set otelreceiver.CreateSettings, + cfg component.Config, nextConsumer consumer.Metrics) (otelreceiver.Metrics, error) { return nil, component.ErrDataTypeIsNotSupported } // CreateLogsReceiver returns an error because logs are not supported by push receiver. -func (f *Factory) CreateLogsReceiver(ctx context.Context, set component.ReceiverCreateSettings, - cfg config.Receiver, nextConsumer consumer.Logs) (component.LogsReceiver, error) { +func (f *Factory) CreateLogsReceiver(ctx context.Context, set otelreceiver.CreateSettings, + cfg component.Config, nextConsumer consumer.Logs) (otelreceiver.Logs, error) { return nil, component.ErrDataTypeIsNotSupported } diff --git a/pkg/traces/pushreceiver/receiver.go b/pkg/traces/pushreceiver/receiver.go index 7b44e51c5060..a8203698d34f 100644 --- a/pkg/traces/pushreceiver/receiver.go +++ b/pkg/traces/pushreceiver/receiver.go @@ -4,6 +4,7 @@ import ( "context" "go.opentelemetry.io/collector/component" + otelreceiver "go.opentelemetry.io/collector/receiver" ) type receiver struct{} @@ -16,6 +17,6 @@ func (r *receiver) Shutdown(_ context.Context) error { return nil } -func newPushReceiver() (component.TracesReceiver, error) { +func newPushReceiver() (otelreceiver.Traces, error) { return &receiver{}, nil } diff --git a/pkg/traces/remotewriteexporter/exporter.go b/pkg/traces/remotewriteexporter/exporter.go index 0db096e937b4..db6c1e0433dc 100644 --- a/pkg/traces/remotewriteexporter/exporter.go +++ b/pkg/traces/remotewriteexporter/exporter.go @@ -16,6 +16,7 @@ import ( "github.com/prometheus/prometheus/model/labels" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" ) @@ -56,7 +57,7 @@ type remoteWriteExporter struct { logger log.Logger } -func newRemoteWriteExporter(cfg *Config) (component.MetricsExporter, error) { +func newRemoteWriteExporter(cfg *Config) (exporter.Metrics, error) { logger := log.With(util.Logger, "component", "traces remote write exporter") ls := make(labels.Labels, 0, len(cfg.ConstLabels)) diff --git a/pkg/traces/remotewriteexporter/exporter_test.go b/pkg/traces/remotewriteexporter/exporter_test.go index 7593601fc990..6ba218ea8366 100644 --- a/pkg/traces/remotewriteexporter/exporter_test.go +++ b/pkg/traces/remotewriteexporter/exporter_test.go @@ -13,7 +13,6 @@ import ( "github.com/prometheus/prometheus/model/metadata" "github.com/prometheus/prometheus/storage" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" ) @@ -35,10 +34,9 @@ func TestRemoteWriteExporter_ConsumeMetrics(t *testing.T) { ) cfg := Config{ - ExporterSettings: config.ExporterSettings{}, - ConstLabels: nil, - Namespace: "traces", - PromInstance: "traces", + ConstLabels: nil, + Namespace: "traces", + PromInstance: "traces", } exp, err := newRemoteWriteExporter(&cfg) require.NoError(t, err) diff --git a/pkg/traces/remotewriteexporter/factory.go b/pkg/traces/remotewriteexporter/factory.go index 52621ffb47c4..640e16d4ad66 100644 --- a/pkg/traces/remotewriteexporter/factory.go +++ b/pkg/traces/remotewriteexporter/factory.go @@ -6,7 +6,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" + "go.opentelemetry.io/collector/exporter" ) const ( @@ -15,12 +15,8 @@ const ( TypeStr = "remote_write" ) -var _ config.Exporter = (*Config)(nil) - // Config holds the configuration for the Prometheus remote write processor. type Config struct { - config.ExporterSettings `mapstructure:",squash"` - ConstLabels prometheus.Labels `mapstructure:"const_labels"` Namespace string `mapstructure:"namespace"` PromInstance string `mapstructure:"metrics_instance"` @@ -32,25 +28,23 @@ type Config struct { } // NewFactory returns a new factory for the Prometheus remote write processor. -func NewFactory() component.ExporterFactory { - return component.NewExporterFactory( +func NewFactory() exporter.Factory { + return exporter.NewFactory( TypeStr, createDefaultConfig, - component.WithMetricsExporter(createMetricsExporter, component.StabilityLevelUndefined), + exporter.WithMetrics(createMetricsExporter, component.StabilityLevelUndefined), ) } -func createDefaultConfig() config.Exporter { - return &Config{ - ExporterSettings: config.NewExporterSettings(config.NewComponentIDWithName(TypeStr, TypeStr)), - } +func createDefaultConfig() component.Config { + return &Config{} } func createMetricsExporter( _ context.Context, - _ component.ExporterCreateSettings, - cfg config.Exporter, -) (component.MetricsExporter, error) { + _ exporter.CreateSettings, + cfg component.Config, +) (exporter.Metrics, error) { eCfg := cfg.(*Config) return newRemoteWriteExporter(eCfg) diff --git a/pkg/traces/servicegraphprocessor/factory.go b/pkg/traces/servicegraphprocessor/factory.go index 43f80e21d961..3d6a938c014b 100644 --- a/pkg/traces/servicegraphprocessor/factory.go +++ b/pkg/traces/servicegraphprocessor/factory.go @@ -5,8 +5,8 @@ import ( "time" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/config" "go.opentelemetry.io/collector/consumer" + otelprocessor "go.opentelemetry.io/collector/processor" ) const ( @@ -23,8 +23,6 @@ const ( // Config holds the configuration for the Prometheus service graph processor. type Config struct { - config.ProcessorSettings `mapstructure:",squash"` - Wait time.Duration `mapstructure:"wait"` MaxItems int `mapstructure:"max_items"` @@ -39,27 +37,25 @@ type successCodes struct { } // NewFactory returns a new factory for the Prometheus service graph processor. -func NewFactory() component.ProcessorFactory { - return component.NewProcessorFactory( +func NewFactory() otelprocessor.Factory { + return otelprocessor.NewFactory( TypeStr, createDefaultConfig, - component.WithTracesProcessor(createTracesProcessor, component.StabilityLevelUndefined), + otelprocessor.WithTraces(createTracesProcessor, component.StabilityLevelUndefined), ) } -func createDefaultConfig() config.Processor { - return &Config{ - ProcessorSettings: config.NewProcessorSettings(config.NewComponentIDWithName(TypeStr, TypeStr)), - } +func createDefaultConfig() component.Config { + return &Config{} } func createTracesProcessor( _ context.Context, - _ component.ProcessorCreateSettings, - cfg config.Processor, + set otelprocessor.CreateSettings, + cfg component.Config, nextConsumer consumer.Traces, -) (component.TracesProcessor, error) { +) (otelprocessor.Traces, error) { eCfg := cfg.(*Config) - return newProcessor(nextConsumer, eCfg), nil + return newProcessor(nextConsumer, eCfg, set) } diff --git a/pkg/traces/servicegraphprocessor/processor.go b/pkg/traces/servicegraphprocessor/processor.go index a62c7536f6d1..6dbedd1aef7a 100644 --- a/pkg/traces/servicegraphprocessor/processor.go +++ b/pkg/traces/servicegraphprocessor/processor.go @@ -2,6 +2,7 @@ package servicegraphprocessor import ( "context" + "encoding/hex" "errors" "fmt" "time" @@ -9,15 +10,27 @@ import ( util "github.com/cortexproject/cortex/pkg/util/log" "github.com/go-kit/log" "github.com/go-kit/log/level" - "github.com/grafana/agent/pkg/traces/contextkeys" - "github.com/prometheus/client_golang/prometheus" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/ptrace" + otelprocessor "go.opentelemetry.io/collector/processor" semconv "go.opentelemetry.io/collector/semconv/v1.6.1" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric" + sdkmetric "go.opentelemetry.io/otel/sdk/metric" + "go.opentelemetry.io/otel/sdk/metric/aggregation" "google.golang.org/grpc/codes" ) +const ( + serviceGraphRequestTotal_name = "service_graph_request" + serviceGraphRequestFailedTotal_name = "service_graph_request_failed" + serviceGraphRequestServerHistogram_name = "service_graph_request_server_seconds" + serviceGraphRequestClientHistogram_name = "service_graph_request_client_seconds" + serviceGraphUnpairedSpansTotal_name = "service_graph_unpaired_spans" + serviceGraphDroppedSpansTotal_name = "service_graph_dropped_spans" +) + type tooManySpansError struct { droppedSpans int } @@ -59,11 +72,10 @@ func (e *edge) isExpired() bool { return time.Now().Unix() >= e.expiration } -var _ component.TracesProcessor = (*processor)(nil) +var _ otelprocessor.Traces = (*processor)(nil) type processor struct { nextConsumer consumer.Traces - reg prometheus.Registerer store *store @@ -73,12 +85,12 @@ type processor struct { // completed edges are pushed through this channel to be processed. collectCh chan string - serviceGraphRequestTotal *prometheus.CounterVec - serviceGraphRequestFailedTotal *prometheus.CounterVec - serviceGraphRequestServerHistogram *prometheus.HistogramVec - serviceGraphRequestClientHistogram *prometheus.HistogramVec - serviceGraphUnpairedSpansTotal *prometheus.CounterVec - serviceGraphDroppedSpansTotal *prometheus.CounterVec + serviceGraphRequestTotal metric.Float64Counter + serviceGraphRequestFailedTotal metric.Float64Counter + serviceGraphRequestServerHistogram metric.Float64Histogram + serviceGraphRequestClientHistogram metric.Float64Histogram + serviceGraphUnpairedSpansTotal metric.Float64Counter + serviceGraphDroppedSpansTotal metric.Float64Counter httpSuccessCodeMap map[int]struct{} grpcSuccessCodeMap map[int]struct{} @@ -87,7 +99,7 @@ type processor struct { closeCh chan struct{} } -func newProcessor(nextConsumer consumer.Traces, cfg *Config) *processor { +func newProcessor(nextConsumer consumer.Traces, cfg *Config, set otelprocessor.CreateSettings) (*processor, error) { logger := log.With(util.Logger, "component", "service graphs") if cfg.Wait == 0 { @@ -141,91 +153,96 @@ func newProcessor(nextConsumer consumer.Traces, cfg *Config) *processor { }() } - return p + err := p.registerMetrics(set.MeterProvider, set.ID.String()) + if err != nil { + return nil, fmt.Errorf("failed to register service graph metrics: %w", err) + } + + return p, nil } -func (p *processor) Start(ctx context.Context, _ component.Host) error { +func (p *processor) Start(_ context.Context, _ component.Host) error { // initialize store p.store = newStore(p.wait, p.maxItems, p.collectEdge) - reg, ok := ctx.Value(contextkeys.PrometheusRegisterer).(prometheus.Registerer) - if !ok || reg == nil { - return fmt.Errorf("key does not contain a prometheus registerer") - } - p.reg = reg - return p.registerMetrics() + return nil } -func (p *processor) registerMetrics() error { - p.serviceGraphRequestTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ - Namespace: "traces", - Name: "service_graph_request_total", - Help: "Total count of requests between two nodes", - }, []string{"client", "server"}) - p.serviceGraphRequestFailedTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ - Namespace: "traces", - Name: "service_graph_request_failed_total", - Help: "Total count of failed requests between two nodes", - }, []string{"client", "server"}) - p.serviceGraphRequestServerHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ - Namespace: "traces", - Name: "service_graph_request_server_seconds", - Help: "Time for a request between two nodes as seen from the server", - Buckets: prometheus.ExponentialBuckets(0.01, 2, 12), - }, []string{"client", "server"}) - p.serviceGraphRequestClientHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ - Namespace: "traces", - Name: "service_graph_request_client_seconds", - Help: "Time for a request between two nodes as seen from the client", - Buckets: prometheus.ExponentialBuckets(0.01, 2, 12), - }, []string{"client", "server"}) - p.serviceGraphUnpairedSpansTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ - Namespace: "traces", - Name: "service_graph_unpaired_spans_total", - Help: "Total count of unpaired spans", - }, []string{"client", "server"}) - p.serviceGraphDroppedSpansTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ - Namespace: "traces", - Name: "service_graph_dropped_spans_total", - Help: "Total count of dropped spans", - }, []string{"client", "server"}) - - cs := []prometheus.Collector{ - p.serviceGraphRequestTotal, - p.serviceGraphRequestFailedTotal, - p.serviceGraphRequestServerHistogram, - p.serviceGraphRequestClientHistogram, - p.serviceGraphUnpairedSpansTotal, - p.serviceGraphDroppedSpansTotal, +func (p *processor) registerMetrics(mp metric.MeterProvider, meterId string) error { + meter := mp.Meter(meterId) + + var err error + p.serviceGraphRequestTotal, err = meter.Float64Counter( + serviceGraphRequestTotal_name, + metric.WithDescription("Total count of requests between two nodes"), + ) + if err != nil { + return err } - for _, c := range cs { - if err := p.reg.Register(c); err != nil { - return err - } + p.serviceGraphRequestFailedTotal, err = meter.Float64Counter( + serviceGraphRequestFailedTotal_name, + metric.WithDescription("Total count of failed requests between two nodes"), + ) + if err != nil { + return err } - return nil -} + p.serviceGraphRequestServerHistogram, err = meter.Float64Histogram( + serviceGraphRequestServerHistogram_name, + metric.WithDescription("Time for a request between two nodes as seen from the server"), + ) + if err != nil { + return err + } + + p.serviceGraphRequestClientHistogram, err = meter.Float64Histogram( + serviceGraphRequestClientHistogram_name, + metric.WithDescription("Time for a request between two nodes as seen from the client"), + ) + if err != nil { + return err + } + + p.serviceGraphUnpairedSpansTotal, err = meter.Float64Counter( + serviceGraphUnpairedSpansTotal_name, + metric.WithDescription("Total count of unpaired spans"), + ) + if err != nil { + return err + } + + p.serviceGraphDroppedSpansTotal, err = meter.Float64Counter( + serviceGraphDroppedSpansTotal_name, + metric.WithDescription("Total count of dropped spans"), + ) + if err != nil { + return err + } -func (p *processor) Shutdown(context.Context) error { - close(p.closeCh) - p.unregisterMetrics() return nil } -func (p *processor) unregisterMetrics() { - cs := []prometheus.Collector{ - p.serviceGraphRequestTotal, - p.serviceGraphRequestFailedTotal, - p.serviceGraphRequestServerHistogram, - p.serviceGraphRequestClientHistogram, - p.serviceGraphUnpairedSpansTotal, +func OtelMetricViews() []sdkmetric.View { + return []sdkmetric.View{ + sdkmetric.NewView( + sdkmetric.Instrument{Name: serviceGraphRequestServerHistogram_name}, + sdkmetric.Stream{Aggregation: aggregation.ExplicitBucketHistogram{ + Boundaries: []float64{0.01, 0.02, 0.04, 0.08, 0.16, 0.32, 0.64, 1.28, 2.56, 5.12, 10.24, 20.48}, + }}, + ), + sdkmetric.NewView( + sdkmetric.Instrument{Name: serviceGraphRequestClientHistogram_name}, + sdkmetric.Stream{Aggregation: aggregation.ExplicitBucketHistogram{ + Boundaries: []float64{0.01, 0.02, 0.04, 0.08, 0.16, 0.32, 0.64, 1.28, 2.56, 5.12, 10.24, 20.48}, + }}, + ), } +} - for _, c := range cs { - p.reg.Unregister(c) - } +func (p *processor) Shutdown(context.Context) error { + close(p.closeCh) + return nil } func (p *processor) Capabilities() consumer.Capabilities { @@ -251,15 +268,21 @@ func (p *processor) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { // collectEdge records the metrics for the given edge. // Returns true if the edge is completed or expired and should be deleted. func (p *processor) collectEdge(e *edge) { + ctx := context.Background() + attrs := []attribute.KeyValue{ + attribute.Key("client").String(e.clientService), + attribute.Key("server").String(e.serverService), + } + if e.isCompleted() { - p.serviceGraphRequestTotal.WithLabelValues(e.clientService, e.serverService).Inc() + p.serviceGraphRequestTotal.Add(ctx, 1, metric.WithAttributes(attrs...)) if e.failed { - p.serviceGraphRequestFailedTotal.WithLabelValues(e.clientService, e.serverService).Inc() + p.serviceGraphRequestFailedTotal.Add(ctx, 1, metric.WithAttributes(attrs...)) } - p.serviceGraphRequestServerHistogram.WithLabelValues(e.clientService, e.serverService).Observe(e.serverLatency.Seconds()) - p.serviceGraphRequestClientHistogram.WithLabelValues(e.clientService, e.serverService).Observe(e.clientLatency.Seconds()) + p.serviceGraphRequestServerHistogram.Record(ctx, e.serverLatency.Seconds(), metric.WithAttributes(attrs...)) + p.serviceGraphRequestClientHistogram.Record(ctx, e.clientLatency.Seconds(), metric.WithAttributes(attrs...)) } else if e.isExpired() { - p.serviceGraphUnpairedSpansTotal.WithLabelValues(e.clientService, e.serverService).Inc() + p.serviceGraphUnpairedSpansTotal.Add(ctx, 1, metric.WithAttributes(attrs...)) } } @@ -274,6 +297,16 @@ func (p *processor) consume(trace ptrace.Traces) error { continue } + ctx := context.Background() + attrsClient := []attribute.KeyValue{ + attribute.Key("client").String(svc.Str()), + attribute.Key("server").String(""), + } + attrsServer := []attribute.KeyValue{ + attribute.Key("client").String(""), + attribute.Key("server").String(svc.Str()), + } + ssSlice := rSpan.ScopeSpans() for j := 0; j < ssSlice.Len(); j++ { ils := ssSlice.At(j) @@ -283,7 +316,7 @@ func (p *processor) consume(trace ptrace.Traces) error { switch span.Kind() { case ptrace.SpanKindClient: - k := key(span.TraceID().HexString(), span.SpanID().HexString()) + k := key(hex.EncodeToString([]byte(span.TraceID().String())), hex.EncodeToString([]byte(span.SpanID().String()))) edge, err := p.store.upsertEdge(k, func(e *edge) { e.clientService = svc.Str() @@ -293,7 +326,7 @@ func (p *processor) consume(trace ptrace.Traces) error { if errors.Is(err, errTooManyItems) { totalDroppedSpans++ - p.serviceGraphDroppedSpansTotal.WithLabelValues(svc.Str(), "").Inc() + p.serviceGraphDroppedSpansTotal.Add(ctx, 1, metric.WithAttributes(attrsClient...)) continue } // upsertEdge will only return this errTooManyItems @@ -306,7 +339,7 @@ func (p *processor) consume(trace ptrace.Traces) error { } case ptrace.SpanKindServer: - k := key(span.TraceID().HexString(), span.ParentSpanID().HexString()) + k := key(hex.EncodeToString([]byte(span.TraceID().String())), hex.EncodeToString([]byte(span.ParentSpanID().String()))) edge, err := p.store.upsertEdge(k, func(e *edge) { e.serverService = svc.Str() @@ -316,7 +349,7 @@ func (p *processor) consume(trace ptrace.Traces) error { if errors.Is(err, errTooManyItems) { totalDroppedSpans++ - p.serviceGraphDroppedSpansTotal.WithLabelValues("", svc.Str()).Inc() + p.serviceGraphDroppedSpansTotal.Add(ctx, 1, metric.WithAttributes(attrsServer...)) continue } // upsertEdge will only return this errTooManyItems diff --git a/pkg/traces/servicegraphprocessor/processor_test.go b/pkg/traces/servicegraphprocessor/processor_test.go index 311364eb4eb3..f9e0d9cb6219 100644 --- a/pkg/traces/servicegraphprocessor/processor_test.go +++ b/pkg/traces/servicegraphprocessor/processor_test.go @@ -7,13 +7,16 @@ import ( "testing" "time" - "github.com/grafana/agent/pkg/traces/contextkeys" + "github.com/grafana/agent/pkg/traces/internal/traceutils" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/testutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/ptrace" + otelprocessor "go.opentelemetry.io/collector/processor" + sdkmetric "go.opentelemetry.io/otel/sdk/metric" ) const ( @@ -43,12 +46,12 @@ func TestConsumeMetrics(t *testing.T) { Wait: -time.Millisecond, }, expectedMetrics: ` - # HELP traces_service_graph_unpaired_spans_total Total count of unpaired spans - # TYPE traces_service_graph_unpaired_spans_total counter - traces_service_graph_unpaired_spans_total{client="",server="db"} 2 - traces_service_graph_unpaired_spans_total{client="app",server=""} 3 - traces_service_graph_unpaired_spans_total{client="lb",server=""} 3 -`, + # HELP traces_service_graph_unpaired_spans_total Total count of unpaired spans + # TYPE traces_service_graph_unpaired_spans_total counter + traces_service_graph_unpaired_spans_total{client="",server="db"} 2 + traces_service_graph_unpaired_spans_total{client="app",server=""} 3 + traces_service_graph_unpaired_spans_total{client="lb",server=""} 3 + `, }, { name: "max items in storeMap is reached", @@ -72,13 +75,22 @@ func TestConsumeMetrics(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - p := newProcessor(&mockConsumer{}, tc.cfg) - close(p.closeCh) // Don't collect any edges, leave that to the test. - reg := prometheus.NewRegistry() - ctx := context.WithValue(context.Background(), contextkeys.PrometheusRegisterer, reg) - err := p.Start(ctx, nil) + processorSettings := otelprocessor.CreateSettings{ + ID: component.NewID("FakeID"), + TelemetrySettings: component.TelemetrySettings{ + MeterProvider: getTestMeterProvider(t, reg), + }, + BuildInfo: component.BuildInfo{}, + } + var err error + p, err := newProcessor(&mockConsumer{}, tc.cfg, processorSettings) + require.NoError(t, err) + + close(p.closeCh) // Don't collect any edges, leave that to the test. + + err = p.Start(context.Background(), nil) require.NoError(t, err) traces := traceSamples(t, tc.sampleDataPath) @@ -96,6 +108,17 @@ func TestConsumeMetrics(t *testing.T) { } } +func getTestMeterProvider(t *testing.T, reg prometheus.Registerer) *sdkmetric.MeterProvider { + promExporter, err := traceutils.PrometheusExporter(reg) + require.NoError(t, err) + + mp := sdkmetric.NewMeterProvider( + sdkmetric.WithReader(promExporter), + sdkmetric.WithView(OtelMetricViews()...), + ) + + return mp +} func traceSamples(t *testing.T, path string) ptrace.Traces { b, err := os.ReadFile(path) require.NoError(t, err) diff --git a/pkg/traces/servicegraphprocessor/store.go b/pkg/traces/servicegraphprocessor/store.go index e8d6d45b1c6b..a16ba34ac05f 100644 --- a/pkg/traces/servicegraphprocessor/store.go +++ b/pkg/traces/servicegraphprocessor/store.go @@ -54,6 +54,7 @@ func (s *store) shouldEvictHead() bool { return false } ts := h.Value.(*edge).expiration + //TODO: This should use a steady monotonic clock? Otherwise if the time is adjusted this will not work properly return ts < time.Now().Unix() } diff --git a/pkg/traces/traces.go b/pkg/traces/traces.go index f4b4516524c0..2591a78de7f7 100644 --- a/pkg/traces/traces.go +++ b/pkg/traces/traces.go @@ -4,17 +4,12 @@ import ( "fmt" "sync" - "contrib.go.opencensus.io/exporter/prometheus" "github.com/go-kit/log" "github.com/grafana/agent/pkg/logs" "github.com/grafana/agent/pkg/metrics/instance" "github.com/grafana/agent/pkg/util/zapadapter" prom_client "github.com/prometheus/client_golang/prometheus" - "go.opencensus.io/stats/view" - "go.opentelemetry.io/collector/external/obsreportconfig" "go.uber.org/zap" - - "go.opentelemetry.io/collector/config/configtelemetry" ) // Traces wraps the OpenTelemetry collector to enable tracing pipelines @@ -114,23 +109,3 @@ func newLogger(l log.Logger) *zap.Logger { return logger } - -func newMetricViews(reg prom_client.Registerer) ([]*view.View, error) { - obsMetrics := obsreportconfig.Configure(configtelemetry.LevelBasic) - err := view.Register(obsMetrics.Views...) - if err != nil { - return nil, fmt.Errorf("failed to register views: %w", err) - } - - pe, err := prometheus.NewExporter(prometheus.Options{ - Namespace: "traces", - Registerer: reg, - }) - if err != nil { - return nil, fmt.Errorf("failed to create prometheus exporter: %w", err) - } - - view.RegisterExporter(pe) - - return obsMetrics.Views, nil -}