Use Edge Delta to Ingest from an OTLP Source
3 minute read
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.
Note: The node can ingest either logs, metrics (processed as gauges) or traces per endpoint. To ingest logs and metrics, for example, two OTLP source nodes are required with separate endpoints.
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.
- OpenTelemetry Collector: The port number on which the collector should send outgoing OTLP data is specified in the exporter section.
- Auto-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.
- 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
In a Kubernetes Environment, you need a service open for the ports that the collector will send logs, metrics, and traces to. For example, you can create a ClusterIP service to expose the OTLP ports 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-logs
protocol: TCP
targetPort: 4324
- port: 4325
name: ed-otlp-metrics
protocol: TCP
targetPort: 4325
- port: 4326
name: ed-otlp-traces
protocol: TCP
targetPort: 4326
You update the Collector configuration with exporters that match the service you created:
exporters:
...
otlp/ed-data-supply_trace:
endpoint: 'ed-data-supply-svc.edgedelta:4326'
tls:
insecure: true
otlp/ed-data-supply_metric:
endpoint: 'ed-data-supply-svc.edgedelta:4325'
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
orotlphttp
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
...
Next you configure your OTLP source node in a pipeline.