Skip to content

Commit

Permalink
chore: fix deprecated linter errors
Browse files Browse the repository at this point in the history
Signed-off-by: hainenber <[email protected]>
  • Loading branch information
hainenber committed Nov 25, 2023
1 parent bbb86f6 commit cda51e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions component/otelcol/receiver/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"github.com/prometheus/prometheus/storage"
otelcomponent "go.opentelemetry.io/collector/component"
otelreceiver "go.opentelemetry.io/collector/receiver"
"go.opentelemetry.io/otel/metric/noop"
"go.opentelemetry.io/otel/trace"
metricNoop "go.opentelemetry.io/otel/metric/noop"
traceNoop "go.opentelemetry.io/otel/trace/noop"
)

func init() {
Expand Down Expand Up @@ -107,8 +107,8 @@ func (c *Component) Update(newConfig component.Arguments) error {
Logger: zapadapter.New(c.opts.Logger),

// TODO(tpaschalis): expose tracing and logging statistics.
TracerProvider: trace.NewNoopTracerProvider(),
MeterProvider: noop.NewMeterProvider(),
TracerProvider: traceNoop.NewTracerProvider(),
MeterProvider: metricNoop.NewMeterProvider(),

ReportComponentStatus: func(*otelcomponent.StatusEvent) error {
return nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/flow/componenttest/componenttest.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (

"github.com/grafana/agent/service/labelstore"
"github.com/prometheus/client_golang/prometheus"
"go.opentelemetry.io/otel/trace"
"go.uber.org/atomic"

"github.com/go-kit/log"
"github.com/grafana/agent/component"
"github.com/grafana/agent/pkg/flow/logging"
"go.opentelemetry.io/otel/trace/noop"
)

// A Controller is a testing controller which controls a single component.
Expand Down Expand Up @@ -155,7 +155,7 @@ func (c *Controller) buildComponent(dataPath string, args component.Arguments) (
opts := component.Options{
ID: c.reg.Name + ".test",
Logger: l,
Tracer: trace.NewNoopTracerProvider(),
Tracer: noop.NewTracerProvider(),
DataPath: dataPath,
OnStateChange: c.onStateChange,
Registerer: prometheus.NewRegistry(),
Expand Down
4 changes: 2 additions & 2 deletions pkg/traces/traceutils/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"go.opentelemetry.io/collector/receiver"
"go.opentelemetry.io/collector/receiver/otlpreceiver"
"go.opentelemetry.io/collector/service"
"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/trace/noop"
"gopkg.in/yaml.v3"
)

Expand Down Expand Up @@ -153,7 +153,7 @@ func newServer(addr string, callback func(ptrace.Traces)) (*server, error) {
Connectors: connector.NewBuilder(otelCfg.Connectors, factories.Connectors),
Extensions: extension.NewBuilder(otelCfg.Extensions, factories.Extensions),
UseExternalMetricsServer: false,
TracerProvider: trace.NewNoopTracerProvider(),
TracerProvider: noop.NewTracerProvider(),
}, otelCfg.Service)
if err != nil {
return nil, fmt.Errorf("failed to create Otel service: %w", err)
Expand Down

0 comments on commit cda51e2

Please sign in to comment.