Skip to content

Commit d6a0f9a

Browse files
authored
Fix comments for exported funcs/vars/consts (#2938)
Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 8235b26 commit d6a0f9a

File tree

38 files changed

+62
-68
lines changed

38 files changed

+62
-68
lines changed

component/componenttest/nop_exporter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (f *nopExporterFactory) CreateMetricsExporter(
6363
return nopExporterInstance, nil
6464
}
6565

66-
// CreateMetricsExporter implements component.ExporterFactory interface.
66+
// CreateLogsExporter implements component.ExporterFactory interface.
6767
func (f *nopExporterFactory) CreateLogsExporter(
6868
_ context.Context,
6969
_ component.ExporterCreateParams,

component/componenttest/nop_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (f *nopProcessorFactory) CreateMetricsProcessor(
6868
return nopProcessorInstance, nil
6969
}
7070

71-
// CreateMetricsProcessor implements component.ProcessorFactory interface.
71+
// CreateLogsProcessor implements component.ProcessorFactory interface.
7272
func (f *nopProcessorFactory) CreateLogsProcessor(
7373
_ context.Context,
7474
_ component.ProcessorCreateParams,

component/componenttest/nop_receiver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (f *nopReceiverFactory) CreateMetricsReceiver(
6565
return nopReceiverInstance, nil
6666
}
6767

68-
// CreateMetricsReceiver implements component.ReceiverFactory interface.
68+
// CreateLogsReceiver implements component.ReceiverFactory interface.
6969
func (f *nopReceiverFactory) CreateLogsReceiver(
7070
_ context.Context,
7171
_ component.ReceiverCreateParams,

component/host.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ type Host interface {
3838
// other components that it creates.
3939
GetFactory(kind Kind, componentType config.Type) Factory
4040

41-
// Return map of extensions. Only enabled and created extensions will be returned.
41+
// GetExtensions returns the map of extensions. Only enabled and created extensions will be returned.
4242
// Typically is used to find an extension by type or by full config name. Both cases
4343
// can be done by iterating the returned map. There are typically very few extensions
4444
// so there there is no performance implications due to iteration.
4545
GetExtensions() map[config.NamedEntity]Extension
4646

47-
// Return map of exporters. Only enabled and created exporters will be returned.
47+
// GetExporters returns the map of exporters. Only enabled and created exporters will be returned.
4848
// Typically is used to find exporters by type or by full config name. Both cases
4949
// can be done by iterating the returned map. There are typically very few exporters
5050
// so there there is no performance implications due to iteration.

config/confighttp/confighttp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ type headerRoundTripper struct {
9595
headers map[string]string
9696
}
9797

98-
// Custom RoundTrip that add headers
98+
// RoundTrip is a custom RoundTripper that adds headers to the request.
9999
func (interceptor *headerRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
100100
for k, v := range interceptor.headers {
101101
req.Header.Set(k, v)

exporter/prometheusexporter/collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func newCollector(config *Config, logger *zap.Logger) *collector {
4343
}
4444
}
4545

46-
// Collector dynamically allocates metrics, describe shoud be noop
46+
// Describe is a no-op, because the collector dynamically allocates metrics.
4747
// https://github.com/prometheus/client_golang/blob/v1.9.0/prometheus/collector.go#L28-L40
4848
func (c *collector) Describe(_ chan<- *prometheus.Desc) {}
4949

internal/goldendataset/pict_metrics_input_defs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ const (
5151
LabelsMany PICTNumPtLabels = "ManyLabels"
5252
)
5353

54-
// Enumerates the number of points on each metric.
54+
// PICTNumPtsPerMetric enum for the number of points on each metric.
5555
type PICTNumPtsPerMetric string
5656

5757
const (
5858
NumPtsPerMetricOne PICTNumPtsPerMetric = "OnePt"
5959
NumPtsPerMetricMany PICTNumPtsPerMetric = "ManyPts"
6060
)
6161

62-
// Enumerates the number of attributes on each resource.
62+
// PICTNumResourceAttrs enum for the number of attributes on each resource.
6363
type PICTNumResourceAttrs string
6464

6565
const (

internal/goldendataset/pict_tracing_input_defs.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const (
2323
TracesColumnSpans = 2
2424
)
2525

26-
// Enumerates the supported types of resource instances that can be generated.
26+
// PICTInputResource enum for the supported types of resource instances that can be generated.
2727
type PICTInputResource string
2828

2929
const (
@@ -37,7 +37,7 @@ const (
3737
ResourceExec PICTInputResource = "Exec"
3838
)
3939

40-
// Enumerates the number and kind of instrumentation library instances that can be generated.
40+
// PICTInputInstrumentationLibrary enum for the number and kind of instrumentation library instances that can be generated.
4141
type PICTInputInstrumentationLibrary string
4242

4343
const (
@@ -46,7 +46,7 @@ const (
4646
LibraryTwo PICTInputInstrumentationLibrary = "Two"
4747
)
4848

49-
// Enumerates the relative sizes of tracing spans that can be attached to an instrumentation library span instance.
49+
// PICTInputSpans enum for the relative sizes of tracing spans that can be attached to an instrumentation library span instance.
5050
type PICTInputSpans string
5151

5252
const (
@@ -79,15 +79,15 @@ const (
7979
SpansColumnStatus = 6
8080
)
8181

82-
// Enumerates the parent/child types of spans that can be generated.
82+
// PICTInputParent enum for the parent/child types of spans that can be generated.
8383
type PICTInputParent string
8484

8585
const (
8686
SpanParentRoot PICTInputParent = "Root"
8787
SpanParentChild PICTInputParent = "Child"
8888
)
8989

90-
// Enumerates the categories of tracestate values that can be generated for a span.
90+
// PICTInputTracestate enum for the categories of tracestate values that can be generated for a span.
9191
type PICTInputTracestate string
9292

9393
const (
@@ -96,7 +96,7 @@ const (
9696
TraceStateFour PICTInputTracestate = "Four"
9797
)
9898

99-
// Enumerates the span kind values that can be set for a span.
99+
// PICTInputKind enum for the span kind values that can be set for a span.
100100
type PICTInputKind string
101101

102102
const (
@@ -108,7 +108,7 @@ const (
108108
SpanKindConsumer PICTInputKind = "Consumer"
109109
)
110110

111-
// Enumerates the categories of representative attributes a generated span can be populated with.
111+
// PICTInputAttributes enum for the categories of representative attributes a generated span can be populated with.
112112
type PICTInputAttributes string
113113

114114
const (
@@ -131,7 +131,7 @@ const (
131131
SpanAttrMaxCount PICTInputAttributes = "MaxCount"
132132
)
133133

134-
// Enumerates the categories of events and/or links a generated span can be populated with.
134+
// PICTInputSpanChild enum for the categories of events and/or links a generated span can be populated with.
135135
type PICTInputSpanChild string
136136

137137
const (
@@ -142,7 +142,7 @@ const (
142142
SpanChildCountEight PICTInputSpanChild = "Eight"
143143
)
144144

145-
// Enumerates the status values a generated span can be populated with.
145+
// PICTInputStatus enum for the status values a generated span can be populated with.
146146
type PICTInputStatus string
147147

148148
const (

internal/internalconsumertest/err_or_sink_consumer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (esc *ErrOrSinkConsumer) ConsumeTraces(ctx context.Context, td pdata.Traces
4848
return esc.TracesSink.ConsumeTraces(ctx, td)
4949
}
5050

51-
// ConsumeTraces stores traces to this sink.
51+
// ConsumeMetrics stores metrics to this sink.
5252
func (esc *ErrOrSinkConsumer) ConsumeMetrics(ctx context.Context, md pdata.Metrics) error {
5353
esc.mu.Lock()
5454
defer esc.mu.Unlock()

internal/processor/filterlog/filterlog.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
"go.opentelemetry.io/collector/internal/processor/filterset"
2424
)
2525

26-
// TODO: Modify Matcher to invoke both the include and exclude properties so
27-
// calling processors will always have the same logic.
2826
// Matcher is an interface that allows matching a log record against a
2927
// configuration of a match.
28+
// TODO: Modify Matcher to invoke both the include and exclude properties so
29+
// calling processors will always have the same logic.
3030
type Matcher interface {
3131
MatchLogRecord(lr pdata.LogRecord, resource pdata.Resource, library pdata.InstrumentationLibrary) bool
3232
}

0 commit comments

Comments
 (0)