diff --git a/modules/otel-connectors-count-connector.adoc b/modules/otel-connectors-count-connector.adoc new file mode 100644 index 000000000000..3ed8b44a6a55 --- /dev/null +++ b/modules/otel-connectors-count-connector.adoc @@ -0,0 +1,103 @@ +// Module included in the following assemblies: +// +// * observability/otel/otel-collector/otel-collector-connectors.adoc + +:_mod-docs-content-type: REFERENCE +[id="otel-connectors-count-connector_{context}"] += Count Connector + +[role="_abstract"] +The Count Connector counts trace spans, trace span events, metrics, metric data points, and log records in exporter pipelines. + +:FeatureName: The Count Connector +include::snippets/technology-preview.adoc[] + +The following are the default metric names: + +* `trace.span.count` +* `trace.span.event.count` +* `metric.count` +* `metric.datapoint.count` +* `log.record.count` + +You can also expose custom metric names. + +.OpenTelemetry Collector custom resource (CR) with an enabled Count Connector +[source,yaml] +---- +# ... + config: + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + exporters: + prometheus: + endpoint: 0.0.0.0:8889 + connectors: + count: {} + service: + pipelines: # <1> + traces/in: + receivers: [otlp] + exporters: [count] # <2> + metrics/out: + receivers: [count] # <3> + exporters: [prometheus] +# ... +---- +<1> It is important to correctly configure the Count Connector as an exporter or receiver in the pipeline and to export the generated metrics to the correct exporter. +<2> The Count Connector is configured to receive spans as an exporter. +<3> The Count Connector is configured to emit generated metrics as a receiver. ++ +[TIP] +==== +If the Count Connector is not generating the expected metrics, you can check whether the OpenTelemetry Collector is receiving the expected spans, metrics, and logs, and whether the telemetry data flow through the Count Connector as expected. You can also use the Debug Exporter to inspect the incoming telemetry data. +==== + +The Count Connector can count telemetry data according to defined conditions and expose those data as metrics when configured by using such fields as `spans`, `spanevents`, `metrics`, `datapoints`, or `logs`. See the next example. + +.Example OpenTelemetry Collector CR for the Count Connector to count spans by conditions +[source,yaml] +---- +# ... + config: + connectors: + count: + spans: # <1> + : # <2> + description: "" + conditions: + - 'attributes["env"] == "dev"' + - 'name == "devevent"' +# ... +---- +<1> In this example, the exposed metric counts spans with the specified conditions. +<2> You can specify a custom metric name such as `cluster.prod.event.count`. ++ +[TIP] +==== +Write conditions correctly and follow the required syntax for attribute matching or telemetry field conditions. Improperly defined conditions are the most likely sources of errors. +==== + +The Count Connector can count telemetry data according to defined attributes when configured by using such fields as `spans`, `spanevents`, `metrics`, `datapoints`, or `logs`. See the next example. The attribute keys are injected into the telemetry data. You must define a value for the `default_value` field for missing attributes. + +.Example OpenTelemetry Collector CR for the Count Connector to count logs by attributes +[source,yaml] +---- +# ... + config: + connectors: + count: + logs: # <1> + : # <2> + description: "" + attributes: + - key: env + default_value: unknown # <3> +# ... +---- +<1> Specifies attributes for logs. +<2> You can specify a custom metric name such as `my.log.count`. +<3> Defines a default value when the attribute is not set. diff --git a/modules/otel-connectors-forward-connector.adoc b/modules/otel-connectors-forward-connector.adoc new file mode 100644 index 000000000000..8fb1b5d8b3e4 --- /dev/null +++ b/modules/otel-connectors-forward-connector.adoc @@ -0,0 +1,51 @@ +// Module included in the following assemblies: +// +// * observability/otel/otel-collector/otel-collector-connectors.adoc + +:_mod-docs-content-type: REFERENCE +[id="otel-connectors-forward-connector_{context}"] += Forward Connector + +[role="_abstract"] +The Forward Connector merges two pipelines of the same type. + +:FeatureName: The Forward Connector +include::snippets/technology-preview.adoc[] + +.OpenTelemetry Collector custom resource with an enabled Forward Connector +[source,yaml] +---- +# ... + config: + receivers: + otlp: + protocols: + grpc: + jaeger: + protocols: + grpc: + processors: + batch: + exporters: + otlp: + endpoint: tempo-simplest-distributor:4317 + tls: + insecure: true + connectors: + forward: {} + service: + pipelines: + traces/regiona: + receivers: [otlp] + processors: [] + exporters: [forward] + traces/regionb: + receivers: [jaeger] + processors: [] + exporters: [forward] + traces: + receivers: [forward] + processors: [batch] + exporters: [otlp] +# ... +---- diff --git a/modules/otel-connectors-routing-connector.adoc b/modules/otel-connectors-routing-connector.adoc new file mode 100644 index 000000000000..412f79d1a259 --- /dev/null +++ b/modules/otel-connectors-routing-connector.adoc @@ -0,0 +1,48 @@ +// Module included in the following assemblies: +// +// * observability/otel/otel-collector/otel-collector-connectors.adoc + +:_mod-docs-content-type: REFERENCE +[id="otel-connectors-routing-connector_{context}"] += Routing Connector + +[role="_abstract"] +The Routing Connector routes logs, metrics, and traces to specified pipelines according to resource attributes and their routing conditions, which are written as OpenTelemetry Transformation Language (OTTL) statements. + +:FeatureName: The Routing Connector +include::snippets/technology-preview.adoc[] + +.OpenTelemetry Collector custom resource with an enabled Routing Connector +[source,yaml] +---- +# ... + config: + connectors: + routing: + table: # <1> + - statement: route() where attributes["X-Tenant"] == "dev" # <2> + pipelines: [traces/dev] # <3> + - statement: route() where attributes["X-Tenant"] == "prod" + pipelines: [traces/prod] + default_pipelines: [traces/dev] # <4> + error_mode: ignore # <5> + match_once: false # <6> + service: + pipelines: + traces/in: + receivers: [otlp] + exporters: [routing] + traces/dev: + receivers: [routing] + exporters: [otlp/dev] + traces/prod: + receivers: [routing] + exporters: [otlp/prod] +# ... +---- +<1> Connector routing table. +<2> Routing conditions written as OTTL statements. +<3> Destination pipelines for routing the matching telemetry data. +<4> Destination pipelines for routing the telemetry data for which no routing condition is satisfied. +<5> Error-handling mode: The `propagate` value is for logging an error and dropping the payload. The `ignore` value is for ignoring the condition and attempting to match with the next one. The `silent` value is the same as `ignore` but without logging the error. The default is `propagate`. +<6> When set to `true`, the payload is routed only to the first pipeline whose routing condition is met. The default is `false`. diff --git a/modules/otel-connectors-spanmetrics-connector.adoc b/modules/otel-connectors-spanmetrics-connector.adoc new file mode 100644 index 000000000000..c86dd29b0779 --- /dev/null +++ b/modules/otel-connectors-spanmetrics-connector.adoc @@ -0,0 +1,28 @@ +// Module included in the following assemblies: +// +// * observability/otel/otel-collector/otel-collector-connectors.adoc + +:_mod-docs-content-type: REFERENCE +[id="otel-connectors-spanmetrics-connector_{context}"] += Spanmetrics Connector + +[role="_abstract"] +The Spanmetrics Connector aggregates Request, Error, and Duration (R.E.D) OpenTelemetry metrics from span data. + +.OpenTelemetry Collector custom resource with an enabled Spanmetrics Connector +[source,yaml] +---- +# ... + config: + connectors: + spanmetrics: + metrics_flush_interval: 15s # <1> + service: + pipelines: + traces: + exporters: [spanmetrics] + metrics: + receivers: [spanmetrics] +# ... +---- +<1> Defines the flush interval of the generated metrics. Defaults to `15s`. diff --git a/observability/otel/otel-collector/otel-collector-connectors.adoc b/observability/otel/otel-collector/otel-collector-connectors.adoc index 178dbd5b4d37..7579f5646af0 100644 --- a/observability/otel/otel-collector/otel-collector-connectors.adoc +++ b/observability/otel/otel-collector/otel-collector-connectors.adoc @@ -6,226 +6,20 @@ include::_attributes/common-attributes.adoc[] toc::[] +[role="_abstract"] A connector connects two pipelines. It consumes data as an exporter at the end of one pipeline and emits data as a receiver at the start of another pipeline. It can consume and emit data of the same or different data type. It can generate and emit data to summarize the consumed data, or it can merely replicate or route data. Currently, the following General Availability and Technology Preview connectors are available for the {OTELShortName}: -- xref:../../../observability/otel/otel-collector/otel-collector-connectors.adoc#count-connector_otel-collector-connectors[Count Connector] -- xref:../../../observability/otel/otel-collector/otel-collector-connectors.adoc#routing-connector_otel-collector-connectors[Routing Connector] -- xref:../../../observability/otel/otel-collector/otel-collector-connectors.adoc#forward-connector_otel-collector-connectors[Forward Connector] -- xref:../../../observability/otel/otel-collector/otel-collector-connectors.adoc#spanmetrics-connector_otel-collector-connectors[Spanmetrics Connector] +include::modules/otel-connectors-count-connector.adoc[leveloffset=+1] -[id="count-connector_{context}"] -== Count Connector +include::modules/otel-connectors-routing-connector.adoc[leveloffset=+1] -The Count Connector counts trace spans, trace span events, metrics, metric data points, and log records in exporter pipelines. +include::modules/otel-connectors-forward-connector.adoc[leveloffset=+1] -:FeatureName: The Count Connector -include::snippets/technology-preview.adoc[] - -The following are the default metric names: - -* `trace.span.count` -* `trace.span.event.count` -* `metric.count` -* `metric.datapoint.count` -* `log.record.count` - -You can also expose custom metric names. - -.OpenTelemetry Collector custom resource (CR) with an enabled Count Connector -[source,yaml] ----- -# ... - config: - receivers: - otlp: - protocols: - grpc: - endpoint: 0.0.0.0:4317 - exporters: - prometheus: - endpoint: 0.0.0.0:8889 - connectors: - count: {} - service: - pipelines: # <1> - traces/in: - receivers: [otlp] - exporters: [count] # <2> - metrics/out: - receivers: [count] # <3> - exporters: [prometheus] -# ... ----- -<1> It is important to correctly configure the Count Connector as an exporter or receiver in the pipeline and to export the generated metrics to the correct exporter. -<2> The Count Connector is configured to receive spans as an exporter. -<3> The Count Connector is configured to emit generated metrics as a receiver. -+ -[TIP] -==== -If the Count Connector is not generating the expected metrics, you can check whether the OpenTelemetry Collector is receiving the expected spans, metrics, and logs, and whether the telemetry data flow through the Count Connector as expected. You can also use the Debug Exporter to inspect the incoming telemetry data. -==== - -The Count Connector can count telemetry data according to defined conditions and expose those data as metrics when configured by using such fields as `spans`, `spanevents`, `metrics`, `datapoints`, or `logs`. See the next example. - -.Example OpenTelemetry Collector CR for the Count Connector to count spans by conditions -[source,yaml] ----- -# ... - config: - connectors: - count: - spans: # <1> - : # <2> - description: "" - conditions: - - 'attributes["env"] == "dev"' - - 'name == "devevent"' -# ... ----- -<1> In this example, the exposed metric counts spans with the specified conditions. -<2> You can specify a custom metric name such as `cluster.prod.event.count`. -+ -[TIP] -==== -Write conditions correctly and follow the required syntax for attribute matching or telemetry field conditions. Improperly defined conditions are the most likely sources of errors. -==== - -The Count Connector can count telemetry data according to defined attributes when configured by using such fields as `spans`, `spanevents`, `metrics`, `datapoints`, or `logs`. See the next example. The attribute keys are injected into the telemetry data. You must define a value for the `default_value` field for missing attributes. - -.Example OpenTelemetry Collector CR for the Count Connector to count logs by attributes -[source,yaml] ----- -# ... - config: - connectors: - count: - logs: # <1> - : # <2> - description: "" - attributes: - - key: env - default_value: unknown # <3> -# ... ----- -<1> Specifies attributes for logs. -<2> You can specify a custom metric name such as `my.log.count`. -<3> Defines a default value when the attribute is not set. - -[id="routing-connector_{context}"] -== Routing Connector - -The Routing Connector routes logs, metrics, and traces to specified pipelines according to resource attributes and their routing conditions, which are written as OpenTelemetry Transformation Language (OTTL) statements. - -:FeatureName: The Routing Connector -include::snippets/technology-preview.adoc[] - -.OpenTelemetry Collector custom resource with an enabled Routing Connector -[source,yaml] ----- -# ... - config: - connectors: - routing: - table: # <1> - - statement: route() where attributes["X-Tenant"] == "dev" # <2> - pipelines: [traces/dev] # <3> - - statement: route() where attributes["X-Tenant"] == "prod" - pipelines: [traces/prod] - default_pipelines: [traces/dev] # <4> - error_mode: ignore # <5> - match_once: false # <6> - service: - pipelines: - traces/in: - receivers: [otlp] - exporters: [routing] - traces/dev: - receivers: [routing] - exporters: [otlp/dev] - traces/prod: - receivers: [routing] - exporters: [otlp/prod] -# ... ----- -<1> Connector routing table. -<2> Routing conditions written as OTTL statements. -<3> Destination pipelines for routing the matching telemetry data. -<4> Destination pipelines for routing the telemetry data for which no routing condition is satisfied. -<5> Error-handling mode: The `propagate` value is for logging an error and dropping the payload. The `ignore` value is for ignoring the condition and attempting to match with the next one. The `silent` value is the same as `ignore` but without logging the error. The default is `propagate`. -<6> When set to `true`, the payload is routed only to the first pipeline whose routing condition is met. The default is `false`. - -[id="forward-connector_{context}"] -== Forward Connector - -The Forward Connector merges two pipelines of the same type. - -:FeatureName: The Forward Connector -include::snippets/technology-preview.adoc[] - -.OpenTelemetry Collector custom resource with an enabled Forward Connector -[source,yaml] ----- -# ... - config: - receivers: - otlp: - protocols: - grpc: - jaeger: - protocols: - grpc: - processors: - batch: - exporters: - otlp: - endpoint: tempo-simplest-distributor:4317 - tls: - insecure: true - connectors: - forward: {} - service: - pipelines: - traces/regiona: - receivers: [otlp] - processors: [] - exporters: [forward] - traces/regionb: - receivers: [jaeger] - processors: [] - exporters: [forward] - traces: - receivers: [forward] - processors: [batch] - exporters: [otlp] -# ... ----- - -[id="spanmetrics-connector_{context}"] -== Spanmetrics Connector - -The Spanmetrics Connector aggregates Request, Error, and Duration (R.E.D) OpenTelemetry metrics from span data. - -.OpenTelemetry Collector custom resource with an enabled Spanmetrics Connector -[source,yaml] ----- -# ... - config: - connectors: - spanmetrics: - metrics_flush_interval: 15s # <1> - service: - pipelines: - traces: - exporters: [spanmetrics] - metrics: - receivers: [spanmetrics] -# ... ----- -<1> Defines the flush interval of the generated metrics. Defaults to `15s`. +include::modules/otel-connectors-spanmetrics-connector.adoc[leveloffset=+1] [role="_additional-resources"] [id="additional-resources_{context}"] == Additional resources -* link:https://opentelemetry.io/docs/specs/otlp/[OpenTelemetry Protocol (OTLP)] (OpenTelemetry Documentation) +* link:https://opentelemetry.io/docs/specs/otlp/[OpenTelemetry Documentation: OpenTelemetry Protocol (OTLP)]