How to add vFunction to the DataDog Distribution of OpenTelemetry Collector
Overview
The steps below show how to add vFunction’s Observability of a Distributed Application via an existing DataDog Collector instead of using the Open-Source OpenTelemetry (OTel) Collector. This workflow is ideal for organizations that already use the DataDog Collector and are adding vFunction’s Observability to their infrastructure.
The DataDog Distribution of the OpenTelemetry (DDOT) Collector was developed by the DataDog team to use OTel in an optimized manner for performance and reliability with DataDog. This Collector supports the ability to add additional third-party components, such as vFunction or other OTel vendors. For more information about the DataDog Collector, see DataDog’s documentation here.
Prerequisites
- DDOT Collector
- An Application sending data to the DDOT Collector
- A vFunction Server installed
- The UUID from a Distributed Application that was created in the vFunction Server UI
- Log into the vFunction Server UI after the installation has completed
- Automatically, the UI should launch the Create Application dialog box. If the dialog box is not automatically launched, click the dropdown arrow in the top-left corner of the UI and select Add Application
- Toggle the Application Type to Distributed
- Add an Application Name in the text field
- Click the blue Create button
- A dialog box will dispaly with Installation Instructions
- Find the OTEL_EXPORTER_OTLP_HEADERS Environment Variable within the dialog box. It will include the X-VF-APP and an Application UUID. This Application UUID will be used during the DDOT Collector configuration
Steps to implement vFunction on the DataDog Collector
The DDOT Collector includes a manifest.yaml that, by default, adds OTel’s otlphttp Exporter which is required by vFunction. No additional modifications to this manifest are required by vFunction.
The OTel Configuration File will need to be modified for vFunction to work. Typically, these settings will be included in the datadog-agent.yaml or the otel-config.yaml that are deployed either via the DataDog Operator or Helm Charts:
After Adding vFunction
### Find-and-replace _VF_SERVER_ADDRESS_ with the actual address
### Find-and-replace _VF_APP_UUID_ with the actual value. See the Prerequisites section for more details on finding this value
receivers:
otlp:
protocols:
http:
endpoint: "0.0.0.0:4318"
grpc:
endpoint: "0.0.0.0:4317"
processors:
batch:
send_batch_max_size: 1000
send_batch_size: 100
timeout: 10s
# Rename system.cpu.usage to system.cpu.usage_time
metricstransform:
transforms:
- include: system.cpu.usage
action: update
new_name: system.cpu.usage_time
exporters:
datadog:
api:
site: ${env:DD_SITE}
key: ${env:DD_API_KEY}
### The snippet below was added for vFunction
otlphttp/vf:
endpoint: https://_VF_SERVER_ADDRESS_/api/unauth/otlp
headers:
X-VF-APP: _VF_APP_UUID_
connectors:
datadog/connector:
traces:
service:
pipelines:
traces:
receivers: [otlp]
processors: [infraattributes, batch]
### The line below was modified for vFunction
exporters: [datadog, datadog/connector, otlphttp/vf]
metrics:
receivers: [otlp, datadog/connector, prometheus]
processors: [metricstransform, infraattributes, batch]
exporters: [datadog]
logs:
receivers: [otlp]
processors: [infraattributes, batch]
exporters: [datadog]