opentelemetry-collector/connector
OpenTelemetry Bot ab80fb406a
[chore] Prepare release v1.34.0/v0.128.0 (#13180)
The following commands were run to prepare this release:
- make chlog-update VERSION=v1.34.0/v0.128.0
- make prepare-release PREVIOUS_VERSION=1[.]33[.]0
RELEASE_CANDIDATE=1.34.0 MODSET=stable
- make prepare-release PREVIOUS_VERSION=0[.]127[.]0
RELEASE_CANDIDATE=0.128.0 MODSET=beta
2025-06-09 16:08:43 +00:00
..
connectortest [chore] Prepare release v1.34.0/v0.128.0 (#13180) 2025-06-09 16:08:43 +00:00
forwardconnector [chore] Prepare release v1.34.0/v0.128.0 (#13180) 2025-06-09 16:08:43 +00:00
internal [connector,exporter,processor,receiver] Error out on mismatched type (#12381) 2025-02-27 12:24:18 +00:00
xconnector [chore] Prepare release v1.34.0/v0.128.0 (#13180) 2025-06-09 16:08:43 +00:00
Makefile [connector] split connector into its own module (#7897) 2023-06-15 09:53:20 -07:00
README.md fix replace words in doc (#10896) 2024-08-16 15:20:30 +02:00
connector.go [chore] prevent unkeyed literal initialization (#12762) 2025-04-15 08:18:07 +00:00
connector_test.go [chore]: fix testifylint rules (#12791) 2025-04-02 23:10:07 +00:00
go.mod [chore] Prepare release v1.34.0/v0.128.0 (#13180) 2025-06-09 16:08:43 +00:00
go.sum [chore] bump subset of otel-go-contrib packages (#13103) 2025-05-27 16:05:03 +00:00
logs_router.go [chore]: enable perfsprint linter (#11599) 2024-11-05 14:37:07 -08:00
logs_router_test.go [chore]: fix testifylint rules (#12791) 2025-04-02 23:10:07 +00:00
metrics_router.go [component] Refactor to use pipeline.ID and pipeline.Signal (#11204) 2024-09-23 07:38:59 -07:00
metrics_router_test.go [chore]: fix testifylint rules (#12791) 2025-04-02 23:10:07 +00:00
package_test.go [chore] remove unused opencensus code (#9108) 2024-01-30 10:19:42 -08:00
traces_router.go [component] Refactor to use pipeline.ID and pipeline.Signal (#11204) 2024-09-23 07:38:59 -07:00
traces_router_test.go [chore]: fix testifylint rules (#12791) 2025-04-02 23:10:07 +00:00

README.md

Connectors

A connector is both an exporter and receiver. As the name suggests a Connector connects two pipelines: it emits data as an exporter at the end of one pipeline and consumes data as a receiver at the start of another pipeline. It may consume and emit data of the same data type, or of different data types. A connector may generate and emit data to summarize the consumed data, or it may simply replicate or route data.

Supported Data Types

Each type of connector is designed to work with one or more pairs of data types and may only be used to connect pipelines accordingly. (Recall that every pipeline is associated with a single data type, either traces, metrics, or logs.)

For example, the count connector counts traces, metrics, and logs, and reports the counts as a metric. Therefore, it may be used to connect the following types of pipelines.

Exporter Pipeline Type Receiver Pipeline Type
traces metrics
metrics metrics
logs metrics

Another example, the router connector, is useful for routing data onto the appropriate pipeline so that it may be processed in distinct ways and/or exported to an appropriate backend. It does not alter the data it consumes in any ways, nor does it produce any additional data. Therefore, it may be used to connect the following types of pipelines.

Exporter Pipeline Type Receiver Pipeline Type
traces traces
metrics metrics
logs logs

Configuration

Declaration

Connectors are defined within a dedicated connectors section at the top level of the collector config.

The count connector may be used with default settings.

receivers:
  foo:
exporters:
  bar:
connectors:
  count:
  router:

Usage

Recall that a connector is an exporter and a receiver and that each connector MUST be used as both, in separate pipelines.

receivers:
  foo:
exporters:
  bar:
connectors:
  count:
service:
  pipelines:
    traces:
      receivers: [foo]
      exporters: [count]
    metrics:
      receivers: [count]
      exporters: [bar]

Connectors can be used alongside traditional exporters.

receivers:
  foo:
exporters:
  bar/traces_backend:
  bar/metrics_backend:
connectors:
  count:
service:
  pipelines:
    traces:
      receivers: [foo]
      exporters: [bar/traces_backend, count]
    metrics:
      receivers: [count]
      exporters: [bar/metrics_backend]

Connectors can be used alongside traditional receivers.

receivers:
  foo/traces:
  foo/metrics:
exporters:
  bar:
connectors:
  count:
service:
  pipelines:
    traces:
      receivers: [foo/traces]
      exporters: [count]
    metrics:
      receivers: [foo/metrics, count]
      exporters: [bar]

A connector can be an exporter in multiple pipelines.

receivers:
  foo/traces:
  foo/metrics:
  foo/logs:
exporters:
  bar/traces_backend:
  bar/metrics_backend:
  bar/logs_backend:
connectors:
  count:
service:
  pipelines:
    traces:
      receivers: [foo/traces]
      exporters: [bar/traces_backend, count]
    metrics:
      receivers: [foo/metrics]
      exporters: [bar/metrics_backend, count]
    logs:
      receivers: [foo/logs]
      exporters: [bar/logs_backend, count]
    metrics/counts:
      receivers: [count]
      exporters: [bar/metrics_backend]

A connector can be a receiver in multiple pipelines.

receivers:
  foo/traces:
  foo/metrics:
exporters:
  bar/traces_backend:
  bar/metrics_backend:
  bar/metrics_backend/2:
connectors:
  count:
service:
  pipelines:
    traces:
      receivers: [foo/traces]
      exporters: [bar/traces_backend, count]
    metrics:
      receivers: [count]
      exporters: [bar/metrics_backend]
    metrics/2:
      receivers: [count]
      exporters: [bar/metrics_backend/2]

Multiple connectors can be used in sequence.

receivers:
  foo:
exporters:
  bar:
connectors:
  count:
  count/the_counts:
service:
  pipelines:
    traces:
      receivers: [foo]
      exporters: [count]
    metrics:
      receivers: [count]
      exporters: [bar/metrics_backend, count/the_counts]
    metrics/count_the_counts:
      receivers: [count/the_counts]
      exporters: [bar]

A connector can only be used in a pair of pipelines when it supports the combination of Exporter Pipeline Type and Receiver Pipeline Type.

receivers:
  foo:
exporters:
  bar:
connectors:
  count:
service:
  pipelines:
    traces:
      receivers: [foo]
      exporters: [count]
    logs:
      receivers: [count] # Invalid. The count connector does not support traces -> logs.
      exporters: [bar]

Exporter Pipeline Type

The type of pipeline in which a connector is used as an exporter.

Receiver Pipeline Type

The type of pipeline in which the connector is used as a receiver.