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

feat(comp/otelcol): component to filter OTEL telemetry #5562

Merged
merged 27 commits into from
Oct 31, 2023

Conversation

hainenber
Copy link
Contributor

@hainenber hainenber commented Oct 22, 2023

PR Description

Which issue(s) this PR fixes

Closes #4628

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@hainenber hainenber marked this pull request as ready for review October 22, 2023 15:36
@hainenber hainenber requested review from a team and clayton-cornell as code owners October 22, 2023 15:36
Copy link
Contributor

@ptodev ptodev left a comment

Choose a reason for hiding this comment

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

Thank you very much for this contribution! This has been a much-requested feature. I added a few comments for things we will need to change prior to merging.

component/otelcol/processor/filter/filter.go Show resolved Hide resolved
component/otelcol/processor/filter/filter.go Outdated Show resolved Hide resolved
component/otelcol/processor/filter/filter.go Outdated Show resolved Hide resolved
component/otelcol/processor/filter/filter.go Outdated Show resolved Hide resolved
component/otelcol/processor/filter/filter.go Outdated Show resolved Hide resolved
@hainenber
Copy link
Contributor Author

Appreciate your review effort @ptodev! Other comments totally makes sense to me but there are three with similar concept so I'd like to discuss jointly.

I saw that the config schema with include, exclude and alike are at brink of being deprecated, as dictated in the ref. Should we also implement it for a brand new Flow component? I feel like it could be technical baggage and we'll revisit for the seemingly inevitable removal.

Copy link
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

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

Some doc suggestions and questions

{{% admonition type="warning" %}}
Exercise caution when using `otelcol.processor.filter`:

- Make sure you understand the look of the incoming data and test the configuration thoroughly.
Copy link
Contributor

Choose a reason for hiding this comment

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

What is meant by "understand the look"? The meaning isn't clear and I'm not sure what to suggest here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be something akin to understanding the data's schema/format. Let me wordsmith this one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Finish in latest commit. PTAL when you have time. Thanks!

@ptodev
Copy link
Contributor

ptodev commented Oct 26, 2023

Appreciate your review effort @ptodev! Other comments totally makes sense to me but there are three with similar concept so I'd like to discuss jointly.

I saw that the config schema with include, exclude and alike are at brink of being deprecated, as dictated in the ref. Should we also implement it for a brand new Flow component? I feel like it could be technical baggage and we'll revisit for the seemingly inevitable removal.

@hainenber Thank you for pointing this out! I did not realise it. In that case I agree that we can just have the OTTL parameters. We don't need to include these other ones which will be deprecated.

@ptodev
Copy link
Contributor

ptodev commented Oct 26, 2023

@hainenber Would you mind addressing @clayton-cornell's comments please, and rebasing the branch? I will then take a final look and will likely merge it. Thanks again very much for your work on this component!

hainenber and others added 21 commits October 28, 2023 13:22
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
…r.md

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…r.md

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…r.md

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…r.md

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…r.md

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…r.md

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…r.md

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…r.md

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…r.md

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
…r.md

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

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

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

Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
@hainenber hainenber force-pushed the add-otelcol-processor-filter branch from f52fc18 to 313a278 Compare October 28, 2023 06:24
@hainenber
Copy link
Contributor Author

@hainenber Would you mind addressing @clayton-cornell's comments please, and rebasing the branch? I will then take a final look and will likely merge it. Thanks again very much for your work on this component!

@ptodev I've addressed Clayton's comments and rebased the branch. PTAL when you're back. Thanks!

Copy link
Contributor

@ptodev ptodev left a comment

Choose a reason for hiding this comment

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

Thank you, it looks good! I left a few minor comments, but the only thing which really needs to be fixed is just the non-working unit test.

component/otelcol/processor/filter/filter_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please also move the convert() functions for traceConfig, metricConfig, and logConfig to this file (types.go)?

Comment on lines 40 to 46
{{% admonition type="note" %}}
Some characters inside River strings [need to be escaped][river-strings] with a `\` character.
For example, the OTTL statement `attributes["grpc"] == true`
is written in River as `attributes[\"grpc\"] == true`.

[river-strings]: {{< relref "../../config-language/expressions/types_and_values.md/#strings" >}}
{{% /admonition %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

The next release of the agent will support raw strings, so I updated some of the documentation in #5636. I'm happy to update the otelcol.processor.filter docs after your PR is merged though. There's no need to mention raw strings in your PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added reference to use River's raw string. It's good by now?

hainenber and others added 5 commits October 31, 2023 00:39
Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
…r.md

Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
@hainenber
Copy link
Contributor Author

Thank you for another review! I've accepted most of your suggested changes and moved the convert() to types.go file. PTAL if it's OK by now.

@rfratto rfratto requested a review from ptodev October 31, 2023 16:16
@ptodev ptodev merged commit 481674a into grafana:main Oct 31, 2023
8 checks passed
hainenber added a commit to hainenber/agent that referenced this pull request Nov 1, 2023
* feat(comp/otelcol): component to filter OTEL telemetry

---------

Signed-off-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
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 Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 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: Add OpenTelemetry Collector components - Filter Processor
3 participants