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

Updated to handle http receiver metadata #21726

Merged
merged 2 commits into from
Jul 13, 2023
Merged

Conversation

akats7
Copy link
Contributor

@akats7 akats7 commented May 10, 2023

Description:

Hi all,

This enables the processor to perform context based routing for payloads that are received on the http server of the otlp receiver. It defaults to the original grpc metadata extraction but if it is not able to extract the grpc metadata, it will then attempt to extract it from client.Info. Currently the routing processor will always use the default route if the payload was received through the http server.

Link to tracking Issue:
resolves #20913
Testing:
Added test cases for traces, metrics and logs to includes testing context based routing when the metadata is in client.Info
Documentation:

@kovrus
Copy link
Member

kovrus commented May 16, 2023

@akats7 can you please fix the linting issues, add a changelog and update the readme if needed?

@akats7
Copy link
Contributor Author

akats7 commented May 18, 2023

@akats7 can you please fix the linting issues, add a changelog and update the readme if needed?

Hey @kovrus, I made the updates, only caveat I added to the readme was the requirement for include_metadata to be set true

@@ -95,6 +95,7 @@ It is also possible to mix both the conventional routing configuration and the r

- [OTTL] statements can be applied only to resource attributes.
- Currently, it is not possible to specify the boolean statements without function invocation as the routing condition. It is required to provide the NOOP `route()` or any other supported function as part of the routing statement, see [#13545](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/13545) for more information.
- If data is received on OTLP http server, `include_metadata` must be set to true in order to use context based routing.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to mention gRPC as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @atoulme, it does work for grpc even without include_metadata enabled as grpc metadata is already included in the context when going through the grpc server

# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
Enables processor to perform context based routing for payloads on the http server of otlp receiver
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to mention gRPC as well?

Copy link
Contributor Author

@akats7 akats7 May 20, 2023

Choose a reason for hiding this comment

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

@atoulme same as above, I wanted to specify that it was specifically introducing new functionality for http

@akats7
Copy link
Contributor Author

akats7 commented May 25, 2023

@atoulme @kovrus @jpkrohling

Hi all, wanted to follow up

@akats7
Copy link
Contributor Author

akats7 commented Jun 6, 2023

@kovrus Any update on when this will merged

@TylerHelmuth
Copy link
Member

@kovrus @jpkrohling @djaglowski are we still accepting changes to this component or is the intention that it be deprecated in favor of the routing connector?

@akats7
Copy link
Contributor Author

akats7 commented Jun 7, 2023

@kovrus @jpkrohling @djaglowski are we still accepting changes to this component or is the intention that it be deprecated in favor of the routing connector?

@TylerHelmuth @kovrus @atoulme @djaglowski What is the status of the routing connector, we are currently using this component actively so it would be useful for us to have this merged to avoid having to maintain our own.

@akats7
Copy link
Contributor Author

akats7 commented Jun 21, 2023

@djaglowski @TylerHelmuth I looked over the PR for the routing connector and see that its not going to support context based routing until the next iteration. In the meantime, would it be possible to merge this PR.

@akats7 akats7 force-pushed the PR branch 2 times, most recently from d71850e to fad4cbb Compare June 26, 2023 23:37
@jpkrohling
Copy link
Member

Sorry, there seems to be a conflict in the go.mod. Once this is resolved, this PR is ready to be merged.

@akats7
Copy link
Contributor Author

akats7 commented Jul 12, 2023

Sorry, there seems to be a conflict in the go.mod. Once this is resolved, this PR is ready to be merged.

Hey @jpkrohling, I have resolved the conflict, thanks.

cc. @TylerHelmuth @kovrus

@djaglowski
Copy link
Member

@TylerHelmuth @kovrus @atoulme @djaglowski What is the status of the routing connector, we are currently using this component actively so it would be useful for us to have this merged to avoid having to maintain our own.

The routing connector does not yet fully implement the functionality of the processor so I think the processor should be supported for some time yet.

@TylerHelmuth
Copy link
Member

@akats7 the repo is experiencing some CI issues at the moment but once they are fixed we'll be able to merge this.

@jpkrohling
Copy link
Member

PR rebased.

@jpkrohling jpkrohling merged commit 59b7daa into open-telemetry:main Jul 13, 2023
88 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor/routing Routing processor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Routing Processor is always Routing to default exporter when receiver is oltp http
6 participants