Use Edge Delta to Ingest from an OTLP Source

Prepare to consume OTLP traffic.

Overview

The OTLP source node consumes data items directly from OTLP configured data sources. The node is configured with the port that the agent should listen on.

Configure OTLP

To configure the OTLP source node, you must obtain the port number from the OTLP configuration:

  • Instrumentation Libraries: When using the OpenTelemetry SDKs, the port used to emit OTLP logs is part of the exporter configuration. The endpoint (which includes the host and port) is set when setting up the OpenTelemetry exporter within your application code. See Instrument Code using OpenTelemetry.
  • OpenTelemetry Collector: The port number on which the collector should send outgoing OTLP data is specified in the exporter section.
  • Zero-Code Instrumentation Agents: Similar to the instrumentation libraries, auto-instrumentation agents are configured to send data to a specified endpoint. This configuration includes the port number to which OTLP logs will be sent. See Instrument Code using OpenTelemetry.
  • Sidecars: In a Kubernetes environment, a sidecar that runs an instance of the OpenTelemetry Collector is set up using a configuration file, in which you can find the port for the OTLP receiver and exporter.
  • Log Routers and Forwarders: Log routers and forwarders may have plugins or output configurations that support OTLP. Within these configurations,the endpoint is defined, including the port, where the logs should be sent in OTLP format.

Example Collector Configuration

gRPC

In a Kubernetes Environment, you need a service open for the port that the collector will send logs, metrics, and traces to. For example, you can create a ClusterIP service to expose the OTLP port to all the agents running in the cluster.

Note: For non-kubernetes environments with collectors running in the same environment as the agent, such as on a Linux VM, the collectors will be able to communicate directly with the agent’s open OTLP ports.

apiVersion: v1
kind: Service
metadata:
  name: ed-data-supply-svc
  namespace: edgedelta
spec:
  type: ClusterIP
  selector:
    edgedelta/agent-type: processor
  ports:
    - port: 4324
      name: ed-otlp
      protocol: TCP
      targetPort: 4324

You update the Collector configuration with exporters that match the service you created, all for the same port:

    exporters:
      ...
      otlp/ed-data-supply_trace:
        endpoint: 'ed-data-supply-svc.edgedelta:4324'
        tls:
          insecure: true
      otlp/ed-data-supply_metric:
        endpoint: 'ed-data-supply-svc.edgedelta:4324'
        tls:
          insecure: true
      otlp/ed-data-supply_log:
        endpoint: 'ed-data-supply-svc.edgedelta:4324'
        tls:
          insecure: true

Note: gRPC traffic and HTTP are supported by the OTLP source node. Therefore the OTLP type must be set to otlp or otlphttp depending on the type. You also need to specify the protocol parameter.

And you update the Collector’s Pipeline to use the new exporters:

    service:
      extensions:
      - health_check
      pipelines:
        logs:
          exporters:
          ...
          - otlp/ed-data-supply_log
          ...
        metrics:
          exporters:
          ...
          - otlp/ed-data-supply_metric
          ...
        traces:
          exporters:
          ...
          - otlp/ed-data-supply_trace
          ...

HTTP

Instead of using gRPC, this version specifies an HTTP service and explicitly routes different telemetry types. Service Specification exposing port 4324 for HTTP traffic:

apiVersion: v1
kind: Service
metadata:
  name: ed-data-supply-svc
  namespace: edgedelta
spec:
  type: ClusterIP
  selector:
    edgedelta/agent-type: processor
  ports:
    - port: 4324
      name: ed-otlp-http
      protocol: TCP
      targetPort: 4324

You update the Collector configuration with exporters that match the service you created:

exporters:
  otlphttp/ed-data-supply_trace:
    endpoint: "http://ed-data-supply-svc.edgedelta:4324/v1/traces"
    tls:
      insecure: true
  otlphttp/ed-data-supply_metric:
    endpoint: "http://ed-data-supply-svc.edgedelta:4324/v1/metrics"
    tls:
      insecure: true
  otlphttp/ed-data-supply_log:
    endpoint: "http://ed-data-supply-svc.edgedelta:4324/v1/logs"
    tls:
      insecure: true

In this example, each exporter explicitly specifies the correct path for logs, metrics, and traces. This is not required for gRPC.

Next, you update the Collector’s Pipeline to use the new exporters:

service:
  extensions:
    - health_check
  pipelines:
    logs:
      exporters:
        - otlphttp/ed-data-supply_log
    metrics:
      exporters:
        - otlphttp/ed-data-supply_metric
    traces:
      exporters:
        - otlphttp/ed-data-supply_trace

Configure OTLP Source Node

Next you configure an OTLP source node in a pipeline for the port.