Skip to content

Commit

Permalink
[chore] Spelling receiver/l...r (#37609)
Browse files Browse the repository at this point in the history
#### Description

Fix spelling in receiver/{l...r}*

#37128 (review)

#37134 (comment)

#### Link to tracking issue

* #37128

---------

Signed-off-by: Josh Soref <[email protected]>
  • Loading branch information
jsoref authored Jan 31, 2025
1 parent 9f30afb commit 226893e
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ func (l *LibhoneyEvent) ToPTraceSpan(newSpan *ptrace.Span, alreadyUsedFields *[]
if spanName, ok := l.Data[cfg.Attributes.Name]; ok {
newSpan.SetName(spanName.(string))
}
if spanStatusMessge, ok := l.Data["status_message"]; ok {
newSpan.Status().SetMessage(spanStatusMessge.(string))
if spanStatusMessage, ok := l.Data["status_message"]; ok {
newSpan.Status().SetMessage(spanStatusMessage.(string))
}
newSpan.Status().SetCode(ptrace.StatusCodeUnset)

Expand Down
2 changes: 1 addition & 1 deletion receiver/libhoneyreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (r *libhoneyReceiver) handleEvent(resp http.ResponseWriter, req *http.Reque

dataset, err := parser.GetDatasetFromRequest(req.RequestURI)
if err != nil {
r.settings.Logger.Info("No dataset found in URL", zap.String("req.RequstURI", req.RequestURI))
r.settings.Logger.Info("No dataset found in URL", zap.String("req.RequestURI", req.RequestURI))
}

for _, p := range r.cfg.HTTP.TracesURLPaths {
Expand Down
2 changes: 1 addition & 1 deletion receiver/mongodbatlasreceiver/combined_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c *combinedLogsReceiver) Start(ctx context.Context, host component.Host) e
return errs
}

// Shutsdown the combined MongoDB Atlas Logs and Alert Receiver
// Shuts down the combined MongoDB Atlas Logs and Alert Receiver
func (c *combinedLogsReceiver) Shutdown(ctx context.Context) error {
var errs error

Expand Down
2 changes: 1 addition & 1 deletion receiver/mysqlreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (m *mySQLScraper) scrape(context.Context) (pmetric.Metrics, error) {
// collect global status metrics.
m.scrapeGlobalStats(now, errs)

// colect replicas status metrics.
// collect replicas status metrics.
m.scrapeReplicaStatusStats(now)

rb := m.mb.NewResourceBuilder()
Expand Down
2 changes: 1 addition & 1 deletion receiver/nsxtreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This receiver supports NSX-T Datacenter versions:

## Configuration

- `endpoint`: Endpoint of the NSX Manager. Must be formatted as `{scheme}://{host}:{port}`. Schems supported are `http` and `https`
- `endpoint`: Endpoint of the NSX Manager. Must be formatted as `{scheme}://{host}:{port}`. Schemes supported are `http` and `https`

- `username`: Username of the `Auditor` user

Expand Down
2 changes: 1 addition & 1 deletion receiver/nsxtreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestMetricValidation(t *testing.T) {
expectedError: errors.New("url scheme must be http or https"),
},
{
desc: "unparseable url",
desc: "unparsable url",
cfg: &Config{
ClientConfig: confighttp.ClientConfig{
Endpoint: "\x00",
Expand Down
2 changes: 1 addition & 1 deletion receiver/otelarrowreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ than the receiver's `max_connection_age_grace` setting, which causes
the exporter to cleanly shut down streams, allowing requests to
complete before the http/2 connection is forcibly closed. While the
exporter will retry data that was in-flight during an unexpected
stream shutdown, instrumentation about the telemety pipeline will show
stream shutdown, instrumentation about the telemetry pipeline will show
RPC errors when the exporter's `max_stream_lifetime` is not configured
correctly.
Expand Down
2 changes: 1 addition & 1 deletion receiver/otelarrowreceiver/internal/arrow/arrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func (id *inFlightData) anyDone(ctx context.Context) {
// data.
//
// This handles constructing an inFlightData object, which itself
// tracks everything that needs to be used by instrumention when the
// tracks everything that needs to be used by instrumentation when the
// batch finishes.
func (r *receiverStream) recvOne(streamCtx context.Context, serverStream anyStreamServer, hrcv *headerReceiver, pendingCh chan<- batchResp, method string, ac arrowRecord.ConsumerAPI) (retErr error) {
// Receive a batch corresponding with one ptrace.Traces, pmetric.Metrics,
Expand Down
2 changes: 1 addition & 1 deletion receiver/podmanreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ See [./documentation.md](./documentation.md) for full detail.

This receiver uses the official libpod Go bindings for Podman. In order to include
this receiver in your build, you'll need to make sure all non-Go dependencies are
satisfied or some features are exluded. You can use the below mentioned build tags to
satisfied or some features are excluded. You can use the below mentioned build tags to
exclude the non-Go dependencies. This receiver does not use any features enabled
by these deps so excluding these does not affect the functionality in any way.

Expand Down
8 changes: 4 additions & 4 deletions receiver/prometheusreceiver/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ undocumented metrics types, including:

* Gaugehistogram
* Info
* Statset
* Stateset

More details can be found from the
[prometheus text parser source code](https://github.com/prometheus/prometheus/blob/afdd1357e008375e693a1b4c096f81b2358cb46f/model/textparse/interface.go#L25)
Expand Down Expand Up @@ -357,12 +357,12 @@ metrics := []*metricspb.Metric{


### Gauge
Gauge, as described in the [Prometheus Metric Types Document](https://prometheus.io/docs/concepts/metric_types/#guage),
Gauge, as described in the [Prometheus Metric Types Document](https://prometheus.io/docs/concepts/metric_types/#gauge),
> is a metric that represents a single numerical value that can arbitrarily go up and down
```
# HELP gauge_test some test gauges.
# TYPE gauge_test gague
# TYPE gauge_test gauge
gauge_test{id="1",foo="bar"} 1.0
gauge_test{id="2",foo=""} 2.0
Expand Down Expand Up @@ -555,7 +555,7 @@ bucket that, bucket counts from Prometheus are cumulative, to transform this
into OpenTelemetry format, one needs to apply the following formula:

```
CurrentOCBucketVlaue = CurrentPrometheusBucketValue - PrevPrometheusBucketValue
CurrentOCBucketValue = CurrentPrometheusBucketValue - PrevPrometheusBucketValue
```

OpenTelemetry does not use `+inf` as an explicit bound, one needs to remove it to generate
Expand Down
2 changes: 1 addition & 1 deletion receiver/prometheusreceiver/internal/metrics_adjuster.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (jm *JobsMap) maybeGC() {

func (jm *JobsMap) get(job, instance string) *timeseriesMap {
sig := job + ":" + instance
// a read locke is taken here as we will not need to modify jobsMap if the target timeseriesMap is available.
// a read lock is taken here as we will not need to modify jobsMap if the target timeseriesMap is available.
jm.RLock()
tsm, ok := jm.jobsMap[sig]
jm.RUnlock()
Expand Down
2 changes: 1 addition & 1 deletion receiver/prometheusreceiver/internal/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ func TestMetricBuilderHistogram(t *testing.T) {

for _, tt := range tests {
for _, enableNativeHistograms := range []bool{true, false} {
// None of the histograms above have native histogram versions, so enabling native hisotgrams has no effect.
// None of the histograms above have native histogram versions, so enabling native histograms has no effect.
t.Run(fmt.Sprintf("%s/enableNativeHistograms=%v", tt.name, enableNativeHistograms), func(t *testing.T) {
tt.run(t, enableNativeHistograms)
})
Expand Down
2 changes: 1 addition & 1 deletion receiver/prometheusreceiver/internal/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestConvToMetricType(t *testing.T) {
wantMonotonic: false,
},
{
name: "model.metric_gauge_hostogram",
name: "model.metric_gauge_histogram",
mtype: model.MetricTypeGaugeHistogram,
want: pmetric.MetricTypeEmpty,
wantMonotonic: false,
Expand Down
16 changes: 8 additions & 8 deletions receiver/prometheusremotewritereceiver/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,32 +77,32 @@ func TestHandlePRWContentTypeNegotiation(t *testing.T) {
for _, tc := range []struct {
name string
contentType string
extectedCode int
expectedCode int
}{
{
name: "no content type",
contentType: "",
extectedCode: http.StatusUnsupportedMediaType,
expectedCode: http.StatusUnsupportedMediaType,
},
{
name: "unsupported content type",
contentType: "application/json",
extectedCode: http.StatusUnsupportedMediaType,
expectedCode: http.StatusUnsupportedMediaType,
},
{
name: "x-protobuf/no proto parameter",
contentType: "application/x-protobuf",
extectedCode: http.StatusUnsupportedMediaType,
expectedCode: http.StatusUnsupportedMediaType,
},
{
name: "x-protobuf/v1 proto parameter",
contentType: fmt.Sprintf("application/x-protobuf;proto=%s", promconfig.RemoteWriteProtoMsgV1),
extectedCode: http.StatusUnsupportedMediaType,
expectedCode: http.StatusUnsupportedMediaType,
},
{
name: "x-protobuf/v2 proto parameter",
contentType: fmt.Sprintf("application/x-protobuf;proto=%s", promconfig.RemoteWriteProtoMsgV2),
extectedCode: http.StatusNoContent,
expectedCode: http.StatusNoContent,
},
} {
t.Run(tc.name, func(t *testing.T) {
Expand All @@ -121,8 +121,8 @@ func TestHandlePRWContentTypeNegotiation(t *testing.T) {
resp, err := http.DefaultClient.Do(req)
assert.NoError(t, err)

assert.Equal(t, tc.extectedCode, resp.StatusCode)
if tc.extectedCode == http.StatusNoContent { // We went until the end
assert.Equal(t, tc.expectedCode, resp.StatusCode)
if tc.expectedCode == http.StatusNoContent { // We went until the end
assert.NotEmpty(t, resp.Header.Get("X-Prometheus-Remote-Write-Samples-Written"))
assert.NotEmpty(t, resp.Header.Get("X-Prometheus-Remote-Write-Histograms-Written"))
assert.NotEmpty(t, resp.Header.Get("X-Prometheus-Remote-Write-Exemplars-Written"))
Expand Down
12 changes: 6 additions & 6 deletions receiver/purefareceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ func (r *purefaReceiver) Start(ctx context.Context, compHost component.Host) err
fact := prometheusreceiver.NewFactory()
scrapeCfgs := []*config.ScrapeConfig{}

commomLabel := model.LabelSet{
commonLabel := model.LabelSet{
"environment": model.LabelValue(r.cfg.Env),
"host": model.LabelValue(r.cfg.ArrayName),
"fa_array_name": model.LabelValue(r.cfg.ArrayName),
}

// Extracting environment & fa_array_name from commonLabel
deploymentEnv := commomLabel["environment"]
ArrayName := commomLabel["fa_array_name"]
deploymentEnv := commonLabel["environment"]
ArrayName := commonLabel["fa_array_name"]

labelSet := model.LabelSet{
"environment": deploymentEnv,
"fa_array_name": ArrayName,
}

arrScraper := internal.NewScraper(ctx, internal.ScraperTypeArray, r.cfg.Endpoint, r.cfg.Namespace, r.cfg.TLSSetting, r.cfg.Array, r.cfg.Settings.ReloadIntervals.Array, commomLabel)
arrScraper := internal.NewScraper(ctx, internal.ScraperTypeArray, r.cfg.Endpoint, r.cfg.Namespace, r.cfg.TLSSetting, r.cfg.Array, r.cfg.Settings.ReloadIntervals.Array, commonLabel)
if scCfgs, err := arrScraper.ToPrometheusReceiverConfig(compHost, fact); err == nil {
scrapeCfgs = append(scrapeCfgs, scCfgs...)
} else {
Expand All @@ -67,14 +67,14 @@ func (r *purefaReceiver) Start(ctx context.Context, compHost component.Host) err
return err
}

directoriesScraper := internal.NewScraper(ctx, internal.ScraperTypeDirectories, r.cfg.Endpoint, r.cfg.Namespace, r.cfg.TLSSetting, r.cfg.Directories, r.cfg.Settings.ReloadIntervals.Directories, commomLabel)
directoriesScraper := internal.NewScraper(ctx, internal.ScraperTypeDirectories, r.cfg.Endpoint, r.cfg.Namespace, r.cfg.TLSSetting, r.cfg.Directories, r.cfg.Settings.ReloadIntervals.Directories, commonLabel)
if scCfgs, err := directoriesScraper.ToPrometheusReceiverConfig(compHost, fact); err == nil {
scrapeCfgs = append(scrapeCfgs, scCfgs...)
} else {
return err
}

podsScraper := internal.NewScraper(ctx, internal.ScraperTypePods, r.cfg.Endpoint, r.cfg.Namespace, r.cfg.TLSSetting, r.cfg.Pods, r.cfg.Settings.ReloadIntervals.Pods, commomLabel)
podsScraper := internal.NewScraper(ctx, internal.ScraperTypePods, r.cfg.Endpoint, r.cfg.Namespace, r.cfg.TLSSetting, r.cfg.Pods, r.cfg.Settings.ReloadIntervals.Pods, commonLabel)
if scCfgs, err := podsScraper.ToPrometheusReceiverConfig(compHost, fact); err == nil {
scrapeCfgs = append(scrapeCfgs, scCfgs...)
} else {
Expand Down
8 changes: 4 additions & 4 deletions receiver/purefbreceiver/metrics_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@ func (r *purefbMetricsReceiver) Start(ctx context.Context, compHost component.Ho
fact := prometheusreceiver.NewFactory()
scrapeCfgs := []*config.ScrapeConfig{}

commomLabel := model.LabelSet{
commonLabel := model.LabelSet{
"env": model.LabelValue(r.cfg.Env),
"fb_array_name": model.LabelValue(r.cfg.Endpoint),
"host": model.LabelValue(r.cfg.Endpoint),
}

arrScraper := internal.NewScraper(ctx, internal.ScraperTypeArray, r.cfg.Endpoint, r.cfg.Arrays, r.cfg.Settings.ReloadIntervals.Array, commomLabel)
arrScraper := internal.NewScraper(ctx, internal.ScraperTypeArray, r.cfg.Endpoint, r.cfg.Arrays, r.cfg.Settings.ReloadIntervals.Array, commonLabel)
if scCfgs, err := arrScraper.ToPrometheusReceiverConfig(compHost, fact); err == nil {
scrapeCfgs = append(scrapeCfgs, scCfgs...)
} else {
return err
}

clientsScraper := internal.NewScraper(ctx, internal.ScraperTypeClients, r.cfg.Endpoint, r.cfg.Clients, r.cfg.Settings.ReloadIntervals.Clients, commomLabel)
clientsScraper := internal.NewScraper(ctx, internal.ScraperTypeClients, r.cfg.Endpoint, r.cfg.Clients, r.cfg.Settings.ReloadIntervals.Clients, commonLabel)
if scCfgs, err := clientsScraper.ToPrometheusReceiverConfig(compHost, fact); err == nil {
scrapeCfgs = append(scrapeCfgs, scCfgs...)
} else {
return err
}

usageScraper := internal.NewScraper(ctx, internal.ScraperTypeUsage, r.cfg.Endpoint, r.cfg.Usage, r.cfg.Settings.ReloadIntervals.Usage, commomLabel)
usageScraper := internal.NewScraper(ctx, internal.ScraperTypeUsage, r.cfg.Endpoint, r.cfg.Usage, r.cfg.Settings.ReloadIntervals.Usage, commonLabel)
if scCfgs, err := usageScraper.ToPrometheusReceiverConfig(compHost, fact); err == nil {
scrapeCfgs = append(scrapeCfgs, scCfgs...)
} else {
Expand Down
6 changes: 3 additions & 3 deletions receiver/receivercreator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ receiver_creator/metrics:
# ignore_receivers: []
```

Find bellow the supported annotations that user can define to automatically enable receivers to start
See below for the supported annotations that user can define to automatically enable receivers to start
collecting metrics and logs signals from the target Pods/containers.

### Supported metrics annotations
Expand Down Expand Up @@ -506,7 +506,7 @@ io.opentelemetry.discovery.metrics.80/config: |
where `80` is the port that the target container exposes.

If a Pod is annotated with both container level hints and pod level hints the container level hints have priority and
the Pod level hints are used as a fallback (see detailed example bellow).
the Pod level hints are used as a fallback (see detailed example below).

The current implementation relies on the implementation of `k8sobserver` extension and specifically
the [pod_endpoint](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.111.0/extension/observer/k8sobserver/pod_endpoint.go).
Expand Down Expand Up @@ -572,7 +572,7 @@ io.opentelemetry.discovery.logs.busybox/config: |
where `busybox` is the name of the target container.

If a Pod is annotated with both container level hints and pod level hints the container level hints have priority and
the Pod level hints are used as a fallback (see detailed example bellow).
the Pod level hints are used as a fallback (see detailed example below).

The current implementation relies on the implementation of `k8sobserver` extension and specifically
the [pod_endpoint](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.111.0/extension/observer/k8sobserver/pod_endpoint.go).
Expand Down
4 changes: 2 additions & 2 deletions receiver/receivercreator/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,14 @@ func validateEndpoint(endpoint, defaultEndpoint string) error {
if uri == nil {
u, err := url.Parse("http://" + endpoint)
if err != nil {
return fmt.Errorf("could not parse enpoint")
return fmt.Errorf("could not parse endpoint")
}
uri = u
}

// configured endpoint should include the target Pod's endpoint
if uri.Host != defaultEndpoint {
return fmt.Errorf("configured enpoint should include target Pod's endpoint")
return fmt.Errorf("configured endpoint should include target Pod's endpoint")
}
return nil
}
2 changes: 1 addition & 1 deletion receiver/redisreceiver/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestIntegrationV6(t *testing.T) {
}

func TestIntegrationV7Cluster(t *testing.T) {
t.Skip("Skipping due to flakieness, possibly related to https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30411")
t.Skip("Skipping due to flakiness, possibly related to https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30411")
scraperinttest.NewIntegrationTest(
NewFactory(),
scraperinttest.WithContainerRequest(testcontainers.ContainerRequest{
Expand Down
2 changes: 1 addition & 1 deletion receiver/redisreceiver/redis_scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (rs *redisScraper) recordCmdMetrics(ts pcommon.Timestamp, inf info) {
}
}

// recordCmdStatsMetrics records metrics for a particlar Redis command.
// recordCmdStatsMetrics records metrics for a particular Redis command.
// Only 'calls' and 'usec' are recorded at the moment.
// 'cmd' is the Redis command, 'val' is the values string (e.g. "calls=1685,usec=6032,usec_per_call=3.58,rejected_calls=0,failed_calls=0").
func (rs *redisScraper) recordCmdStatsMetrics(ts pcommon.Timestamp, cmd, val string) {
Expand Down
2 changes: 1 addition & 1 deletion receiver/vcenterreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestConfigValidation(t *testing.T) {
expectedErr: errors.New("url scheme must be http or https"),
},
{
desc: "unparseable URL",
desc: "unparsable URL",
cfg: Config{
Endpoint: "h" + string(rune(0x7f)),
ClientConfig: configtls.ClientConfig{},
Expand Down

0 comments on commit 226893e

Please sign in to comment.