Skip to content

Metrics Not Emitted When Timeseries Has No Dimensions #113

@mshah07

Description

@mshah07

Bug: Metrics Not Emitted When Timeseries Has No Dimensions

Exporter Version:
v25.5.0

Azure Resource Type:
Microsoft.Network/virtualNetworkGateways

Example Metrics:

  • TunnelIngressPackets
  • TunnelEgressPackets

🐛 Problem

The exporter receives data from Azure Monitor (verified via az monitor metrics list), but the response contains no metadatavalues, i.e., no dimensions.
Despite valid data (non-zero totals), the exporter emits no Prometheus metrics — response is always 200 OK with Content-Length: 0.


✅ Repro Steps

  1. Deployed azure-metrics-exporter with:

    args:
      - --server.bind=:9276
      - --metrics.template={name}
  2. Verified Azure CLI returns valid metric data:

    az monitor metrics list \
      --resource <resourceId> \
      --metric TunnelIngressPackets \
      --aggregation Total
  3. Probed the exporter:

    curl "http://localhost:9276/probe/metrics?aggregation=total&interval=PT5M&metric=TunnelIngressPackets&name=custom&resource=<full-resource-id>&resourceType=Microsoft.Network/virtualNetworkGateways&subscription=<subscription-id>&timespan=PT1H"
  4. Exporter logs show request handled with status 200, but Prometheus output is empty.

  5. Also tested:

    • Removing config.yaml
    • Using name=custom
    • Adding --metrics.template={name}

🤔 Expected Behavior

Exporter should emit flat Prometheus metrics even if Azure Monitor omits dimensions (metadatavalues[] is empty).


❌ Actual Behavior

Exporter silently skips these metrics. Only metrics with dimensions are emitted.


📎 Azure CLI Response Sample

"timeseries": [
  {
    "data": [
      {
        "timeStamp": "2025-05-08T11:14:00Z",
        "total": 64144.0
      }
    ],
    "metadatavalues": []
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions