diff --git a/exporter/awsemfexporter/datapoint.go b/exporter/awsemfexporter/datapoint.go index 620c3be733d8..e32b65e7a493 100644 --- a/exporter/awsemfexporter/datapoint.go +++ b/exporter/awsemfexporter/datapoint.go @@ -26,7 +26,7 @@ var ( summaryMetricCalculator = aws.NewMetricCalculator(calculateSummaryDelta) ) -func calculateSummaryDelta(prev *aws.MetricValue, val interface{}, timestampMs time.Time) (interface{}, bool) { +func calculateSummaryDelta(prev *aws.MetricValue, val interface{}, _ time.Time) (interface{}, bool) { metricEntry := val.(summaryMetricEntry) summaryDelta := metricEntry.sum countDelta := metricEntry.count @@ -98,7 +98,7 @@ type summaryMetricEntry struct { } // CalculateDeltaDatapoints retrieves the NumberDataPoint at the given index and performs rate/delta calculation if necessary. -func (dps numberDataPointSlice) CalculateDeltaDatapoints(i int, instrumentationScopeName string, detailedMetrics bool) ([]dataPoint, bool) { +func (dps numberDataPointSlice) CalculateDeltaDatapoints(i int, instrumentationScopeName string, _ bool) ([]dataPoint, bool) { metric := dps.NumberDataPointSlice.At(i) labels := createLabels(metric.Attributes(), instrumentationScopeName) timestampMs := unixNanoToMilliseconds(metric.Timestamp()) @@ -138,7 +138,7 @@ func (dps numberDataPointSlice) CalculateDeltaDatapoints(i int, instrumentationS } // CalculateDeltaDatapoints retrieves the HistogramDataPoint at the given index. -func (dps histogramDataPointSlice) CalculateDeltaDatapoints(i int, instrumentationScopeName string, detailedMetrics bool) ([]dataPoint, bool) { +func (dps histogramDataPointSlice) CalculateDeltaDatapoints(i int, instrumentationScopeName string, _ bool) ([]dataPoint, bool) { metric := dps.HistogramDataPointSlice.At(i) labels := createLabels(metric.Attributes(), instrumentationScopeName) timestamp := unixNanoToMilliseconds(metric.Timestamp()) diff --git a/exporter/awsemfexporter/emf_exporter.go b/exporter/awsemfexporter/emf_exporter.go index 783c45d3410b..f861c026e9d7 100644 --- a/exporter/awsemfexporter/emf_exporter.go +++ b/exporter/awsemfexporter/emf_exporter.go @@ -166,7 +166,7 @@ func (emf *emfExporter) listPushers() []cwlogs.Pusher { } // shutdown stops the exporter and is invoked during shutdown. -func (emf *emfExporter) shutdown(ctx context.Context) error { +func (emf *emfExporter) shutdown(_ context.Context) error { for _, emfPusher := range emf.listPushers() { returnError := emfPusher.ForceFlush() if returnError != nil { diff --git a/exporter/awsemfexporter/emf_exporter_test.go b/exporter/awsemfexporter/emf_exporter_test.go index b95982d50475..67e2739516b0 100644 --- a/exporter/awsemfexporter/emf_exporter_test.go +++ b/exporter/awsemfexporter/emf_exporter_test.go @@ -39,7 +39,7 @@ type mockPusher struct { mock.Mock } -func (p *mockPusher) AddLogEntry(logEvent *cwlogs.Event) error { +func (p *mockPusher) AddLogEntry(_ *cwlogs.Event) error { args := p.Called(nil) errorStr := args.String(0) if errorStr != "" { diff --git a/exporter/azuremonitorexporter/factory.go b/exporter/azuremonitorexporter/factory.go index 4bc1f4241a9f..aee00000a27c 100644 --- a/exporter/azuremonitorexporter/factory.go +++ b/exporter/azuremonitorexporter/factory.go @@ -52,7 +52,7 @@ func createDefaultConfig() component.Config { } func (f *factory) createTracesExporter( - ctx context.Context, + _ context.Context, set exporter.CreateSettings, cfg component.Config, ) (exporter.Traces, error) { @@ -67,7 +67,7 @@ func (f *factory) createTracesExporter( } func (f *factory) createLogsExporter( - ctx context.Context, + _ context.Context, set exporter.CreateSettings, cfg component.Config, ) (exporter.Logs, error) { @@ -82,7 +82,7 @@ func (f *factory) createLogsExporter( } func (f *factory) createMetricsExporter( - ctx context.Context, + _ context.Context, set exporter.CreateSettings, cfg component.Config, ) (exporter.Metrics, error) { diff --git a/exporter/azuremonitorexporter/logexporter.go b/exporter/azuremonitorexporter/logexporter.go index bc402249a116..c823887d3f60 100644 --- a/exporter/azuremonitorexporter/logexporter.go +++ b/exporter/azuremonitorexporter/logexporter.go @@ -18,7 +18,7 @@ type logExporter struct { logger *zap.Logger } -func (exporter *logExporter) onLogData(context context.Context, logData plog.Logs) error { +func (exporter *logExporter) onLogData(_ context.Context, logData plog.Logs) error { resourceLogs := logData.ResourceLogs() logPacker := newLogPacker(exporter.logger) diff --git a/exporter/azuremonitorexporter/metricexporter.go b/exporter/azuremonitorexporter/metricexporter.go index 82771584490b..bd264fad600a 100644 --- a/exporter/azuremonitorexporter/metricexporter.go +++ b/exporter/azuremonitorexporter/metricexporter.go @@ -19,7 +19,7 @@ type metricExporter struct { packer *metricPacker } -func (exporter *metricExporter) onMetricData(context context.Context, metricData pmetric.Metrics) error { +func (exporter *metricExporter) onMetricData(_ context.Context, metricData pmetric.Metrics) error { resourceMetrics := metricData.ResourceMetrics() for i := 0; i < resourceMetrics.Len(); i++ { diff --git a/exporter/azuremonitorexporter/traceexporter.go b/exporter/azuremonitorexporter/traceexporter.go index 339313a7440e..a3dc717c3ae3 100644 --- a/exporter/azuremonitorexporter/traceexporter.go +++ b/exporter/azuremonitorexporter/traceexporter.go @@ -51,7 +51,7 @@ func (v *traceVisitor) visit( return true } -func (exporter *traceExporter) onTraceData(context context.Context, traceData ptrace.Traces) error { +func (exporter *traceExporter) onTraceData(_ context.Context, traceData ptrace.Traces) error { spanCount := traceData.SpanCount() if spanCount == 0 { return nil diff --git a/exporter/clickhouseexporter/exporter_logs_test.go b/exporter/clickhouseexporter/exporter_logs_test.go index 30c7d057b313..081d5e627e24 100644 --- a/exporter/clickhouseexporter/exporter_logs_test.go +++ b/exporter/clickhouseexporter/exporter_logs_test.go @@ -144,7 +144,7 @@ type testClickhouseDriver struct { recorder recorder } -func (t *testClickhouseDriver) Open(name string) (driver.Conn, error) { +func (t *testClickhouseDriver) Open(_ string) (driver.Conn, error) { return &testClickhouseDriverConn{ recorder: t.recorder, }, nil @@ -169,7 +169,7 @@ func (*testClickhouseDriverConn) Begin() (driver.Tx, error) { return &testClickhouseDriverTx{}, nil } -func (*testClickhouseDriverConn) CheckNamedValue(v *driver.NamedValue) error { +func (*testClickhouseDriverConn) CheckNamedValue(_ *driver.NamedValue) error { return nil } @@ -190,7 +190,7 @@ func (t *testClickhouseDriverStmt) Exec(args []driver.Value) (driver.Result, err return nil, t.recorder(t.query, args) } -func (t *testClickhouseDriverStmt) Query(args []driver.Value) (driver.Rows, error) { +func (t *testClickhouseDriverStmt) Query(_ []driver.Value) (driver.Rows, error) { return nil, nil } diff --git a/exporter/clickhouseexporter/exporter_metrics.go b/exporter/clickhouseexporter/exporter_metrics.go index 120543888115..44eb408cedb3 100644 --- a/exporter/clickhouseexporter/exporter_metrics.go +++ b/exporter/clickhouseexporter/exporter_metrics.go @@ -46,7 +46,7 @@ func (e *metricsExporter) start(ctx context.Context, _ component.Host) error { } // shutdown will shut down the exporter. -func (e *metricsExporter) shutdown(ctx context.Context) error { +func (e *metricsExporter) shutdown(_ context.Context) error { if e.client != nil { return e.client.Close() } diff --git a/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2.go b/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2.go index bc16e431b5ff..0b53df8fc78b 100644 --- a/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2.go +++ b/exporter/datadogexporter/internal/hostmetadata/internal/ec2/ec2.go @@ -74,7 +74,7 @@ func GetHostInfo(logger *zap.Logger) (hostInfo *HostInfo) { return } -func (hi *HostInfo) GetHostname(logger *zap.Logger) string { +func (hi *HostInfo) GetHostname(_ *zap.Logger) string { if isDefaultHostname(hi.EC2Hostname) { return hi.InstanceID } @@ -108,7 +108,7 @@ func (p *Provider) fillHostInfo() { p.once.Do(func() { p.hostInfo = *GetHostInfo(p.logger) }) } -func (p *Provider) Source(ctx context.Context) (source.Source, error) { +func (p *Provider) Source(_ context.Context) (source.Source, error) { p.fillHostInfo() if p.hostInfo.InstanceID == "" { return source.Source{}, fmt.Errorf("instance ID is unavailable") diff --git a/exporter/datadogexporter/internal/hostmetadata/internal/ecs/provider.go b/exporter/datadogexporter/internal/hostmetadata/internal/ecs/provider.go index 3e7ed7a04f8d..186aa1ca9c08 100644 --- a/exporter/datadogexporter/internal/hostmetadata/internal/ecs/provider.go +++ b/exporter/datadogexporter/internal/hostmetadata/internal/ecs/provider.go @@ -27,7 +27,7 @@ type Provider struct { } // OnECSFargate determines if the application is running on ECS Fargate. -func (p *Provider) OnECSFargate(ctx context.Context) (bool, error) { +func (p *Provider) OnECSFargate(_ context.Context) (bool, error) { if p.missingEndpoint { // No ECS metadata endpoint, therefore not on ECS Fargate return false, nil diff --git a/exporter/datadogexporter/internal/hostmetadata/internal/gcp/provider.go b/exporter/datadogexporter/internal/hostmetadata/internal/gcp/provider.go index 89cd2c7a8d58..399fdd3867db 100644 --- a/exporter/datadogexporter/internal/hostmetadata/internal/gcp/provider.go +++ b/exporter/datadogexporter/internal/hostmetadata/internal/gcp/provider.go @@ -73,7 +73,7 @@ func (p *Provider) Source(context.Context) (source.Source, error) { return source.Source{Kind: source.HostnameKind, Identifier: fmt.Sprintf("%s.%s", name, cloudAccount)}, nil } -func (p *Provider) ClusterName(ctx context.Context) (string, error) { +func (p *Provider) ClusterName(_ context.Context) (string, error) { return p.detector.GKEClusterName() } diff --git a/exporter/datadogexporter/internal/testutil/test_utils.go b/exporter/datadogexporter/internal/testutil/test_utils.go index 0394b5d05bae..0661282b0f79 100644 --- a/exporter/datadogexporter/internal/testutil/test_utils.go +++ b/exporter/datadogexporter/internal/testutil/test_utils.go @@ -97,7 +97,7 @@ type validateAPIKeyResponse struct { Valid bool `json:"valid"` } -func validateAPIKeyEndpoint(w http.ResponseWriter, r *http.Request) { +func validateAPIKeyEndpoint(w http.ResponseWriter, _ *http.Request) { res := validateAPIKeyResponse{Valid: true} resJSON, _ := json.Marshal(res) @@ -108,7 +108,7 @@ func validateAPIKeyEndpoint(w http.ResponseWriter, r *http.Request) { } } -func validateAPIKeyEndpointInvalid(w http.ResponseWriter, r *http.Request) { +func validateAPIKeyEndpointInvalid(w http.ResponseWriter, _ *http.Request) { res := validateAPIKeyResponse{Valid: false} resJSON, _ := json.Marshal(res) @@ -123,7 +123,7 @@ type metricsResponse struct { Status string `json:"status"` } -func metricsEndpoint(w http.ResponseWriter, r *http.Request) { +func metricsEndpoint(w http.ResponseWriter, _ *http.Request) { res := metricsResponse{Status: "ok"} resJSON, _ := json.Marshal(res) @@ -135,7 +135,7 @@ func metricsEndpoint(w http.ResponseWriter, r *http.Request) { } } -func metricsV2Endpoint(w http.ResponseWriter, r *http.Request) { +func metricsV2Endpoint(w http.ResponseWriter, _ *http.Request) { res := metricsResponse{Status: "ok"} resJSON, _ := json.Marshal(res) @@ -218,7 +218,7 @@ type MockSourceProvider struct { Src source.Source } -func (s *MockSourceProvider) Source(ctx context.Context) (source.Source, error) { +func (s *MockSourceProvider) Source(_ context.Context) (source.Source, error) { return s.Src, nil } @@ -226,7 +226,7 @@ type MockStatsProcessor struct { In []pb.ClientStatsPayload } -func (s *MockStatsProcessor) ProcessStats(in pb.ClientStatsPayload, lang, tracerVersion string) { +func (s *MockStatsProcessor) ProcessStats(in pb.ClientStatsPayload, _, _ string) { s.In = append(s.In, in) } diff --git a/exporter/datadogexporter/logs_exporter.go b/exporter/datadogexporter/logs_exporter.go index c127557b860f..1e7f26601d15 100644 --- a/exporter/datadogexporter/logs_exporter.go +++ b/exporter/datadogexporter/logs_exporter.go @@ -69,7 +69,7 @@ func newLogsExporter(ctx context.Context, params exporter.CreateSettings, cfg *C var _ consumer.ConsumeLogsFunc = (*logsExporter)(nil).consumeLogs // consumeLogs is implementation of cosumer.ConsumeLogsFunc -func (exp *logsExporter) consumeLogs(ctx context.Context, ld plog.Logs) (err error) { +func (exp *logsExporter) consumeLogs(_ context.Context, ld plog.Logs) (err error) { defer func() { err = exp.scrubber.Scrub(err) }() if exp.cfg.HostMetadata.Enabled { // start host metadata with resource attributes from diff --git a/exporter/datadogexporter/traces_exporter_test.go b/exporter/datadogexporter/traces_exporter_test.go index ed6348d91409..9447926ec728 100644 --- a/exporter/datadogexporter/traces_exporter_test.go +++ b/exporter/datadogexporter/traces_exporter_test.go @@ -38,10 +38,10 @@ func TestMain(m *testing.M) { type testlogger struct{} // Trace implements Logger. -func (testlogger) Trace(v ...interface{}) {} +func (testlogger) Trace(_ ...interface{}) {} // Tracef implements Logger. -func (testlogger) Tracef(format string, params ...interface{}) {} +func (testlogger) Tracef(_ string, _ ...interface{}) {} // Debug implements Logger. func (testlogger) Debug(v ...interface{}) { fmt.Println("DEBUG", fmt.Sprint(v...)) } diff --git a/exporter/pulsarexporter/jaeger_marshaler.go b/exporter/pulsarexporter/jaeger_marshaler.go index 553e74457c79..070c13033cf0 100644 --- a/exporter/pulsarexporter/jaeger_marshaler.go +++ b/exporter/pulsarexporter/jaeger_marshaler.go @@ -21,7 +21,7 @@ type jaegerMarshaler struct { var _ TracesMarshaler = (*jaegerMarshaler)(nil) -func (j jaegerMarshaler) Marshal(traces ptrace.Traces, topic string) ([]*pulsar.ProducerMessage, error) { +func (j jaegerMarshaler) Marshal(traces ptrace.Traces, _ string) ([]*pulsar.ProducerMessage, error) { batches, err := jaeger.ProtoFromTraces(traces) if err != nil { return nil, err diff --git a/exporter/pulsarexporter/pdata_marshaler.go b/exporter/pulsarexporter/pdata_marshaler.go index 8943129783a5..86125f194dfa 100644 --- a/exporter/pulsarexporter/pdata_marshaler.go +++ b/exporter/pulsarexporter/pdata_marshaler.go @@ -15,7 +15,7 @@ type pdataLogsMarshaler struct { encoding string } -func (p pdataLogsMarshaler) Marshal(ld plog.Logs, topic string) ([]*pulsar.ProducerMessage, error) { +func (p pdataLogsMarshaler) Marshal(ld plog.Logs, _ string) ([]*pulsar.ProducerMessage, error) { bts, err := p.marshaler.MarshalLogs(ld) if err != nil { return nil, err @@ -43,7 +43,7 @@ type pdataMetricsMarshaler struct { encoding string } -func (p pdataMetricsMarshaler) Marshal(ld pmetric.Metrics, topic string) ([]*pulsar.ProducerMessage, error) { +func (p pdataMetricsMarshaler) Marshal(ld pmetric.Metrics, _ string) ([]*pulsar.ProducerMessage, error) { bts, err := p.marshaler.MarshalMetrics(ld) if err != nil { return nil, err @@ -71,7 +71,7 @@ type pdataTracesMarshaler struct { encoding string } -func (p pdataTracesMarshaler) Marshal(td ptrace.Traces, topic string) ([]*pulsar.ProducerMessage, error) { +func (p pdataTracesMarshaler) Marshal(td ptrace.Traces, _ string) ([]*pulsar.ProducerMessage, error) { bts, err := p.marshaler.MarshalTraces(td) if err != nil { return nil, err diff --git a/exporter/signalfxexporter/exporter.go b/exporter/signalfxexporter/exporter.go index 98bb6f566943..48b1c2735a96 100644 --- a/exporter/signalfxexporter/exporter.go +++ b/exporter/signalfxexporter/exporter.go @@ -238,7 +238,7 @@ func (se *signalfxExporter) pushLogs(ctx context.Context, ld plog.Logs) error { return err } -func (se *signalfxExporter) shutdown(ctx context.Context) error { +func (se *signalfxExporter) shutdown(_ context.Context) error { if se.cancelFn != nil { se.cancelFn() } diff --git a/exporter/signalfxexporter/internal/hostmetadata/host_others.go b/exporter/signalfxexporter/internal/hostmetadata/host_others.go index f8767702f688..a010c6ee433e 100644 --- a/exporter/signalfxexporter/internal/hostmetadata/host_others.go +++ b/exporter/signalfxexporter/internal/hostmetadata/host_others.go @@ -8,10 +8,10 @@ package hostmetadata // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/signalfxexporter/internal/hostmetadata" -func fillPlatformSpecificOSData(info *hostOS) error { +func fillPlatformSpecificOSData(_ *hostOS) error { return nil } -func fillPlatformSpecificCPUData(info *hostCPU) error { +func fillPlatformSpecificCPUData(_ *hostCPU) error { return nil } diff --git a/exporter/tencentcloudlogserviceexporter/logs_exporter.go b/exporter/tencentcloudlogserviceexporter/logs_exporter.go index 771c694225e6..d427a7d8d5e9 100644 --- a/exporter/tencentcloudlogserviceexporter/logs_exporter.go +++ b/exporter/tencentcloudlogserviceexporter/logs_exporter.go @@ -34,7 +34,7 @@ type logServiceLogsSender struct { } func (s *logServiceLogsSender) pushLogsData( - ctx context.Context, + _ context.Context, md plog.Logs) error { var err error clsLogs := convertLogs(md) diff --git a/extension/awsproxy/extension.go b/extension/awsproxy/extension.go index b4f2b672a94d..7e703bc6cefc 100644 --- a/extension/awsproxy/extension.go +++ b/extension/awsproxy/extension.go @@ -23,7 +23,7 @@ type xrayProxy struct { var _ extension.Extension = (*xrayProxy)(nil) -func (x xrayProxy) Start(ctx context.Context, host component.Host) error { +func (x xrayProxy) Start(_ context.Context, host component.Host) error { go func() { if err := x.server.ListenAndServe(); !errors.Is(err, http.ErrServerClosed) && err != nil { host.ReportFatalError(err) diff --git a/extension/basicauthextension/extension.go b/extension/basicauthextension/extension.go index db3742981c56..28c69b9fcb1f 100644 --- a/extension/basicauthextension/extension.go +++ b/extension/basicauthextension/extension.go @@ -62,7 +62,7 @@ func newServerAuthExtension(cfg *Config) (auth.Server, error) { ), nil } -func (ba *basicAuth) serverStart(ctx context.Context, host component.Host) error { +func (ba *basicAuth) serverStart(_ context.Context, _ component.Host) error { var rs []io.Reader if ba.htpasswd.File != "" { diff --git a/processor/datadogprocessor/processor.go b/processor/datadogprocessor/processor.go index 6e35761518cf..d828b4a8221e 100644 --- a/processor/datadogprocessor/processor.go +++ b/processor/datadogprocessor/processor.go @@ -61,7 +61,7 @@ func newProcessor(ctx context.Context, logger *zap.Logger, config component.Conf } // Start implements the component.Component interface. -func (p *datadogProcessor) Start(ctx context.Context, host component.Host) error { +func (p *datadogProcessor) Start(_ context.Context, host component.Host) error { var datadogs []exporter.Metrics loop: for k, exp := range host.GetExporters()[component.DataTypeMetrics] { diff --git a/processor/datadogprocessor/processor_test.go b/processor/datadogprocessor/processor_test.go index 682dba478de9..9ff845e422af 100644 --- a/processor/datadogprocessor/processor_test.go +++ b/processor/datadogprocessor/processor_test.go @@ -209,9 +209,9 @@ type mockHost struct { Exporters map[component.DataType]map[component.ID]component.Component } -func (m *mockHost) ReportFatalError(err error) {} +func (m *mockHost) ReportFatalError(_ error) {} -func (m *mockHost) GetFactory(kind component.Kind, componentType component.Type) component.Factory { +func (m *mockHost) GetFactory(_ component.Kind, _ component.Type) component.Factory { return nil } diff --git a/processor/logstransformprocessor/factory.go b/processor/logstransformprocessor/factory.go index 7bbc3effcee0..3a584ee53a68 100644 --- a/processor/logstransformprocessor/factory.go +++ b/processor/logstransformprocessor/factory.go @@ -34,7 +34,7 @@ func createDefaultConfig() component.Config { } func createLogsProcessor( - ctx context.Context, + _ context.Context, set processor.CreateSettings, cfg component.Config, nextConsumer consumer.Logs) (processor.Logs, error) { diff --git a/processor/logstransformprocessor/processor.go b/processor/logstransformprocessor/processor.go index 944997463d31..9df756c03344 100644 --- a/processor/logstransformprocessor/processor.go +++ b/processor/logstransformprocessor/processor.go @@ -62,7 +62,7 @@ func (ltp *logsTransformProcessor) Capabilities() consumer.Capabilities { return consumer.Capabilities{MutatesData: true} } -func (ltp *logsTransformProcessor) Shutdown(ctx context.Context) error { +func (ltp *logsTransformProcessor) Shutdown(_ context.Context) error { ltp.logger.Info("Stopping logs transform processor") pipelineErr := ltp.pipe.Stop() ltp.converter.Stop() @@ -72,7 +72,7 @@ func (ltp *logsTransformProcessor) Shutdown(ctx context.Context) error { return pipelineErr } -func (ltp *logsTransformProcessor) Start(ctx context.Context, host component.Host) error { +func (ltp *logsTransformProcessor) Start(ctx context.Context, _ component.Host) error { // There is no need for this processor to use storage err := ltp.pipe.Start(storage.NewNopClient()) @@ -116,7 +116,7 @@ func (ltp *logsTransformProcessor) Start(ctx context.Context, host component.Hos return nil } -func (ltp *logsTransformProcessor) ConsumeLogs(ctx context.Context, ld plog.Logs) error { +func (ltp *logsTransformProcessor) ConsumeLogs(_ context.Context, ld plog.Logs) error { // Add the logs to the chain return ltp.fromConverter.Batch(ld) } diff --git a/processor/schemaprocessor/transformer.go b/processor/schemaprocessor/transformer.go index 959478da0420..3437747b0674 100644 --- a/processor/schemaprocessor/transformer.go +++ b/processor/schemaprocessor/transformer.go @@ -35,21 +35,21 @@ func newTransformer( }, nil } -func (t transformer) processLogs(ctx context.Context, ld plog.Logs) (plog.Logs, error) { +func (t transformer) processLogs(_ context.Context, ld plog.Logs) (plog.Logs, error) { return ld, nil } -func (t transformer) processMetrics(ctx context.Context, md pmetric.Metrics) (pmetric.Metrics, error) { +func (t transformer) processMetrics(_ context.Context, md pmetric.Metrics) (pmetric.Metrics, error) { return md, nil } -func (t transformer) processTraces(ctx context.Context, td ptrace.Traces) (ptrace.Traces, error) { +func (t transformer) processTraces(_ context.Context, td ptrace.Traces) (ptrace.Traces, error) { return td, nil } // start will load the remote file definition if it isn't already cached // and resolve the schema translation file -func (t *transformer) start(ctx context.Context, host component.Host) error { +func (t *transformer) start(_ context.Context, _ component.Host) error { for _, target := range t.targets { t.log.Info("Fetching remote schema url", zap.String("schema-url", target)) } diff --git a/receiver/activedirectorydsreceiver/scraper.go b/receiver/activedirectorydsreceiver/scraper.go index 832bc2191321..541aebd9e451 100644 --- a/receiver/activedirectorydsreceiver/scraper.go +++ b/receiver/activedirectorydsreceiver/scraper.go @@ -251,6 +251,6 @@ func (a *activeDirectoryDSScraper) scrape(ctx context.Context) (pmetric.Metrics, return pmetric.Metrics(a.mb.Emit()), nil } -func (a *activeDirectoryDSScraper) shutdown(ctx context.Context) error { +func (a *activeDirectoryDSScraper) shutdown(_ context.Context) error { return a.w.Close() } diff --git a/receiver/prometheusexecreceiver/factory.go b/receiver/prometheusexecreceiver/factory.go index ef1ad671bfcb..307fa011b5c3 100644 --- a/receiver/prometheusexecreceiver/factory.go +++ b/receiver/prometheusexecreceiver/factory.go @@ -52,7 +52,7 @@ func createDefaultConfig() component.Config { // createMetricsReceiver creates a metrics receiver based on provided Config. func createMetricsReceiver( - ctx context.Context, + _ context.Context, params receiver.CreateSettings, cfg component.Config, nextConsumer consumer.Metrics, diff --git a/receiver/prometheusexecreceiver/receiver.go b/receiver/prometheusexecreceiver/receiver.go index c253517ccb61..6836c397d723 100644 --- a/receiver/prometheusexecreceiver/receiver.go +++ b/receiver/prometheusexecreceiver/receiver.go @@ -125,7 +125,7 @@ func getSubprocessConfig(cfg *Config) *subprocessmanager.SubprocessConfig { } // Start creates the configs and calls the function that handles the prometheus_exec receiver -func (per *prometheusExecReceiver) Start(ctx context.Context, host component.Host) error { +func (per *prometheusExecReceiver) Start(_ context.Context, host component.Host) error { // shutdown channel per.shutdownCh = make(chan struct{}) @@ -290,7 +290,7 @@ func getDelay(elapsed time.Duration, healthyProcessDuration time.Duration, crash } // Shutdown stops the underlying Prometheus receiver. -func (per *prometheusExecReceiver) Shutdown(ctx context.Context) error { +func (per *prometheusExecReceiver) Shutdown(_ context.Context) error { if per.shutdownCh == nil { return nil } diff --git a/receiver/prometheusreceiver/internal/transaction.go b/receiver/prometheusreceiver/internal/transaction.go index e84d9200948a..f866ccff2d45 100644 --- a/receiver/prometheusreceiver/internal/transaction.go +++ b/receiver/prometheusreceiver/internal/transaction.go @@ -179,7 +179,7 @@ func (t *transaction) AppendExemplar(_ storage.SeriesRef, l labels.Labels, e exe return 0, nil } -func (t *transaction) AppendHistogram(_ storage.SeriesRef, _ labels.Labels, _ int64, h *histogram.Histogram, _ *histogram.FloatHistogram) (storage.SeriesRef, error) { +func (t *transaction) AppendHistogram(_ storage.SeriesRef, _ labels.Labels, _ int64, _ *histogram.Histogram, _ *histogram.FloatHistogram) (storage.SeriesRef, error) { //TODO: implement this func return 0, nil } @@ -262,7 +262,7 @@ func (t *transaction) Rollback() error { return nil } -func (t *transaction) UpdateMetadata(ref storage.SeriesRef, l labels.Labels, m metadata.Metadata) (storage.SeriesRef, error) { +func (t *transaction) UpdateMetadata(_ storage.SeriesRef, _ labels.Labels, _ metadata.Metadata) (storage.SeriesRef, error) { //TODO: implement this func return 0, nil } diff --git a/receiver/purefareceiver/internal/scraper.go b/receiver/purefareceiver/internal/scraper.go index dab35c01fa5d..7a63b1925db3 100644 --- a/receiver/purefareceiver/internal/scraper.go +++ b/receiver/purefareceiver/internal/scraper.go @@ -39,7 +39,7 @@ type scraper struct { labels model.LabelSet } -func NewScraper(ctx context.Context, +func NewScraper(_ context.Context, scraperType ScraperType, endpoint string, configs []ScraperConfig, @@ -55,7 +55,7 @@ func NewScraper(ctx context.Context, } } -func (h *scraper) ToPrometheusReceiverConfig(host component.Host, fact receiver.Factory) ([]*config.ScrapeConfig, error) { +func (h *scraper) ToPrometheusReceiverConfig(host component.Host, _ receiver.Factory) ([]*config.ScrapeConfig, error) { scrapeCfgs := []*config.ScrapeConfig{} for _, arr := range h.configs { diff --git a/receiver/purefbreceiver/internal/scraper.go b/receiver/purefbreceiver/internal/scraper.go index 366dec3f031f..77a1391d4be4 100644 --- a/receiver/purefbreceiver/internal/scraper.go +++ b/receiver/purefbreceiver/internal/scraper.go @@ -37,7 +37,7 @@ type scraper struct { labels model.LabelSet } -func NewScraper(ctx context.Context, +func NewScraper(_ context.Context, scraperType ScraperType, endpoint string, configs []ScraperConfig, @@ -53,7 +53,7 @@ func NewScraper(ctx context.Context, } } -func (h *scraper) ToPrometheusReceiverConfig(host component.Host, fact receiver.Factory) ([]*config.ScrapeConfig, error) { +func (h *scraper) ToPrometheusReceiverConfig(host component.Host, _ receiver.Factory) ([]*config.ScrapeConfig, error) { scrapeCfgs := []*config.ScrapeConfig{} for _, arr := range h.configs { diff --git a/receiver/rabbitmqreceiver/factory.go b/receiver/rabbitmqreceiver/factory.go index c9f7e8376c8a..0de7598a95bd 100644 --- a/receiver/rabbitmqreceiver/factory.go +++ b/receiver/rabbitmqreceiver/factory.go @@ -41,7 +41,7 @@ func createDefaultConfig() component.Config { } } -func createMetricsReceiver(ctx context.Context, params receiver.CreateSettings, rConf component.Config, consumer consumer.Metrics) (receiver.Metrics, error) { +func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, rConf component.Config, consumer consumer.Metrics) (receiver.Metrics, error) { cfg, ok := rConf.(*Config) if !ok { return nil, errConfigNotRabbit diff --git a/receiver/rabbitmqreceiver/scraper.go b/receiver/rabbitmqreceiver/scraper.go index 7a4e69c9dbba..e0489092147f 100644 --- a/receiver/rabbitmqreceiver/scraper.go +++ b/receiver/rabbitmqreceiver/scraper.go @@ -56,7 +56,7 @@ func newScraper(logger *zap.Logger, cfg *Config, settings receiver.CreateSetting } // start starts the scraper by creating a new HTTP Client on the scraper -func (r *rabbitmqScraper) start(ctx context.Context, host component.Host) (err error) { +func (r *rabbitmqScraper) start(_ context.Context, host component.Host) (err error) { r.client, err = newClient(r.cfg, host, r.settings, r.logger) return } diff --git a/receiver/sqlserverreceiver/factory_others.go b/receiver/sqlserverreceiver/factory_others.go index ac2dca7e62f2..7a0563fa13f4 100644 --- a/receiver/sqlserverreceiver/factory_others.go +++ b/receiver/sqlserverreceiver/factory_others.go @@ -17,10 +17,10 @@ import ( // createMetricsReceiver creates a metrics receiver based on provided config. func createMetricsReceiver( - ctx context.Context, - params receiver.CreateSettings, - cfg component.Config, - consumer consumer.Metrics, + _ context.Context, + _ receiver.CreateSettings, + _ component.Config, + _ consumer.Metrics, ) (receiver.Metrics, error) { return nil, errors.New("the sqlserver receiver is only supported on Windows") } diff --git a/receiver/windowseventlogreceiver/receiver_others.go b/receiver/windowseventlogreceiver/receiver_others.go index 55e3bb0ab8d1..875682823ce9 100644 --- a/receiver/windowseventlogreceiver/receiver_others.go +++ b/receiver/windowseventlogreceiver/receiver_others.go @@ -37,9 +37,9 @@ func createDefaultConfig() component.Config { func createLogsReceiver( _ context.Context, - params receiver.CreateSettings, - cfg component.Config, - consumer consumer.Logs, + _ receiver.CreateSettings, + _ component.Config, + _ consumer.Logs, ) (receiver.Logs, error) { return nil, fmt.Errorf("windows eventlog receiver is only supported on Windows") } diff --git a/receiver/windowsperfcountersreceiver/factory_others.go b/receiver/windowsperfcountersreceiver/factory_others.go index 0476a9c24482..4bf8074e3158 100644 --- a/receiver/windowsperfcountersreceiver/factory_others.go +++ b/receiver/windowsperfcountersreceiver/factory_others.go @@ -17,10 +17,10 @@ import ( // createMetricsReceiver creates a metrics receiver based on provided config. func createMetricsReceiver( - ctx context.Context, - params receiver.CreateSettings, - cfg component.Config, - consumer consumer.Metrics, + _ context.Context, + _ receiver.CreateSettings, + _ component.Config, + _ consumer.Metrics, ) (receiver.Metrics, error) { return nil, errors.New("the windows perf counters receiver is only supported on Windows") }