-
Notifications
You must be signed in to change notification settings - Fork 487
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 a otelcol.processor.transform component #5337
Conversation
70a9baf
to
d437f6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll probably need to go over this one again.
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
4bae072
to
a1d8caa
Compare
Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
a1d8caa
to
95cec8f
Compare
|
||
input["error_mode"] = args.ErrorMode | ||
|
||
if len(args.TraceStatements) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be simplified by removing the len check? Your checking for nil in the convert itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes in the Collector config the behaviour is different even if none of the underlying config is set. E.g. I think this will enable both grpc and http receivers:
receivers:
otlp:
protocols:
grpc:
http:
But I think this will enable only http:
receivers:
otlp:
protocols:
http:
In the case of this component, I think the behaviour would be the same, but I'd still want to refrain from setting this unless we want this field to be used with its default values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work with great examples. I added some nits and a couple reusability suggestions if we anticipate OTTL code/docs being reused by other OTEL components in the future. If not, feel free to disregard those.
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
docs/sources/flow/reference/components/otelcol.processor.transform.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
LogStatements contextStatementsSlice `river:"log_statements,block,optional"` | ||
|
||
// Output configures where to send processed data. Required. | ||
Output *otelcol.ConsumerArguments `river:"output,block"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: If this is required, should we make it a struct instead of a pointer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep it consistent between all otelcol components. Not sure why it's a pointer tbh. Maybe to avoid extra copies? @rfratto, do you happen to know why it was originally made this way?
* Add a otelcol.processor.transform component --------- Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com>
PR Description
This PR ports the transform processor to Flow.
Which issue(s) this PR fixes
Fixes #2910
Notes to the Reviewer
When writing flow docs, usually we avoid linking to the documentation of the underlying Otel component so that we don't confuse users with yaml configs which don't apply for the Agent. In this case I had to link to the Otel docs quite a lot. I tried to only link to places where it made sense, and to sections where there isn't any yaml config which could confuse a reader.
PR Checklist