Skip to content

Latest commit

 

History

History
55 lines (36 loc) · 1.8 KB

README.md

File metadata and controls

55 lines (36 loc) · 1.8 KB

Azure Container App for the OpenTelemetry collector

This repository provides an easy way to get an OpenTelemetry collector running Azure Container Apps.

It uses the standard otel/opentelemetry-collector image, and therefore will always grab the latest.

In addition, this repository uses the Azure Storage Account FileShare functionality to host the config file, and therefore having that config file persist between restarts, and meaning that a custom image and ACR aren't required.

Finally, the process uses Azure Container Apps secrets for the Honeycomb API key, so you can safely store it!

This is all done in a new Resource Group, so you can cleanup the resources at the end pretty easily.

usage

Make sure you're logged into azure and have a subscription selected that you have permission use Azure Container Apps on.

You'll also need the preview extension for Azure Container Apps and the Azure CLI

az extension add -n containerapp --upgrade
az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.OperationalInsights
chmod +x make_collector_app.sh
./make_collector_app.sh <honeycomb api key>

Testing

Using the otel-cli application (Install here) you can hit the new API endpoint.

export OTEL_EXPORTER_OTLP_ENDPOINT=<endpoint from Container app>/v1/traces

e.g.

export OTEL_EXPORTER_OTLP_ENDPOINT=https://collector.blueislan-3d4basfgfe9.uksouth.azurecontainerapps.io/v1/traces

*Note: The CLI assumes that any URI provided is absolute, and therfore v1/traces is required *

You can then push span like this

otel-cli span --service "CLI" \
  --name "OpenTelemetry Collector In Azure Container Apps" \
  --start $(date +%s.%N) \
  --end $(date +%s.%N) \
  --verbose