Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an otelcol.processor.attributes component #3349

Merged
merged 12 commits into from
Apr 18, 2023

Conversation

ptodev
Copy link
Contributor

@ptodev ptodev commented Mar 23, 2023

Adding an otelcol.processor.attributes component.

Fixes #2294

I left some comments in the PR about things I was not sure about.

Tests, docs, and changelog have been updated.

@ptodev ptodev linked an issue Mar 23, 2023 that may be closed by this pull request
@ptodev ptodev force-pushed the 2294-flow-otelcolprocessorattributes-component-3 branch 5 times, most recently from 76acd34 to 08f66a8 Compare March 31, 2023 09:49
component/otelcol/config_filter.go Show resolved Hide resolved
component/otelcol/config_filter.go Show resolved Hide resolved
component/otelcol/config_filter.go Outdated Show resolved Hide resolved
// Attributes specifies the list of attributes to match against.
// All of these attributes must match exactly for a match to occur.
// Only match_type=strict is allowed if "attributes" are specified.
Attributes []Attribute `river:"attribute,block,optional"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Otel code this used to be a slice of pointers ([]*Attribute), but I'm not sure why. I changed it to values instead of pointers to avoid shallow copy issues.

component/otelcol/config_attraction.go Outdated Show resolved Hide resolved
}
}

otelcol.processor.attributes "default" {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an example for from_context?

@@ -0,0 +1,103 @@
package otelcol

type AttrActionKeyValueSlice []AttrActionKeyValue
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern is something I made up myself, since it makes sense to use actions as a slice and to have the convert function in config_atraction.go. If you think this pattern doesn't make senes though, let me know

@ptodev ptodev changed the title WIP: Add an otelcol.processor.attributes component Add an otelcol.processor.attributes component Mar 31, 2023
@ptodev ptodev force-pushed the 2294-flow-otelcolprocessorattributes-component-3 branch from bee70c9 to 257b9a1 Compare April 18, 2023 13:01
@ptodev ptodev force-pushed the 2294-flow-otelcolprocessorattributes-component-3 branch from 257b9a1 to 6776869 Compare April 18, 2023 15:06
ptodev added 3 commits April 18, 2023 17:10
Rename log_severity_number to log_severity
The severities supported by Otel are listed in the table below.
The value for `min` should be one of the values in the "Log Severity" column.

Log Severity | Severity number
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is quite a tall table, but I think that listing all 5 types of each severity kind is worth it?
I.e. I think it's better to have all of TRACE, TRACE2, TRACE3, TRACE4 instead of just listing TRACE.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a bit strange but assuming its a straight mapping from otel right?

component/otelcol/config_filter.go Show resolved Hide resolved
Copy link
Collaborator

@mattdurham mattdurham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mattdurham mattdurham enabled auto-merge (squash) April 18, 2023 19:17
@mattdurham mattdurham merged commit 84a6494 into main Apr 18, 2023
@mattdurham mattdurham deleted the 2294-flow-otelcolprocessorattributes-component-3 branch April 18, 2023 19:29
ptodev added a commit that referenced this pull request Apr 21, 2023
mattdurham pushed a commit that referenced this pull request Apr 21, 2023
* Revert "Add an otelcol.processor.attributes component (#3349)"

This reverts commit 84a6494.

* Update docs/sources/flow/reference/components/discovery.kubernetes.md

Co-authored-by: Mischa Thompson <mischabear@gmail.com>

* Update docs/sources/flow/reference/components/mimir.rules.kubernetes.md

Co-authored-by: Mischa Thompson <mischabear@gmail.com>

* Update docs/sources/flow/reference/components/otelcol.processor.batch.md

---------

Co-authored-by: Mischa Thompson <mischabear@gmail.com>
spartan0x117 added a commit that referenced this pull request Apr 21, 2023
* Revert "Add an otelcol.processor.attributes component (#3349)"

This reverts commit 84a6494.

* Update docs/sources/flow/reference/components/discovery.kubernetes.md

Co-authored-by: Mischa Thompson <mischabear@gmail.com>

* Update docs/sources/flow/reference/components/mimir.rules.kubernetes.md

Co-authored-by: Mischa Thompson <mischabear@gmail.com>

* Update docs/sources/flow/reference/components/otelcol.processor.batch.md

---------

Co-authored-by: Mischa Thompson <mischabear@gmail.com>
captncraig pushed a commit that referenced this pull request Apr 21, 2023
#3593)

* Revert "Add an otelcol.processor.attributes component (#3349)"

This reverts commit 84a6494.

* Update docs/sources/flow/reference/components/discovery.kubernetes.md



* Update docs/sources/flow/reference/components/mimir.rules.kubernetes.md



* Update docs/sources/flow/reference/components/otelcol.processor.batch.md

---------

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
ptodev added a commit that referenced this pull request Apr 28, 2023
ptodev added a commit that referenced this pull request May 9, 2023
@ptodev ptodev mentioned this pull request May 9, 2023
3 tasks
ptodev added a commit that referenced this pull request May 31, 2023
ptodev added a commit that referenced this pull request Jun 12, 2023
ptodev added a commit that referenced this pull request Jun 14, 2023
ptodev added a commit that referenced this pull request Jun 14, 2023
* Revert "Revert "Add an otelcol.processor.attributes component (#3349)" (#3589)"

This reverts commit fc17c56.

* Add runner tests for the attributes processor

* Update docs/sources/flow/reference/components/otelcol.processor.attributes.md

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>

* Remove a panic, fix comments and docs

* Update changelog

---------

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
clayton-cornell pushed a commit that referenced this pull request Aug 14, 2023
* Add a otelcol.processor.attributes component

* Update changelog

* Fix linter errors

* Update docs/sources/flow/reference/components/otelcol.processor.attributes.md

Co-authored-by: Robert Fratto <robertfratto@gmail.com>

* PR review fixes

* PR review fixes

* Update documentation
Rename log_severity_number to log_severity

* Update docs

* Fix tests

* Rename "cacheenabled" and "cachemaxnumentries" with "_"

---------

Co-authored-by: Robert Fratto <robertfratto@gmail.com>
Co-authored-by: mattdurham <mattdurham@ppog.org>
clayton-cornell pushed a commit that referenced this pull request Aug 14, 2023
* Revert "Add an otelcol.processor.attributes component (#3349)"

This reverts commit 84a6494.

* Update docs/sources/flow/reference/components/discovery.kubernetes.md

Co-authored-by: Mischa Thompson <mischabear@gmail.com>

* Update docs/sources/flow/reference/components/mimir.rules.kubernetes.md

Co-authored-by: Mischa Thompson <mischabear@gmail.com>

* Update docs/sources/flow/reference/components/otelcol.processor.batch.md

---------

Co-authored-by: Mischa Thompson <mischabear@gmail.com>
clayton-cornell added a commit that referenced this pull request Aug 14, 2023
* Revert "Revert "Add an otelcol.processor.attributes component (#3349)" (#3589)"

This reverts commit fc17c56.

* Add runner tests for the attributes processor

* Update docs/sources/flow/reference/components/otelcol.processor.attributes.md

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>

* Remove a panic, fix comments and docs

* Update changelog

---------

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
clayton-cornell pushed a commit that referenced this pull request Aug 14, 2023
* Add a otelcol.processor.attributes component

* Update changelog

* Fix linter errors

* Update docs/sources/flow/reference/components/otelcol.processor.attributes.md

Co-authored-by: Robert Fratto <robertfratto@gmail.com>

* PR review fixes

* PR review fixes

* Update documentation
Rename log_severity_number to log_severity

* Update docs

* Fix tests

* Rename "cacheenabled" and "cachemaxnumentries" with "_"

---------

Co-authored-by: Robert Fratto <robertfratto@gmail.com>
Co-authored-by: mattdurham <mattdurham@ppog.org>
clayton-cornell pushed a commit that referenced this pull request Aug 14, 2023
* Revert "Add an otelcol.processor.attributes component (#3349)"

This reverts commit 84a6494.

* Update docs/sources/flow/reference/components/discovery.kubernetes.md

Co-authored-by: Mischa Thompson <mischabear@gmail.com>

* Update docs/sources/flow/reference/components/mimir.rules.kubernetes.md

Co-authored-by: Mischa Thompson <mischabear@gmail.com>

* Update docs/sources/flow/reference/components/otelcol.processor.batch.md

---------

Co-authored-by: Mischa Thompson <mischabear@gmail.com>
clayton-cornell added a commit that referenced this pull request Aug 14, 2023
* Revert "Revert "Add an otelcol.processor.attributes component (#3349)" (#3589)"

This reverts commit fc17c56.

* Add runner tests for the attributes processor

* Update docs/sources/flow/reference/components/otelcol.processor.attributes.md

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>

* Remove a panic, fix comments and docs

* Update changelog

---------

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Mar 1, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flow: otelcol.processor.attributes component
3 participants