Connectors
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 Red Hat build of OpenTelemetry:
Count Connector
The Count Connector counts trace spans, trace span events, metrics, metric data points, and log records in exporter pipelines.
Important
The Count Connector is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
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.
# ...
config:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
exporters:
prometheus:
endpoint: 0.0.0.0:8889
connectors:
count: {}
service:
pipelines:
traces/in:
receivers: [otlp]
exporters: [count]
metrics/out:
receivers: [count]
exporters: [prometheus]
# ...
- 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.
- The Count Connector is configured to receive spans as an exporter.
- 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.
# ...
config:
connectors:
count:
spans:
<custom_metric_name>:
description: "<custom_metric_description>"
conditions:
- 'attributes["env"] == "dev"'
- 'name == "devevent"'
# ...
- In this example, the exposed metric counts spans with the specified conditions.
- 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.
# ...
config:
connectors:
count:
logs:
<custom_metric_name>:
description: "<custom_metric_description>"
attributes:
- key: env
default_value: unknown
# ...
- Specifies attributes for logs.
- You can specify a custom metric name such as
my.log.count. - Defines a default value when the attribute is not set.
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.
Important
The Routing Connector is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
# ...
config:
connectors:
routing:
table:
- statement: route() where attributes["X-Tenant"] == "dev"
pipelines: [traces/dev]
- statement: route() where attributes["X-Tenant"] == "prod"
pipelines: [traces/prod]
default_pipelines: [traces/dev]
error_mode: ignore
match_once: false
service:
pipelines:
traces/in:
receivers: [otlp]
exporters: [routing]
traces/dev:
receivers: [routing]
exporters: [otlp/dev]
traces/prod:
receivers: [routing]
exporters: [otlp/prod]
# ...
- Connector routing table.
- Routing conditions written as OTTL statements.
- Destination pipelines for routing the matching telemetry data.
- Destination pipelines for routing the telemetry data for which no routing condition is satisfied.
- Error-handling mode: The
propagatevalue is for logging an error and dropping the payload. Theignorevalue is for ignoring the condition and attempting to match with the next one. Thesilentvalue is the same asignorebut without logging the error. The default ispropagate. - When set to
true, the payload is routed only to the first pipeline whose routing condition is met. The default isfalse.
Forward Connector
The Forward Connector merges two pipelines of the same type.
Important
The Forward Connector is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
# ...
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]
# ...
Spanmetrics Connector
The Spanmetrics Connector aggregates Request, Error, and Duration (R.E.D) OpenTelemetry metrics from span data.
# ...
config:
connectors:
spanmetrics:
metrics_flush_interval: 15s
service:
pipelines:
traces:
exporters: [spanmetrics]
metrics:
receivers: [spanmetrics]
# ...
- Defines the flush interval of the generated metrics. Defaults to
15s.