-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
processor/routing supports matching the statement only once. #26353
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hello @huange7, would it be possible to simply make your routing statements more specific to accomplish this functionality? It sounds like your goal is to match only the most specific routing statement possible, and ignore any statement more general. If this is correct, we can simply update the general statement in your configuration to be more specific, so the match isn't overlapping anymore (a given log/metric/trace will then only match one statement). In your example, you could simply do the following:
Apologies if I've misunderstood or missed anything here. |
@crobert-1 Thanks for your reply. This sounds feasible. However, let's consider a scenario where there is a In that case, the configuration file would look like this:
As the number of different |
Can you confirm the same applies to the connector? I'd be more inclined to accept this new feature there instead of the processor. |
Hello, @jpkrohling. Do you mean to add this feature to the routing connector rather than the routing processor? If so, I can implement this feature in the connector. |
/label -needs-triage |
/label connector/routing -processor/routing |
Pinging code owners for connector/routing: @jpkrohling @mwear. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I'm going to assign this to you @huange7, let me know if that's incorrect. |
@huange7, I'm curious what your plans for solving this issue are. Are you planning on changing the behavior of the routing connector to only route to the first match or are you planning on adding additional functionality to instruct the router to stop after a match conditionally? If the latter, how do you see that working? |
hello, @crobert-1 @mwear I will modify the routing connector to match only the first matching route, because currently, the mapping between statements and routing items is stored using a map, which results in the matching order not following the order in the configuration. In order to match the most precise route, should we consider introducing an |
@huange7 As the routing connector is meant to eventually replace the routing processor, I think we need to continue to support the current behavior (routing to all matches) and add additional functionality to support routing to only the first match. I could see how adding an |
@mwear We should consider having a switch to control the matching behavior of the routing connector. For instance, when the switch is turned on, it would match only once. |
That's not acceptable, as it will impact current users that depend on routes matching different statements.
I agree, as long as the result is deterministic. |
@jpkrohling I apologize for my previous unclear description. I would like to add a switch for the connector, which will be used to control the matching behavior of the connector. |
I agree that a boolean setting on the connector makes sense. By default, it should route data to all matching routes (i.e. acts as a series of |
#28888 I have submitted a PR |
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Adding a feature: routing connector supports matching the statement only once **Link to tracking Issue:** <Issue number if applicable> #26353 **Testing:** <Describe what testing was performed and which tests were added.> Basic tests included for the functionality. **Documentation:** <Describe the documentation added.> --------- Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
…telemetry#28888) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Adding a feature: routing connector supports matching the statement only once **Link to tracking Issue:** <Issue number if applicable> open-telemetry#26353 **Testing:** <Describe what testing was performed and which tests were added.> Basic tests included for the functionality. **Documentation:** <Describe the documentation added.> --------- Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
Component(s)
processor/routing
Is your feature request related to a problem? Please describe.
If multiple statements are configured in the configuration file, the routing processor will judge each statement. Whenever a match is made, data will be sent to the exporters defined in the configuration. Can we support interrupting the match after matching only once?
Describe the solution you'd like
Use a switch to allow the routing processor to match only once.
Describe alternatives you've considered
No response
Additional context
As shown in the configuration file above, I hope that some traces/metrics/logs will be sent to
logging exporter
if they only match theservice.name
attribute, and if they match both theservice.name
and thetoken
, they will be sent tologging/2 exporter
. This is possible in practice.If this seems reasonable, I sincerely hope that I can make some contributions.
The text was updated successfully, but these errors were encountered: