Skip to content

Commit 28cc668

Browse files
authored
Merge branch 'main' into s3exporter-canned-acl
2 parents 61cb3ac + 4037e57 commit 28cc668

File tree

34 files changed

+152
-27
lines changed

34 files changed

+152
-27
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: k8sattributes
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Fix bug where `Filters.Labels` failed with when the `exists` or `not-exists` operations were used.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [37913]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

CHANGELOG-API.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,9 @@ If you are looking for user-facing changes, check out [CHANGELOG.md](./CHANGELOG
514514
### 🚩 Deprecations 🚩
515515

516516
- `pkg/stanza`: Deprecate 'helper.EncodingConfig' and 'helper.NewEncodingConfig' (#25846)
517-
- `pkg/stanza`: Deprecate encoding related elements of helper pacakge, in favor of new decoder package (#26019)
517+
- `pkg/stanza`: Deprecate encoding related elements of helper package, in favor of new decoder package (#26019)
518518
Includes the following deprecations | - Decoder - NewDecoder - LookupEncoding - IsNop
519-
- `pkg/stanza`: Deprecate tokenization related elements of helper pacakge, in favor of new tokenize package (#25914)
519+
- `pkg/stanza`: Deprecate tokenization related elements of helper package, in favor of new tokenize package (#25914)
520520
Includes the following deprecations | - Flusher - FlusherConfig - NewFlusherConfig - Multiline - MultilineConfig - NewMultilineConfig - NewLineStartSplitFunc - NewLineEndSplitFunc - NewNewlineSplitFunc - Splitter - SplitterConfig - NewSplitterConfig - SplitNone
521521

522522
### 💡 Enhancements 💡

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ If you are looking for developer-facing changes, check out [CHANGELOG-API.md](./
110110
- `otlpjsonfilereceiver`: Include file attributes and append it to the log record (#36641)
111111
- `routingconnector`: The connector splits the original payload so that it may be emitted in parts to each route. (#37390)
112112
- `pkg/stanza`: Fix default source identifier in recombine operator (#37210)
113-
Its defualt value is now aligned with the semantic conventions: `attributes["log.file.path"]`
113+
Its default value is now aligned with the semantic conventions: `attributes["log.file.path"]`
114114

115115
- `tailsamplingprocessor`: Fixed sampling decision metrics `otelcol_processor_tail_sampling_sampling_trace_dropped_too_early` and `otelcol_processor_tail_sampling_sampling_policy_evaluation_error_total`, these were sometimes overcounted. (#37212)
116116
As a result of this change non-zero values of `otelcol_processor_tail_sampling_sampling_trace_dropped_too_early`
@@ -789,7 +789,7 @@ arrow.waiter_limit -> admission.waiter_limit
789789

790790
### 🚀 New components 🚀
791791

792-
- `azurelogs_translater`: Adds a new translater that converts Azure EventHub logs to OpenTelemetry logs used by the Azure Events Hub receiver. (#39704)
792+
- `azurelogs_translator`: Adds a new translator that converts Azure EventHub logs to OpenTelemetry logs used by the Azure Events Hub receiver. (#39704)
793793
- `dorisexporter`: logs implementation (#33479)
794794
- `dorisexporter`: traces implementation (#33479)
795795

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: pkg
23
codeowners:
34
active: [atoulme, dmitryax]

pkg/batchpersignal/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: pkg
23
codeowners:
34
active: [jpkrohling]

pkg/core/xidutils/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: pkg
23
codeowners:
34
active: [odubajDT]
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
status:
2+
class: pkg
23
codeowners:
34
active: [dmitryax]
45
emeritus: [rmfitzpatrick]

pkg/pdatatest/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: pkg
23
codeowners:
34
active: [djaglowski, fatsheep9146]

pkg/pdatautil/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: pkg
23
codeowners:
34
active: [dmitryax]

pkg/resourcetotelemetry/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: pkg
23
codeowners:
34
active: [mx-psi]

pkg/stanza/docs/operators/key_value_parser.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The `key_value_parser` operator parses the string-type field selected by `parse_
88
| --- | --- | --- |
99
| `id` | `key_value_parser` | A unique identifier for the operator. |
1010
| `delimiter` | `=` | The delimiter used for splitting a value into a key value pair. |
11-
| `pair_delimiter` | | The delimiter used for seperating key value pairs, defaults to whitespace. |
11+
| `pair_delimiter` | | The delimiter used for separating key value pairs, defaults to whitespace. |
1212
| `output` | Next in pipeline | The connected operator(s) that will receive all outbound entries. |
1313
| `parse_from` | `body` | A [field](../types/field.md) that indicates the field to be parsed into key value pairs. |
1414
| `parse_to` | `attributes` | A [field](../types/field.md) that indicates the field to be parsed as into key value pairs. |

pkg/stanza/docs/operators/noop.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ operators:
3030
3131
#### Why is this necessary?
3232
33-
The last operator is always responsible for emitting logs from the receiver. In non-linear pipelines, it is sometimes necessary to explictly direct logs to the final operator. In many such cases, the final operator performs some work. However, if no more work is required, the `noop` operator can serve as a final operator.
33+
The last operator is always responsible for emitting logs from the receiver. In non-linear pipelines, it is sometimes necessary to explicitly direct logs to the final operator. In many such cases, the final operator performs some work. However, if no more work is required, the `noop` operator can serve as a final operator.

pkg/stanza/docs/operators/syslog_input.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ TCP Configuration:
2626
```yaml
2727
- type: syslog_input
2828
tcp:
29-
listen_adress: "0.0.0.0:54526"
29+
listen_address: "0.0.0.0:54526"
3030
syslog:
3131
protocol: rfc5424
3232
```
@@ -36,7 +36,7 @@ UDP Configuration:
3636
```yaml
3737
- type: syslog_input
3838
udp:
39-
listen_adress: "0.0.0.0:54526"
39+
listen_address: "0.0.0.0:54526"
4040
syslog:
4141
protocol: rfc3164
4242
location: UTC

pkg/stanza/docs/operators/udp_input.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Configuration:
6666

6767
```yaml
6868
- type: udp_input
69-
listen_adress: "0.0.0.0:54526"
69+
listen_address: "0.0.0.0:54526"
7070
```
7171
7272
Send a log:

pkg/stanza/docs/types/entry.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ Represented in `json` format, an entry may look like the following:
3636
}
3737
```
3838

39-
Throughout the documentation, `json` format is used to represent entries. Fields are typically ommitted unless relevant to the behavior being described.
39+
Throughout the documentation, `json` format is used to represent entries. Fields are typically omitted unless relevant to the behavior being described.

pkg/stanza/docs/types/operators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ receivers:
104104
value: baz
105105
```
106106

107-
### Emitting from a reciever
107+
### Emitting from a receiver
108108

109109
By default, the last operator in a sequence will emit logs from the receiver.
110110

pkg/stanza/docs/types/severity.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Parser operators can parse a severity and attach the resulting value to a log en
1313
| `parse_from` | required | The [field](../types/field.md) from which the value will be parsed. |
1414
| `preset` | `default` | A predefined set of values that should be interpretted at specific severity levels. |
1515
| `mapping` | | A custom set of values that should be interpretted at designated severity levels. |
16-
| `overwrite_text` | `false` | If `true`, the severity text will be set to the [recommeneded short name](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#displaying-severity) corresponding to the severity number. |
16+
| `overwrite_text` | `false` | If `true`, the severity text will be set to the [recommended short name](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#displaying-severity) corresponding to the severity number. |
1717

1818
Note that by default the severity _text_ will be set to the original value which was interpreted into a severity number. In order to set the severity text to a standard short name (e.g. `ERROR`, `INFO3`, etc.), set `overwrite_text` to `true`.
1919

pkg/stanza/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: pkg
23
codeowners:
34
active: [djaglowski]

pkg/translator/azure/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: pkg
23
codeowners:
34
active: [open-telemetry/collector-approvers, atoulme, cparkins]
+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: "pkg"
23
codeowners:
34
active: [atoulme, cparkins, MikeGoldsmith]

pkg/translator/jaeger/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: "pkg"
23
codeowners:
34
active: [open-telemetry/collector-approvers, frzifus]

pkg/translator/loki/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: "pkg"
23
codeowners:
34
active: [gouthamve, mar4uk]
+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: "pkg"
23
codeowners:
34
active: [open-telemetry/collector-approvers]
+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: "pkg"
23
codeowners:
34
active: [dashpole, bertysentry, ArthurSens]
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: "pkg"
23
codeowners:
34
active: [Aneurysm9, dashpole]
+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: pkg
23
codeowners:
34
active: [JaredTan95]

pkg/winperfcounters/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: "pkg"
23
codeowners:
34
active: [dashpole, Mrod1598, alxbl, pjanotti]

pkg/xk8stest/metadata.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
status:
2+
class: "pkg"
23
codeowners:
34
active: [crobert-1]

processor/k8sattributesprocessor/internal/kube/client.go

+18-1
Original file line numberDiff line numberDiff line change
@@ -946,10 +946,27 @@ func (c *WatchClient) shouldIgnorePod(pod *api_v1.Pod) bool {
946946
return false
947947
}
948948

949+
var singleValueOperators = map[selection.Operator]int{
950+
selection.Equals: 1,
951+
selection.DoubleEquals: 1,
952+
selection.NotEquals: 1,
953+
selection.GreaterThan: 1,
954+
selection.LessThan: 1,
955+
}
956+
949957
func selectorsFromFilters(filters Filters) (labels.Selector, fields.Selector, error) {
950958
labelSelector := labels.Everything()
951959
for _, f := range filters.Labels {
952-
r, err := labels.NewRequirement(f.Key, f.Op, []string{f.Value})
960+
if f.Op == selection.In || f.Op == selection.NotIn {
961+
return nil, nil, fmt.Errorf("label filters don't support operator: '%s'", f.Op)
962+
}
963+
964+
var vals []string
965+
if _, ok := singleValueOperators[f.Op]; ok {
966+
vals = []string{f.Value}
967+
}
968+
969+
r, err := labels.NewRequirement(f.Key, f.Op, vals)
953970
if err != nil {
954971
return nil, nil, err
955972
}

processor/k8sattributesprocessor/internal/kube/client_test.go

+48-3
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ func TestFilters(t *testing.T) {
13581358
}, {
13591359
name: "labels-and-fields",
13601360
filters: Filters{
1361-
Labels: []FieldFilter{
1361+
Labels: []LabelFilter{
13621362
{
13631363
Key: "k1",
13641364
Value: "v1",
@@ -1841,24 +1841,69 @@ func TestErrorSelectorsFromFilters(t *testing.T) {
18411841
tests := []struct {
18421842
name string
18431843
filters Filters
1844+
wantErr bool
18441845
}{
18451846
{
18461847
name: "label/invalid-op",
18471848
filters: Filters{
1848-
Labels: []FieldFilter{{Op: "invalid-op"}},
1849+
Labels: []LabelFilter{{Op: "invalid-op"}},
18491850
},
1851+
wantErr: true,
1852+
},
1853+
{
1854+
name: "label/equals",
1855+
filters: Filters{
1856+
Labels: []LabelFilter{{Key: "app", Op: selection.Equals, Value: "test"}},
1857+
},
1858+
},
1859+
{
1860+
name: "label/not-equals",
1861+
filters: Filters{
1862+
Labels: []LabelFilter{{Key: "app", Op: selection.NotEquals, Value: "test"}},
1863+
},
1864+
},
1865+
{
1866+
name: "label/exists",
1867+
filters: Filters{
1868+
Labels: []LabelFilter{{Key: "app", Op: selection.Exists}},
1869+
},
1870+
},
1871+
{
1872+
name: "label/does-not-exist",
1873+
filters: Filters{
1874+
Labels: []LabelFilter{{Key: "app", Op: selection.DoesNotExist}},
1875+
},
1876+
},
1877+
{
1878+
name: "label/in",
1879+
filters: Filters{
1880+
Labels: []LabelFilter{{Key: "app", Op: selection.In}},
1881+
},
1882+
wantErr: true,
1883+
},
1884+
{
1885+
name: "label/not-in",
1886+
filters: Filters{
1887+
Labels: []LabelFilter{{Key: "app", Op: selection.NotIn}},
1888+
},
1889+
wantErr: true,
18501890
},
18511891
{
18521892
name: "fields/invalid-op",
18531893
filters: Filters{
18541894
Fields: []FieldFilter{{Op: selection.Exists}},
18551895
},
1896+
wantErr: true,
18561897
},
18571898
}
18581899
for _, tt := range tests {
18591900
t.Run(tt.name, func(t *testing.T) {
18601901
_, _, err := selectorsFromFilters(tt.filters)
1861-
assert.Error(t, err)
1902+
if tt.wantErr {
1903+
assert.Error(t, err)
1904+
} else {
1905+
assert.NoError(t, err)
1906+
}
18621907
})
18631908
}
18641909
}

processor/k8sattributesprocessor/internal/kube/informer_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func Test_informerListFuncWithSelectors(t *testing.T) {
4949
Op: selection.Equals,
5050
},
5151
},
52-
Labels: []FieldFilter{
52+
Labels: []LabelFilter{
5353
{
5454
Key: "lk1",
5555
Value: "lv1",
@@ -86,7 +86,7 @@ func Test_informerWatchFuncWithSelectors(t *testing.T) {
8686
Op: selection.Equals,
8787
},
8888
},
89-
Labels: []FieldFilter{
89+
Labels: []LabelFilter{
9090
{
9191
Key: "lk1",
9292
Value: "lv1",

processor/k8sattributesprocessor/internal/kube/kube.go

+19-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ type Filters struct {
176176
Node string
177177
Namespace string
178178
Fields []FieldFilter
179-
Labels []FieldFilter
179+
Labels []LabelFilter
180180
}
181181

182182
// FieldFilter represents exactly one filter by field rule.
@@ -192,6 +192,24 @@ type FieldFilter struct {
192192
Op selection.Operator
193193
}
194194

195+
// LabelFilter represents exactly one filter by label rule.
196+
type LabelFilter struct {
197+
// Key matches the label name.
198+
Key string
199+
// Value matches the label value.
200+
Value string
201+
// Op determines the matching operation.
202+
// The following operations are supported,
203+
// - Exists
204+
// - DoesNotExist
205+
// - Equals
206+
// - DoubleEquals
207+
// - NotEquals
208+
// - GreaterThan
209+
// - LessThan
210+
Op selection.Operator
211+
}
212+
195213
// ExtractionRules is used to specify the information that needs to be extracted
196214
// from pods and added to the spans as tags.
197215
type ExtractionRules struct {

0 commit comments

Comments
 (0)