question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Promitor scraper fails to find resource mapping for Microsoft.Network

See original GitHub issue

Report

The promitor scraper seems to be unable to fetch the NetworkInterface Metrics in Azure Monitor

Expected Behavior

Scraping NetworkInterface Metrics from Azure Monitor

Actual Behavior

Fatal log msgs in promitor scraper Failed to find resource mapping for provider: Microsoft.Network, resourceType: networkInterfaces

Steps to Reproduce the Problem

  1. Configure NetworkInterface ResourceDiscoveryGroup in promitor discovery agent
  2. Scrape Metrics from NetworkInterface ind promitor agent scraper through ResourceDiscoveryGrooup

Component

Scraper

Version

2.7.3

Configuration

Configuration:

---
repositories:
  - name: promitor
    url: https://charts.promitor.io/
  - name: bedag
    url: https://bedag.github.io/helm-charts

releases:
  - name: promitor-scraper
    namespace: promitor
    chart: promitor/promitor-agent-scraper
    values:
      - azureAuthentication:
          mode: UserAssignedManagedIdentity
          identity:
            id: {{ exec "terraform" (list "-chdir=../.." "output" "-json" "promitor_scraper_client_id") }}
            binding: promitor-scraper-identity
      - azureMetadata:
          tenantId: {{ requiredEnv "ARM_TENANT_ID" }}
          subscriptionId: {{ requiredEnv "ARM_SUBSCRIPTION_ID" }}
          resourceGroupName: REDACTED
      - resourceDiscovery:
          enabled: true
          host: promitor-agent-resource-discovery
          port: 8889
      - metricSinks:
          prometheusScrapingEndpoint:
            enabled: true
            serviceMonitor:
              enabled : true
              namespace: promitor
          enableServiceDiscovery: true
      - metrics:
          - name: azure_network_interface_bytes_received_rate
            description: "Number of bytes the Network Interface received."
            resourceType: NetworkInterface
            azureMetricConfiguration:
              metricName: BytesReceivedRate
              aggregation:
                type: Total
            resourceDiscoveryGroups:
              - name: network-interfaces-landscape
          - name: azure_network_interface_bytes_sent_rate
            description: "Number of bytes the Network Interface sent."
            resourceType: NetworkInterface
            azureMetricConfiguration:
              metricName: BytesSentRate
              aggregation:
                type: Total
            resourceDiscoveryGroups:
              - name: network-interfaces-landscape
          - name: azure_network_interface_packets_received_rate
            description: "Number of packets the Network Interface received."
            resourceType: NetworkInterface
            azureMetricConfiguration:
              metricName: PacketsReceivedRate
              aggregation:
                type: Total
            resourceDiscoveryGroups:
              - name: network-interfaces-landscape
          - name: azure_network_interface_packets_sent_rate
            description: "Number of packets the Network Interface sent."
            resourceType: NetworkInterface
            azureMetricConfiguration:
              metricName: PacketsSentRate
              aggregation:
                type: Total
            resourceDiscoveryGroups:
              - name: network-interfaces-landscape
      - tolerations:
          - key: "CriticalAddonsOnly"
            operator: "Exists"
            effect: "NoSchedule"
  - name: promitor-discovery
    namespace: promitor
    chart: promitor/promitor-agent-resource-discovery
    values:
      - azureAuthentication:
          mode: UserAssignedManagedIdentity
          identity:
            id: {{ exec "terraform" (list "-chdir=../.." "output" "-json" "promitor_discovery_client_id") }}
            binding: promitor-discovery-identity
      - azureLandscape:
          cloud: Global
          tenantId: {{ requiredEnv "ARM_TENANT_ID" }}
          subscriptions:
            - {{ requiredEnv "ARM_SUBSCRIPTION_ID" }}
      - prometheus:
          serviceMonitor:
            enabled: true
            namespace: promitor
      - resourceDiscoveryGroups:
          - name: network-interfaces-landscape
            type: NetworkInterface
      - tolerations:
          - key: "CriticalAddonsOnly"
            operator: "Exists"
            effect: "NoSchedule"
  - name: promitor-scraper-identity
    namespace: promitor
    chart: ../../charts/azure-identity
    values:
      - identityName: promitor-scraper-identity
      - resourceId: {{ exec "terraform" (list "-chdir=../.." "output" "-json" "promitor_scraper_resource_id") }}
      - clientId: {{ exec "terraform" (list "-chdir=../.." "output" "-json" "promitor_scraper_client_id") }}
      - selector: promitor-scraper-identity
  - name: promitor-discovery-identity
    namespace: promitor
    chart: ../../charts/azure-identity
    values:
      - identityName: promitor-discovery-identity
      - resourceId: {{ exec "terraform" (list "-chdir=../.." "output" "-json" "promitor_discovery_resource_id") }}
      - clientId: {{ exec "terraform" (list "-chdir=../.." "output" "-json" "promitor_discovery_client_id") }}
      - selector: promitor-discovery-identity

