Skip to main content

Opencensus Receiver

Status Source: opentelemetry-collector-contrib

Overview

Status
Stabilitybeta
Supported pipeline typestraces, metrics
Distributionscore, contrib
Receives data via gRPC or HTTP using OpenCensus format.

Getting Started

All that is required to enable the OpenCensus receiver is to include it in the receiver definitions.
receivers:
  opencensus:
The following settings are configurable:

Advanced Configuration

Several helper files are leveraged to provide additional capabilities automatically:

Writing with HTTP/JSON

The OpenCensus receiver can receive trace export calls via HTTP/JSON in addition to gRPC. The HTTP/JSON address is the same as gRPC as the protocol is recognized and processed accordingly. To write traces with HTTP/JSON, POST to [address]/v1/trace. The JSON message format parallels the gRPC protobuf format, see this OpenApi spec for it. The HTTP/JSON endpoint can also optionally configure CORS, which is enabled by specifying a list of allowed CORS origins in the cors_allowed_origins field:
receivers:
  opencensus:
    cors_allowed_origins:
    - http://test.com
    # Origins can have wildcards with *, use * by itself to match any origin.
    - https://*.example.com

Configuration

Example Configuration

# The following entry initializes the default OpenCensus receiver.
# The default values are specified here
# https://github.com/open-telemetry/opentelemetry-collector/blob/71589202609d7e787244076b631b45e219101867/receiver/opencensusreceiver/factory.go#L47-L56
# The full name of this receiver is `opencensus` and can be referenced in pipelines by 'opencensus'.
opencensus:
# The following entry demonstrates configuring the common receiver settings:
# - endpoint
# This configuration is of type 'opencensus' and has the name 'customname' with a full name of 'opencensus/customname'
# ('<type>/<name>'. To reference this configuration in a pipeline, use the full name `opencensus/customname`.
opencensus/customname:
  # The receiver will listen on endpoint: "0.0.0.0:9090".
  endpoint: 0.0.0.0:9090
# The following entry configures all of the keep alive settings. These settings are used to configure the receiver.
opencensus/keepalive:
  keepalive:
    server_parameters:
      max_connection_idle: 11s
      max_connection_age: 12s
      max_connection_age_grace: 13s
      time: 30s
      timeout: 5s
    enforcement_policy:
      min_time: 10s
      permit_without_stream: true
# The following demonstrates how to set maximum limits on stream, message size and connection idle time.
# Note: The test yaml has demonstrated configuration on a grouped by their structure; however, all of the settings can
# be mix and matched like adding the maximum connection idle setting in this example.
opencensus/msg-size-conc-connect-max-idle:
  max_recv_msg_size_mib: 32
  max_concurrent_streams: 16
  read_buffer_size: 1024
  write_buffer_size: 1024
  keepalive:
    server_parameters:
      max_connection_idle: 10s
# The following entry demonstrates how to specify TLS credentials for the server.
# Note: These files do not exist. If the receiver is started with this configuration, it will fail.
opencensus/tlscredentials:
  tls:
    cert_file: test.crt
    key_file: test.key
# The following entry demonstrates how to specify a Unix Domain Socket for the server.
opencensus/uds:
  transport: unix
  endpoint: /tmp/opencensus.sock
# The following entry demonstrates how to configure the OpenCensus receiver to allow Cross-Origin Resource Sharing (CORS).
# Both fully qualified domain names and the use of wildcards are supported.
opencensus/cors:
  cors_allowed_origins:
    - https://*.test.com # Wildcard subdomain. Allows domains like https://www.test.com and https://foo.test.com but not https://wwwtest.com.
    - https://test.com # Fully qualified domain name. Allows https://test.com only.

Last generated: 2026-04-14