Skip to content

Commit

Permalink
[processor/routing] Deprecate processor (open-telemetry#36692)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski authored and sbylica-splunk committed Dec 17, 2024
1 parent f00d48f commit a5eb19e
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 15 deletions.
27 changes: 27 additions & 0 deletions .chloggen/deprecate-routing-processor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: deprecation

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: routingprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Deprecated in favor of the routing connector.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [36616]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user, api]
12 changes: 4 additions & 8 deletions connector/routingconnector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ connectors:
default_pipelines: [logs/other]
table:
- context: request
condition: reqeust["X-Tenant"] == "acme"
condition: request["X-Tenant"] == "acme"
pipelines: [logs/acme]
- context: request
condition: reqeust["X-Tenant"] == "ecorp"
condition: request["X-Tenant"] == "ecorp"
pipelines: [logs/ecorp]

service:
Expand Down Expand Up @@ -263,10 +263,10 @@ connectors:
condition: severity_number < SEVERITY_NUMBER_ERROR
pipelines: [logs/cheap]
- context: request
condition: reqeust["X-Tenant"] == "acme"
condition: request["X-Tenant"] == "acme"
pipelines: [logs/acme]
- context: request
condition: reqeust["X-Tenant"] == "ecorp"
condition: request["X-Tenant"] == "ecorp"
pipelines: [logs/ecorp]

service:
Expand All @@ -285,10 +285,6 @@ service:
exporters: [file/ecorp]
```
## Differences between the Routing Connector and Routing Processor
- The connector routes to pipelines, not exporters as the processor does.
[Connectors README]:https://github.com/open-telemetry/opentelemetry-collector/blob/main/connector/README.md
[OTTL]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/ottl/README.md
Expand Down
76 changes: 73 additions & 3 deletions processor/routingprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,83 @@
<!-- status autogenerated section -->
| Status | |
| ------------- |-----------|
| Stability | [beta]: traces, metrics, logs |
| Stability | [deprecated]: traces, metrics, logs |
| Distributions | [contrib] |
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprocessor%2Frouting%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Frouting) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Frouting%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Frouting) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@jpkrohling](https://www.github.com/jpkrohling) |

[beta]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#beta
[deprecated]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#deprecated
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
<!-- end autogenerated section -->

## Deprecation Notice

This processor has been deprecated in favor of the [`routing` connector][routing_connector].

### Migration

The routing connector supports all features of the routing processor and more. However, the configuration is different. The general idea is the same, but there are a few key differences:

- Rather than routing directly to exporters, the routing connector routes to pipelines. This allow for processors to be included after routing decisions.
- The connector is configured within the `connectors` section, rather than the `processors` section of the configuration.
- Usage of the connector in pipelines is different. You must use it as an exporter AND as a receiver in each pipeline to which it can route.
- Configuration is primarily based on [OTTL][OTTL].
- Each route can be evaluated in a different [OTTL Context][ottl_contexts].

#### Example

Starting from the example configuration below, we can achieve the same result with the routing connector:

```yaml
processors:
routing:
from_attribute: X-Tenant
default_exporters: [jaeger]
table:
- value: acme
exporters: [jaeger/acme]
exporters:
jaeger:
endpoint: localhost:14250
jaeger/acme:
endpoint: localhost:24250
service:
pipelines:
traces:
receivers: [otlp]
processors: [routing]
exporters: [jaeger, jaeger/acme]
```
```yaml
connectors:
routing:
match_once: true
default_pipelines: [traces/jaeger]
table:
- context: request
condition: request["X-Tenant"] == "acme"
pipelines: [traces/jaeger/acme]
exporters:
jaeger:
endpoint: localhost:14250
jaeger/acme:
endpoint: localhost:24250
service:
pipelines:
traces:
receivers: [otlp]
exporters: [routing]
traces/jaeger:
receivers: [routing]
exporters: [jaeger]
traces/jaeger/acme:
receivers: [routing]
exporters: [jaeger/acme]
```
## Overview
Routes logs, metrics or traces to specific exporters.
This processor will either read a header from the incoming HTTP request (gRPC or plain HTTP), or it will read a resource attribute, and direct the trace information to specific exporters based on the value read.
Expand Down Expand Up @@ -114,4 +182,6 @@ The full list of settings exposed for this processor are documented [here](./con
- [traces](./testdata/config_traces.yaml)

[context_docs]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/README.md
[OTTL]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/processing.md#telemetry-query-language
[OTTL]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl#opentelemetry-transformation-language
[ottl_contexts]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/ottl/contexts/README.md#opentelemetry-transformation-language-contexts
[routing_connector]: http://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/connector/routingconnector/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion processor/routingprocessor/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type: routing
status:
class: processor
stability:
beta: [traces, metrics, logs]
deprecated: [traces, metrics, logs]
distributions: [contrib]
codeowners:
active: [jpkrohling]
Expand Down

0 comments on commit a5eb19e

Please sign in to comment.