RobustPerception / azure_metrics_exporter

Azure metrics exporter for Prometheus
Apache License 2.0
133 stars 69 forks source link

Create a config map #111

Closed lahiruperamune closed 2 years ago

lahiruperamune commented 2 years ago

How can I use a configmap with a Kubernetes deployment when I use https://hub.docker.com/r/robustperception/azure_metrics_exporter image as the deployment? Below code is not working.

apiVersion: v1
kind: ConfigMap
metadata:
  name: az-exporter
data:
  active_directory_authority_url: "https://login.microsoftonline.com/"
  resource_manager_url: "https://management.azure.com/"
  credentials:
    subscription_id: ""
    client_id: ""
    client_secret: ""
    tenant_id: ""

  targets:
    - resource: "azure_resource_id"
      metrics:
      - name: "BytesReceived"
      - name: "BytesSent"
    - resource: "azure_resource_id"
      aggregations:
      - Minimum
      - Maximum
      - Average
      metrics:
      - name: "Http2xx"
      - name: "Http5xx"
    - resource: "azure_resource_id"
      metric_namespace: "Azure.VM.Windows.GuestMetrics"
      metrics:
      - name: 'Process\Thread Count'

  resource_groups:
    - resource_group: "webapps"
      resource_types:
      - "Microsoft.Compute/virtualMachines"
      resource_name_include_re:
      - "testvm.*"
      resource_name_exclude_re:
      - "testvm12"
      metrics:
      - name: "CPU Credits Consumed"

  resource_tags:
    - resource_tag_name: "group"
      resource_tag_value: "tomonitor"
      resource_types:
        - "Microsoft.Compute/virtualMachines"
      metrics:
        - name: "CPU Credits Consumed"