Skip to content

Commit

Permalink
[chore] Spelling processor (#37130)
Browse files Browse the repository at this point in the history
#### Description

Fix spelling in processor/

#37128 (review)

#### Link to tracking issue

* #37128

---------

Signed-off-by: Josh Soref <[email protected]>
  • Loading branch information
jsoref authored Jan 10, 2025
1 parent 4d17daf commit f6f4d48
Show file tree
Hide file tree
Showing 54 changed files with 138 additions and 139 deletions.
2 changes: 1 addition & 1 deletion processor/attributesprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func TestFactory_CreateMetrics(t *testing.T) {
{Key: "fake_key", Action: attraction.UPSERT},
}

// Upsert should fail on non-existent key
// Upsert should fail on nonexistent key
mp, err = factory.CreateMetrics(context.Background(), processortest.NewNopSettings(), cfg, consumertest.NewNop())
require.Nil(t, mp)
require.Error(t, err)
Expand Down
2 changes: 1 addition & 1 deletion processor/attributesprocessor/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ attributes/regex_insert:
# http_path: path
# http_query_params=queryParam1=value1,queryParam2=value2
# http.url value does NOT change.
# Note: Similar to the Span Procesor, if a target key already exists,
# Note: Similar to the Span Processor, if a target key already exists,
# it will be updated.
- key: "http.url"
pattern: ^(?P<http_protocol>.*):\/\/(?P<http_domain>.*)\/(?P<http_path>.*)(\?|\&)(?P<http_query_params>.*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestMetricTracker_Convert(t *testing.T) {
future := time.Now().Add(1 * time.Hour)

keepSubsequentTest := subTest{
name: "keep subsequet value",
name: "keep subsequent value",
value: ValuePoint{
ObservedTimestamp: pcommon.NewTimestampFromTime(future.Add(time.Minute)),
FloatValue: 225,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func Downscale(bs Buckets, from, to Scale) {
case from < to:
// because even distribution within the buckets cannot be assumed, it is
// not possible to correctly upscale (split) buckets.
// any attempt to do so would yield erronous data.
// any attempt to do so would yield erroneous data.
panic(fmt.Sprintf("cannot upscale without introducing error (%d -> %d)", from, to))
}

Expand Down Expand Up @@ -107,7 +107,7 @@ func Collapse(bs Buckets) {
// zero the excess area. its not needed to represent the observation
// anymore, but kept for two reasons:
// 1. future observations may need it, no need to re-alloc then if kept
// 2. [pcommon.Uint64Slice] can not, in fact, be sliced, so getting rid
// 2. [pcommon.Uint64Slice] cannot, in fact, be sliced, so getting rid
// of it would alloc ¯\_(ツ)_/¯
for i := size; i < counts.Len(); i++ {
counts.SetAt(i, 0)
Expand Down
4 changes: 2 additions & 2 deletions processor/filterprocessor/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (fmp *filterMetricProcessor) processMetrics(ctx context.Context, md pmetric
errors = multierr.Append(errors, fmp.handleHistogramDataPoints(ctx, metric.Histogram().DataPoints(), metric, smetrics.Metrics(), scope, resource))
return metric.Histogram().DataPoints().Len() == 0
case pmetric.MetricTypeExponentialHistogram:
errors = multierr.Append(errors, fmp.handleExponetialHistogramDataPoints(ctx, metric.ExponentialHistogram().DataPoints(), metric, smetrics.Metrics(), scope, resource))
errors = multierr.Append(errors, fmp.handleExponentialHistogramDataPoints(ctx, metric.ExponentialHistogram().DataPoints(), metric, smetrics.Metrics(), scope, resource))
return metric.ExponentialHistogram().DataPoints().Len() == 0
case pmetric.MetricTypeSummary:
errors = multierr.Append(errors, fmp.handleSummaryDataPoints(ctx, metric.Summary().DataPoints(), metric, smetrics.Metrics(), scope, resource))
Expand Down Expand Up @@ -283,7 +283,7 @@ func (fmp *filterMetricProcessor) handleHistogramDataPoints(ctx context.Context,
return errors
}

func (fmp *filterMetricProcessor) handleExponetialHistogramDataPoints(ctx context.Context, dps pmetric.ExponentialHistogramDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error {
func (fmp *filterMetricProcessor) handleExponentialHistogramDataPoints(ctx context.Context, dps pmetric.ExponentialHistogramDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error {
var errors error
dps.RemoveIf(func(datapoint pmetric.ExponentialHistogramDataPoint) bool {
skip, err := fmp.skipDataPointExpr.Eval(ctx, ottldatapoint.NewTransformContext(datapoint, metric, metrics, is, resource, pmetric.NewScopeMetrics(), pmetric.NewResourceMetrics()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (g *maxMindProvider) Location(_ context.Context, ipAddress net.IP) (attribu
}
}

// cityAttributes returns a list of key-values containing geographical metadata associated to the provided IP. The key names are populated using the internal geo IP conventions package. If the an invalid or nil IP is provided, an error is returned.
// cityAttributes returns a list of key-values containing geographical metadata associated to the provided IP. The key names are populated using the internal geo IP conventions package. If an invalid or nil IP is provided, an error is returned.
func (g *maxMindProvider) cityAttributes(ipAddress net.IP) (*[]attribute.KeyValue, error) {
attributes := make([]attribute.KeyValue, 0, 11)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/maxmind/MaxMind-DB/pkg/writer"
)

// GenerateLocalDB generates *.mmdb databases files given a source directory data. It uses a the writer functionality provided by MaxMind-Db/pkg/writer
// GenerateLocalDB generates *.mmdb databases files given a source directory data. It uses the writer functionality provided by MaxMind-Db/pkg/writer
func GenerateLocalDB(t *testing.T, sourceData string) string {
tmpDir, err := os.MkdirTemp("", "")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion processor/groupbytraceprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The following metrics are recorded by this processor:

A healthy system would have the same value for the metric `otelcol_processor_groupbytrace_spans_released` and for three events under `otelcol_processor_groupbytrace_event_latency_bucket`: `onTraceExpired`, `onTraceRemoved` and `onTraceReleased`.

The metric `otelcol_processor_groupbytrace_event_latency_bucket` is a bucket and shows how long each event took to be processed in miliseconds. In most cases, it should take less than 5ms for an event to be processed, but it might be the case where an event could take 10ms. Higher latencies are possible, but it should never really reach the last item, representing 1s. Events taking more than 1s are killed automatically, and if you have multiple items in this bucket, it might indicate a bug in the software.
The metric `otelcol_processor_groupbytrace_event_latency_bucket` is a bucket and shows how long each event took to be processed in milliseconds. In most cases, it should take less than 5ms for an event to be processed, but it might be the case where an event could take 10ms. Higher latencies are possible, but it should never really reach the last item, representing 1s. Events taking more than 1s are killed automatically, and if you have multiple items in this bucket, it might indicate a bug in the software.

Most metrics are updated when the events occur, except for the following ones, which are updated periodically:
* `otelcol_processor_groupbytrace_num_events_in_queue`
Expand Down
30 changes: 15 additions & 15 deletions processor/intervalprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,29 @@ intervalprocessor:
The following sum metrics come into the processor to be handled
| Timestamp | Metric Name | Aggregation Temporarility | Attributes | Value |
| --------- | ------------ | ------------------------- | ----------------- | ----: |
| 0 | test_metric | Cumulative | labelA: foo | 4.0 |
| 2 | test_metric | Cumulative | labelA: bar | 3.1 |
| 4 | other_metric | Delta | fruitType: orange | 77.4 |
| 6 | test_metric | Cumulative | labelA: foo | 8.2 |
| 8 | test_metric | Cumulative | labelA: foo | 12.8 |
| 10 | test_metric | Cumulative | labelA: bar | 6.4 |
| Timestamp | Metric Name | Aggregation Temporality | Attributes | Value |
| --------- | ------------ | ----------------------- | ----------------- | ----: |
| 0 | test_metric | Cumulative | labelA: foo | 4.0 |
| 2 | test_metric | Cumulative | labelA: bar | 3.1 |
| 4 | other_metric | Delta | fruitType: orange | 77.4 |
| 6 | test_metric | Cumulative | labelA: foo | 8.2 |
| 8 | test_metric | Cumulative | labelA: foo | 12.8 |
| 10 | test_metric | Cumulative | labelA: bar | 6.4 |
The processor would immediately pass the following metrics to the next processor in the chain
| Timestamp | Metric Name | Aggregation Temporarility | Attributes | Value |
| --------- | ------------ | ------------------------- | ----------------- | ----: |
| 4 | other_metric | Delta | fruitType: orange | 77.4 |
| Timestamp | Metric Name | Aggregation Temporality | Attributes | Value |
| --------- | ------------ | ----------------------- | ----------------- | ----: |
| 4 | other_metric | Delta | fruitType: orange | 77.4 |
Because it's a Delta metric.
At the next `interval` (15s by default), the processor would pass the following metrics to the next processor in the chain

| Timestamp | Metric Name | Aggregation Temporarility | Attributes | Value |
| --------- | ----------- | ------------------------- | ----------- | ----: |
| 8 | test_metric | Cumulative | labelA: foo | 12.8 |
| 10 | test_metric | Cumulative | labelA: bar | 6.4 |
| Timestamp | Metric Name | Aggregation Temporality | Attributes | Value |
| --------- | ----------- | ----------------------- | ----------- | ----: |
| 8 | test_metric | Cumulative | labelA: foo | 12.8 |
| 10 | test_metric | Cumulative | labelA: bar | 6.4 |

> [!IMPORTANT]
> After exporting, any internal state is cleared. So if no new metrics come in, the next interval will export nothing.
6 changes: 3 additions & 3 deletions processor/k8sattributesprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ k8sattributes:
filter:
namespace: <WORKLOAD_NAMESPACE>
```
With the namespace filter set, the processor will only look up pods and replicasets in the selected namespace. Note that with just a role binding, the processor can not query metadata such as labels and annotations from k8s `nodes` and `namespaces` which are cluster-scoped objects. This also means that the processor can not set the value for `k8s.cluster.uid` attribute if enabled, since the `k8s.cluster.uid` attribute is set to the uid of the namespace `kube-system` which is not queryable with namespaced rbac.
With the namespace filter set, the processor will only look up pods and replicasets in the selected namespace. Note that with just a role binding, the processor cannot query metadata such as labels and annotations from k8s `nodes` and `namespaces` which are cluster-scoped objects. This also means that the processor cannot set the value for `k8s.cluster.uid` attribute if enabled, since the `k8s.cluster.uid` attribute is set to the uid of the namespace `kube-system` which is not queryable with namespaced rbac.

Example `Role` and `RoleBinding` to create in the namespace being watched.
```yaml
Expand Down Expand Up @@ -389,7 +389,7 @@ When running as an agent, the processor detects IP addresses of pods sending spa
and uses this information to extract metadata from pods. When running as an agent, it is important to apply
a discovery filter so that the processor only discovers pods from the same host that it is running on. Not using
such a filter can result in unnecessary resource usage especially on very large clusters. Once the filter is applied,
each processor will only query the k8s API for pods running on it's own node.
each processor will only query the k8s API for pods running on its own node.

Node filter can be applied by setting the `filter.node` config option to the name of a k8s node. While this works
as expected, it cannot be used to automatically filter pods by the same node that the processor is running on in
Expand Down Expand Up @@ -498,7 +498,7 @@ The following config with the feature gate set will lead to validation error:

#### Migration

Deprecation of the `extract.annotations.regex` and `extract.labels.regex` fields means that it is recommended to use the `ExtractPatterns` function from the transform processor instead. To convert your current configuration please check the `ExtractPatterns` function [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl/ottlfuncs#extractpatterns). You should use the `pattern` parameter of `ExtractPatterns` instead of using the the `extract.annotations.regex` and `extract.labels.regex` fields.
Deprecation of the `extract.annotations.regex` and `extract.labels.regex` fields means that it is recommended to use the `ExtractPatterns` function from the transform processor instead. To convert your current configuration please check the `ExtractPatterns` function [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl/ottlfuncs#extractpatterns). You should use the `pattern` parameter of `ExtractPatterns` instead of using the `extract.annotations.regex` and `extract.labels.regex` fields.

##### Example

Expand Down
2 changes: 1 addition & 1 deletion processor/k8sattributesprocessor/internal/kube/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (c *WatchClient) Start() error {
return nil
}

// Stop signals the the k8s watcher/informer to stop watching for new events.
// Stop signals the k8s watcher/informer to stop watching for new events.
func (c *WatchClient) Stop() {
close(c.stopCh)
}
Expand Down
10 changes: 5 additions & 5 deletions processor/k8sattributesprocessor/internal/kube/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func TestPodDelete(t *testing.T) {
// delete empty IP pod
c.handlePodDelete(&api_v1.Pod{})

// delete non-existent IP
// delete nonexistent IP
c.deleteQueue = c.deleteQueue[:0]
pod := &api_v1.Pod{}
pod.Status.PodIP = "9.9.9.9"
Expand Down Expand Up @@ -494,14 +494,14 @@ func TestNamespaceDelete(t *testing.T) {
// delete empty namespace
c.handleNamespaceDelete(&api_v1.Namespace{})

// delete non-existent namespace
// delete nonexistent namespace
namespace := &api_v1.Namespace{}
namespace.Name = "namespaceC"
c.handleNamespaceDelete(namespace)
assert.Len(t, c.Namespaces, 2)
got := c.Namespaces["namespaceA"]
assert.Equal(t, "namespaceA", got.Name)
// delete non-existent namespace when DeletedFinalStateUnknown
// delete nonexistent namespace when DeletedFinalStateUnknown
c.handleNamespaceDelete(cache.DeletedFinalStateUnknown{Obj: namespace})
assert.Len(t, c.Namespaces, 2)
got = c.Namespaces["namespaceA"]
Expand Down Expand Up @@ -529,14 +529,14 @@ func TestNodeDelete(t *testing.T) {
// delete empty node
c.handleNodeDelete(&api_v1.Node{})

// delete non-existent node
// delete nonexistent node
node := &api_v1.Node{}
node.Name = "nodeC"
c.handleNodeDelete(node)
assert.Len(t, c.Nodes, 2)
got := c.Nodes["nodeA"]
assert.Equal(t, "nodeA", got.Name)
// delete non-existent namespace when DeletedFinalStateUnknown
// delete nonexistent namespace when DeletedFinalStateUnknown
c.handleNodeDelete(cache.DeletedFinalStateUnknown{Obj: node})
assert.Len(t, c.Nodes, 2)
got = c.Nodes["nodeA"]
Expand Down
2 changes: 1 addition & 1 deletion processor/k8sattributesprocessor/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ func TestProcessorAddContainerAttributes(t *testing.T) {
}
}

func TestProcessorPicksUpPassthoughPodIp(t *testing.T) {
func TestProcessorPicksUpPassthroughPodIp(t *testing.T) {
m := newMultiTest(
t,
NewFactory().CreateDefaultConfig(),
Expand Down
2 changes: 1 addition & 1 deletion processor/k8sattributesprocessor/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ k8sattributes/4:
auth_type: "kubeConfig"
extract:
metadata:
# the following metadata field has been depracated
# the following metadata field has been deprecated
- k8s.cluster.name

k8sattributes/too_many_sources:
Expand Down
2 changes: 1 addition & 1 deletion processor/logdedupprocessor/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestValidateConfig(t *testing.T) {
expectedErr: errors.New("an excludefield must start with"),
},
{
desc: "invalid duplice exclude field",
desc: "invalid duplicate exclude field",
cfg: &Config{
LogCountAttribute: defaultLogCountAttribute,
Interval: defaultInterval,
Expand Down
2 changes: 1 addition & 1 deletion processor/logdedupprocessor/field_remover.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
// fieldDelimiter is the delimiter used to split a field key into its parts.
fieldDelimiter = "."

// fieldEscapeKeyReplacement is the string used to temporarily replace escaped delimters while splitting a field key.
// fieldEscapeKeyReplacement is the string used to temporarily replace escaped delimiters while splitting a field key.
fieldEscapeKeyReplacement = "{TEMP_REPLACE}"
)

Expand Down
2 changes: 1 addition & 1 deletion processor/logdedupprocessor/field_remover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestRemoveFields(t *testing.T) {
nestedAttrMap := logRecord.Attributes().PutEmptyMap("nested")
nestedAttrMap.PutInt("int", 2)

// Expected attribut map
// Expected attribute map
expectedAttrsMap := pcommon.NewMap()
expectedAttrsMap.PutStr("str", "attr str")
expectedAttrHash := pdatautil.MapHash(expectedAttrsMap)
Expand Down
2 changes: 1 addition & 1 deletion processor/metricsgenerationprocessor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type GenerationType string

const (

// Generates a new metric applying an arithmatic operation with two operands
// Generates a new metric applying an arithmetic operation with two operands
calculate GenerationType = "calculate"

// Generates a new metric scaling the value of s given metric with a provided constant
Expand Down
6 changes: 3 additions & 3 deletions processor/metricstransformprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ operations:
```yaml
# Group metrics from one single ResourceMetrics and report them as multiple ResourceMetrics.
#
# ex: Consider pod and container metrics collected from Kubernetes. Both the metrics are recorded under under one ResourceMetric
# ex: Consider pod and container metrics collected from Kubernetes. Both the metrics are recorded under one ResourceMetric
# applying this transformation will result in two separate ResourceMetric packets with corresponding resource labels in the resource headers
#
# instead of regular $ use double dollar $$. Because $ is treated as a special character.
Expand All @@ -320,11 +320,11 @@ operations:
- include: ^k8s\.pod\.(.*)$$
match_type: regexp
action: group
group_resource_labels: {"resouce.type": "k8s.pod", "source": "kubelet"}
group_resource_labels: {"resource.type": "k8s.pod", "source": "kubelet"}
- include: ^container\.(.*)$$
match_type: regexp
action: group
group_resource_labels: {"resouce.type": "container", "source": "kubelet"}
group_resource_labels: {"resource.type": "container", "source": "kubelet"}
```

### Metric Transform Processor vs. [Attributes Processor for Metrics](../attributesprocessor)
Expand Down
8 changes: 4 additions & 4 deletions processor/metricstransformprocessor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
// newNameFieldName is the mapstructure field name for NewName field
newNameFieldName = "new_name"

// groupResourceLabelsFieldName is the mapstructure field name for GroupResouceLabels field
// groupResourceLabelsFieldName is the mapstructure field name for GroupResourceLabels field
groupResourceLabelsFieldName = "group_resource_labels"

// aggregationTypeFieldName is the mapstructure field name for aggregationType field
Expand Down Expand Up @@ -69,7 +69,7 @@ type transform struct {
// REQUIRED only if Action is INSERT.
NewName string `mapstructure:"new_name"`

// GroupResourceLabels specifes resource labels that will be appended to this group's new ResourceMetrics message
// GroupResourceLabels specifies resource labels that will be appended to this group's new ResourceMetrics message
// REQUIRED only if Action is GROUP
GroupResourceLabels map[string]string `mapstructure:"group_resource_labels"`

Expand Down Expand Up @@ -152,7 +152,7 @@ const (
// Combine combines multiple metrics into a single metric.
Combine ConfigAction = "combine"

// Group groups mutiple metrics matching the predicate into multiple ResourceMetrics messages
// Group groups multiple metrics matching the predicate into multiple ResourceMetrics messages
Group ConfigAction = "group"
)

Expand All @@ -168,7 +168,7 @@ func (ca ConfigAction) isValid() bool {
return false
}

// operationAction is the enum to capture the thress types of actions to perform for an operation.
// operationAction is the enum to capture the types of actions to perform for an operation.
type operationAction string

const (
Expand Down
Loading

0 comments on commit f6f4d48

Please sign in to comment.