Logs

2022-04-28T08:10:05.445290049Z stdout F [08:10:05 FTL] NotFound: Failed to find resource mapping for provider: Microsoft.Network, resourceType: networkInterfaces, id: /subscriptions/{SUBSCRIPTIONID}/resourceGroups/{RESOURCEGROUP}/providers/Microsoft.Network/networkInterfaces/{PODNAME}.nic.ee13ddf1-772a-4855-822a-a5ba2be2a9ea, traceId: {600df2dd-b4fb-46f5-85b3-f241561f791c}
2022-04-28T08:10:04.545832034Z stdout F [08:10:04 FTL] NotFound: Failed to find resource mapping for provider: Microsoft.Network, resourceType: networkInterfaces, id: /subscriptions/{SUBSCRIPTIONID}/resourceGroups/{RESOURCEGROUP}/providers/Microsoft.Network/networkInterfaces/{PODNAME}.nic.c88992f6-5ecd-44d1-b332-84795d619807, traceId: {be611765-5fbd-4b71-aafd-01e0a4e814e4}
2022-04-28T08:10:03.869797215Z stdout F [08:10:03 FTL] NotFound: Failed to find resource mapping for provider: Microsoft.Network, resourceType: networkInterfaces, id: /subscriptions/{SUBSCRIPTIONID}/resourceGroups/{RESOURCEGROUP}/providers/Microsoft.Network/networkInterfaces/{PODNAME}.nic.327f47ff-6dae-4bd9-9cca-729917de5d40, traceId: {8f662120-c90c-478e-bc4b-b6b7f9bf6cf5}
2022-04-28T08:10:03.838297078Z stdout F [08:10:03 FTL] NotFound: Failed to find resource mapping for provider: Microsoft.Network, resourceType: networkInterfaces, id: /subscriptions/{SUBSCRIPTIONID}/resourceGroups/{RESOURCEGROUP}/providers/Microsoft.Network/networkInterfaces/{PODNAME}.nic.81f30dfd-cfeb-46d9-aae9-5cb99f7355bd, traceId: {726b500d-7b77-42f2-90c3-4e49deae33d2}
2022-04-28T08:10:03.740632441Z stdout F [08:10:03 FTL] NotFound: Failed to find resource mapping for provider: Microsoft.Network, resourceType: networkInterfaces, id: /subscriptions/{SUBSCRIPTIONID}/resourceGroups/{RESOURCEGROUP}/providers/Microsoft.Network/networkInterfaces/{PODNAME}.nic.c88992f6-5ecd-44d1-b332-84795d619807, traceId: {de2b765a-bbe8-4575-b02b-bcfe05f55a81}
2022-04-28T08:10:03.612416274Z stdout F [08:10:03 FTL] NotFound: Failed to find resource mapping for provider: Microsoft.Network, resourceType: networkInterfaces, id: /subscriptions/{SUBSCRIPTIONID}/resourceGroups/{RESOURCEGROUP}/providers/Microsoft.Network/networkInterfaces/{PODNAME}.nic.ac66fc98-779a-421e-a4fe-98736cc3d489, traceId: {8c173ef7-156e-46c2-b617-322f5b107361}

Platform

Microsoft Azure

Contact Details

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
tomkerkhovecommented, May 5, 2022

Hm that looks pretty straightforward. I’ll need to try to reproduce this, sorry.

0reactions
amirschwcommented, Mar 6, 2023

I wonder if migrating to the new Azure SDKs might help - https://github.com/tomkerkhove/promitor/issues/2209

Read more comments on GitHub >

github_iconTop Results From Across the Web

azure-mgmt-monitor: Failed to find resource mapping for ...
I'm trying to retrieve disk metrics via: metrics_data = monitor_client.metrics.list( disk['managed_by'], timespan="{}/{}".format( ...
Read more >
Frequently Asked Questions
Yes, every scraper supports scraping multi-dimensional metrics except for Azure ... Promitor will automatically discover all matching resources which means ...
Read more >
Troubleshoot collection of Prometheus metrics in Azure ...
Follow the steps in this article to determine the cause of Prometheus metrics not being collected as expected in Azure Monitor.
Read more >
promitor-agent-scraper 2.10.1
Introduction. This chart bootstraps a Promitor Scraper Agent deployment on a Kubernetes cluster using the Helm package manager. It will provide the scraper...
Read more >
Mounting Volumes on Azure Web App for Containers - Codit
Open the Azure Portal, go to “Create a resource” and search for “Web App for Containers”. Once created, you'll see that the app...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found