| Status | |
|---|---|
| Stability | development: logs |
| Distributions | [] |
| Issues | |
| Code coverage | |
| Code Owners | @jmacd, @MichaelKatsoulis, @constanca-m |
The Azure Functions receiver is an OpenTelemetry Collector receiver that integrates with Azure Functions as a custom handler. It receives logs from Azure Event Hubs via the Azure Functions runtime and converts them to OpenTelemetry format for further processing and export. The receiver is structured by trigger type (e.g. Event Hub); each trigger can expose multiple log bindings with different encodings.
The receiver is designed to operate as part of an Azure Functions custom handler:
- Azure Functions runtime consumes events from Azure Event Hubs (e.g. separate hubs for logs and metrics).
- The runtime sends HTTP POST requests to the receiver's endpoints (e.g.
/logs,/raw_logs) according to the configured bindings. - The receiver decodes Azure Functions invoke requests containing Event Hub messages.
- Messages are converted to OpenTelemetry format using the encoding extension configured per binding.
- Data is forwarded to the configured pipeline consumers.
The following receiver configuration parameters are supported.
| Name | Type | Description |
|---|---|---|
http |
confighttp.ServerConfig | Required. HTTP server settings (e.g. endpoint: :9090). Typically use FUNCTIONS_CUSTOMHANDLER_PORT. |
auth |
component.ID | Optional. Component ID of the extension that provides Azure authentication (e.g. token credential). |
triggers |
object | Required. Trigger configuration (e.g. Event Hub). At least one trigger with at least one log binding is required. |
triggers.event_hub |
object | Event Hub trigger configuration. Defines log bindings and metadata behavior. |
triggers.event_hub.logs |
list | List of log bindings. Each entry has name (binding name; maps to path /<name>) and encoding (component.ID). Binding names must be unique. |
triggers.event_hub.include_metadata |
bool | Optional. When true, add Azure Functions invoke metadata (e.g. Event Hub partition context) to resource attributes. Default: false. |
The triggers section and at least one trigger with at least one log binding are required for the receiver to register endpoints. Required fields must be set for the receiver to start.
receivers:
azure_functions:
# HTTP server configuration
http:
endpoint: :${env:FUNCTIONS_CUSTOMHANDLER_PORT:-9090}
# Optional: Azure auth extension
auth: azureauth
# Triggers: Event Hub with multiple log bindings, each with its own encoding
triggers:
event_hub:
logs:
- name: logs
encoding: azure_encoding
- name: raw_logs
encoding: azureresourcelogs_encoding
include_metadata: true
extensions:
azureauth:
# Azure auth extension configuration
azure_encoding:
# Encoding extension configuration
azureresourcelogs_encoding:
# Encoding extension configuration
service:
extensions: [azureauth, azure_encoding, azureresourcelogs_encoding]
pipelines:
logs:
receivers: [azure_functions]
exporters: [otlp]- Logs (Primary support) — Logs are decoded using an encoding extension per binding (e.g.
azure_encoding) that converts the binding payload to OpenTelemetry logs. - Metrics (Future consideration)
- Deployed as an Azure Functions custom handler.
- Azure Functions host configuration (
host.json) with custom handler settings. - Event Hub trigger bindings configured in
function.json; binding names should match thetriggers.event_hub.logs[].namevalues (e.g.logs,raw_logs).