Skip to main content

Azurefunctions Receiver

Status Maintainers: @jmacd, @MichaelKatsoulis, @constanca-m Source: opentelemetry-collector-contrib

Supported Telemetry

Logs

Overview

Overview

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.

How It Works

The receiver is designed to operate as part of an Azure Functions custom handler:
  1. Azure Functions runtime consumes events from Azure Event Hubs (e.g. separate hubs for logs and metrics).
  2. The runtime sends HTTP POST requests to the receiver’s endpoint /logs.
  3. The receiver decodes Azure Functions invoke requests containing Event Hub messages.
  4. Messages are converted to OpenTelemetry format.
  5. Data is forwarded to the configured pipeline consumers.

Configuration

The following receiver configuration parameters are supported.
NameTypeDescription
httpconfighttp.ServerConfigRequired. HTTP server settings (e.g. endpoint: :9090). Typically use FUNCTIONS_CUSTOMHANDLER_PORT.
authcomponent.IDOptional. Component ID of the extension that provides Azure authentication (e.g. token credential).
logs.encodingcomponent.IDRequired. Encoding extension ID for unmarshaling log records.
include_invoke_metadataboolOptional. When true, add Azure Functions invoke metadata to resource attributes. Default: false.
Required fields must be set for the receiver to start.

Example configuration

receivers:
  azure_functions:
    # HTTP server configuration
    http:
      endpoint: :${env:FUNCTIONS_CUSTOMHANDLER_PORT:-9090}

    # Logs configuration
    logs:
      # Encoding extension ID for log unmarshaling
      # Must reference an encoding extension defined in the extensions section
      encoding: azure_encoding

    # Include Azure Functions invoke metadata in resource attributes
    # When enabled, adds partition context and system metadata
    include_invoke_metadata: true

extensions:
  azureauth:
    # Azure auth extension configuration
  azure_encoding:
    # Encoding extension configuration

service:
  extensions: [azureauth, azure_encoding]
  pipelines:
    logs:
      receivers: [azure_functions]
      exporters: [otlp]

Supported Signal Decoders

  • Logs (Primary support) - Logs are decoded using an encoding extension (typically azure_encoding) that converts Azure Resource Logs format to OpenTelemetry logs.
  • Metrics (Future consideration)

Requirements

  • 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.

Configuration

Example Configuration

azure_functions:
  http:
    endpoint: test:123
  auth: azureauth
  logs:
    encoding: azure_encoding

azure_functions/no_auth:
  http:
    endpoint: test:123
  logs:
    encoding: azure_encoding

azure_functions/no_http:
  auth: azureauth
  logs:
    encoding: azure_encoding

azure_functions/missing_logs_encoding:
  auth: azureauth
  http:
    endpoint: test:123

Last generated: 2026-04-13