From 4a465fd0e2c42cb9fe2b35e4ad1eefe6f1893c7c Mon Sep 17 00:00:00 2001 From: Daniel Jaglowski Date: Thu, 5 Dec 2024 11:22:17 -0500 Subject: [PATCH] [processor/routing] Deprecate processor (#36692) Resolves https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/36616 --- .chloggen/deprecate-routing-processor.yaml | 27 +++++++ connector/routingconnector/README.md | 12 +-- processor/routingprocessor/README.md | 76 ++++++++++++++++++- .../internal/metadata/generated_status.go | 6 +- processor/routingprocessor/metadata.yaml | 2 +- 5 files changed, 108 insertions(+), 15 deletions(-) create mode 100644 .chloggen/deprecate-routing-processor.yaml diff --git a/.chloggen/deprecate-routing-processor.yaml b/.chloggen/deprecate-routing-processor.yaml new file mode 100644 index 000000000000..411f91e17998 --- /dev/null +++ b/.chloggen/deprecate-routing-processor.yaml @@ -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] diff --git a/connector/routingconnector/README.md b/connector/routingconnector/README.md index 0198da0978ee..bfc4c26b2111 100644 --- a/connector/routingconnector/README.md +++ b/connector/routingconnector/README.md @@ -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: @@ -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: @@ -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 diff --git a/processor/routingprocessor/README.md b/processor/routingprocessor/README.md index 27e1793058f3..5ae2c563d5c7 100644 --- a/processor/routingprocessor/README.md +++ b/processor/routingprocessor/README.md @@ -3,15 +3,83 @@ | 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 +## 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. @@ -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 diff --git a/processor/routingprocessor/internal/metadata/generated_status.go b/processor/routingprocessor/internal/metadata/generated_status.go index 17d464b719d6..ba89f61c68c5 100644 --- a/processor/routingprocessor/internal/metadata/generated_status.go +++ b/processor/routingprocessor/internal/metadata/generated_status.go @@ -12,7 +12,7 @@ var ( ) const ( - TracesStability = component.StabilityLevelBeta - MetricsStability = component.StabilityLevelBeta - LogsStability = component.StabilityLevelBeta + TracesStability = component.StabilityLevelDeprecated + MetricsStability = component.StabilityLevelDeprecated + LogsStability = component.StabilityLevelDeprecated ) diff --git a/processor/routingprocessor/metadata.yaml b/processor/routingprocessor/metadata.yaml index c1a43f943292..9668e4fc217d 100644 --- a/processor/routingprocessor/metadata.yaml +++ b/processor/routingprocessor/metadata.yaml @@ -3,7 +3,7 @@ type: routing status: class: processor stability: - beta: [traces, metrics, logs] + deprecated: [traces, metrics, logs] distributions: [contrib] codeowners: active: [jpkrohling]