OpenTelemetry Support
...
Service Integration Guides
Azure Monitoring
Auto-Integration with Azure Monitor (Azure CLI Access required)
8min
this document provides an automated approach to integrating azure monitor with kloudmate using the opentelemetry receiver the azure monitor opentelemetry receiver allows you to scrape telemetry data from azure monitor resources and send them to kloudmate for centralized monitoring and analysis prerequisites ensure the following prerequisites are met before proceeding azure cli installed on your linux system an azure user with the following roles user access administrator contributor this process will create a small azure virtual machine (vm) and integrate opentelemetry for monitoring before proceeding, ensure that you have the necessary permissions and resources available resources that will be created during this process, the following resources will be provisioned azure ad application a microsoft entra id app with a service principal assigned the reader role for the specified subscription virtual machine configuration vm type standard b2s os image ubuntu 22 04 disk size 30 gb location east us step 1 login to azure login to your azure account using the azure cli az login step 2 create the integration script 1\ create a file named azure kloudmate sh and paste the following content inside it vim azure kloudmate sh 2\ paste the following script into the file \#!/bin/bash \# check if app name is provided if \[ z "$1" ] || \[ z "$2" ]; then echo "usage $0 \<app name> \<subscription id>" exit 1 fi app name="$1" role="reader" \# get subscription & tenant id subscription id="$2" tenant id=$(az account show query tenantid output tsv) \# register an app in azure ad echo "creating azure ad app $app name " app details=$(az ad app create display name "$app name" query "{appid appid, objectid id}" output json) client id=$(echo "$app details" | grep o '"appid" "\[^"] ' | cut d'"' f4) object id=$(echo "$app details" | grep o '"id" "\[^"] ' | cut d'"' f4) \# create a client secret echo "creating client secret " secret details=$(az ad app credential reset id "$client id" query "{password password}" output json) client secret=$(echo "$secret details" | grep o '"password" "\[^"] ' | cut d'"' f4) \# create a service principal for the app echo "creating service principal " az ad sp create id "$client id" output none \# assign reader role to the app echo "assigning reader role to the app " az role assignment create assignee "$client id" role "$role" scope "/subscriptions/$subscription id" \# output the credentials echo "===========================" echo "app registration completed!" echo "app name $app name" echo "client id $client id" echo "tenant id $tenant id" echo "subscription id $subscription id" echo "client secret (save it securely!) $client secret" echo "===========================" read p "enter resource group name " resource group read p "enter vm admin username " admin user read s p "enter vm admin password " admin password read p "enter kloudmate auth key " auth key echo "" vm name="otel vm demo" location="eastus" image="ubuntu2204" size="standard b2s" cloud init file="cloud init yaml" cat <\<eof > "$cloud init file" \#cloud config package update true package upgrade true runcmd \ wget https //github com/open telemetry/opentelemetry collector releases/releases/download/v0 120 0/otelcol contrib 0 120 0 linux amd64 deb \ sudo dpkg i otelcol contrib 0 120 0 linux amd64 deb \ sudo systemctl enable otelcol contrib \ sudo systemctl start otelcol contrib \ echo "updating opentelemetry config " \ sudo systemctl restart otelcol contrib write files \ path /etc/otelcol contrib/otelcol contrib conf content | otelcol options=" config=/etc/otelcol contrib/config yaml" subscription id=${subscription id} tenant id=${tenant id} client id=${client id} client secret=${client secret} auth key=${auth key} \ path /etc/otelcol contrib/config yaml content | extensions health check pprof endpoint 0 0 0 0 1777 zpages endpoint 0 0 0 0 55679 receivers otlp protocols grpc endpoint 0 0 0 0 4317 http endpoint 0 0 0 0 4318 azuremonitor subscription id ${subscription id} tenant id ${tenant id} client id ${client id} client secret ${client secret} cloud azurecloud collection interval 60s initial delay 1s processors batch send batch size 10000 timeout 30s exporters debug verbosity detailed otlphttp endpoint "https //otel kloudmate com 4318" headers authorization ${auth key} # replace with your actual kloudmate authentication key service pipelines metrics receivers \[otlp, azuremonitor] processors \[batch] exporters \[debug, otlphttp] extensions \[health check, pprof, zpages] eof echo "creating azure vm $vm name " az vm create resource group "$resource group" name "$vm name" image "$image" size "$size" admin username "$admin user" admin password "$admin password" custom data "$cloud init file" 3\ make the script executable and run it chmod +x azure kloudmate sh 4\ execute the script with the required parameters /azure kloudmate sh \<app name> \<subscription id> 5\ follow the on screen instructions to complete the setup step 3 verify azure metrics in kloudmate after completing the setup, follow these steps to confirm that kloudmate is receiving azure metrics log into your kloudmate account navigate to explorer or dashboards filter for azure specific metrics if data is flowing correctly, you should see the metrics appearing in real time troubleshoot if no data appears recheck your azure monitor configuration ensure the required permissions are set correctly