Azure VM
Required Azure VM Attributes
The following cost calculation tags are required for traces originating from Azure Virtual Machines.
Always Required Fields
These fields are always required for Azure VM cost calculation. Traces missing any of these attributes cannot be priced and will be skipped:
| Attribute Name | Example Value | Allowed Values |
|---|---|---|
azure.vm.service_name | Virtual Machines | Literal string: Virtual Machines |
azure.vm.location | eastus | Azure region code (e.g., eastus, westus2, uksouth) |
azure.vm.size | Standard_D2s_v3 | Azure VM size SKU (e.g., Standard_D2s_v3, Standard_E8s_v3) |
azure.vm.os_type | Linux | Linux or Windows (affects regional pricing) |
azure.vm.priority | Regular | Regular, Low, or Spot (Spot pricing is significantly lower) |
Cost Calculation
Azure VMs are priced at an hourly rate. Beakpoint calculates span-level cost using this formula:
cost = hourly_rate × (span_duration_seconds / 3600)
Hourly rates vary by region (azure.vm.location), VM size (azure.vm.size), OS type (azure.vm.os_type), and priority tier (azure.vm.priority). Spot VMs typically cost 70-90% less than Regular pricing.
Overlapping Spans (Time-Sharing)
When multiple spans run concurrently on the same VM instance (identified by the combination of size + os_type + priority in the same region), Beakpoint distributes the VM's hourly cost proportionally across all overlapping spans based on their duration.
Example: Two spans overlap on a Standard_D2s_v3 Linux VM for 60 seconds total. Span A runs for 40 seconds, Span B for 20 seconds. If the hourly rate is $0.096:
- Span A: $0.096 × (40s / 3600s) = $0.00107
- Span B: $0.096 × (20s / 3600s) = $0.00053
Spans on different VM instances are priced independently without sharing.
Example Configuration
Set these as OpenTelemetry resource attributes in your application. You can configure them via environment variables or programmatically:
Environment variable approach:
OTEL_RESOURCE_ATTRIBUTES: "azure.vm.service_name=Virtual Machines,azure.vm.location=eastus,azure.vm.size=Standard_D2s_v3,azure.vm.os_type=Linux,azure.vm.priority=Regular"
Recommended values:
- Detect
azure.vm.locationandazure.vm.sizefrom Azure Instance Metadata Service at runtime for accuracy - Set
azure.vm.os_typebased on the deployed OS (read from/etc/os-releaseon Linux, registry on Windows) - Set
azure.vm.prioritybased on your VM's procurement model (check VM properties in Azure Portal)
Validation checklist:
- All 5 required attributes must be present before spans are collected
- Region values must match Azure's official region codes
- Size values must match exactly to Azure's SKU naming (e.g.,
Standard_D2s_v3, notd2s_v3)