Skip to main content
Azure Monitor cannot send diagnostic logs to an HTTPS endpoint directly. Stream them to Azure Event Hubs, and let a small Azure Function post them to the Squasher drain endpoint.

Prerequisites

  • An Azure Event Hubs namespace and event hub.
  • An Azure Function App with the Node.js runtime.
  • An ingest key and the project ID, saved as the app settings SQUASHER_API_KEY and SQUASHER_PROJECT_ID. See Create an ingest key.

Set up the drain

1

Stream the logs to Event Hubs

  1. In the Azure portal, open the resource and select Diagnostic settings under Monitoring.
  2. Select Add diagnostic setting.
  3. Choose the log categories, choose your event hub as the destination, and save.
2

Deploy the forwarder function

Azure sends each batch as an object with a records array. The function turns each record into one JSON line with the fields that Squasher reads.
src/functions/squasher-forwarder.ts
Set EVENT_HUB_CONNECTION to the event hub connection string, and eventHubName to your event hub.

What Squasher keeps from each record

The function decides what Squasher receives. See the drain record format for every field that Squasher reads.

Verify

  1. Cause one error in the Azure resource, or wait for a diagnostic log.
  2. In the function’s logs, check that each run ends without an error.
  3. In Squasher, select Logs in the sidebar. The lines appear with the category as the service. Error lines also appear in Issues.

Limits

  • Azure levels such as Informational are stored as info.
  • Drain records have no environment, so automatic AI triage does not run on their issues.
  • If Squasher answers 429 or 503, the function throws. Add a retry policy to the function so that it sends the batch again.

Next steps

Drain record format

See how Squasher reads every drain record.

OpenTelemetry

Send traces and errors from your Azure apps.