Categorygithub.com/webdevops/azure-resourcemanager-exporter
modulepackage
0.0.0-20240914190345-f3e517e41a33
Repository: https://github.com/webdevops/azure-resourcemanager-exporter.git
Documentation: pkg.go.dev

# README

Azure ResourceManager Exporter

license DockerHub Quay.io Artifact Hub

Prometheus exporter for Azure information.

Features

  • Uses of official Azure SDK for go

  • Supports all Azure environments (Azure public cloud, Azure governmant cloud, Azure china cloud, ...) via Azure SDK configuration

  • Docker image is based on Google's distroless static image to reduce attack surface (no shell, no other binaries inside image)

  • Available via Docker Hub and Quay (see badges on top)

  • Can run non-root and with readonly root filesystem, doesn't need any capabilities (you can safely use drop: ["All"])

  • Publishes Azure API rate limit metrics (when exporter sends Azure API requests)

useful with additional exporters:

  • azure-resourcegraph-exporter for exporting Azure resource information from Azure ResourceGraph API with custom Kusto queries (get the tags from resources and ResourceGroups with this exporter)
  • azure-metrics-exporter for exporting Azure Monitor metrics
  • azure-keyvault-exporter for exporting Azure KeyVault information (eg expiry date for secrets, certificates and keys)
  • azure-loganalytics-exporter for exporting Azure LogAnalytics workspace information with custom Kusto queries (eg ingestion rate or application error count)

Configuration

Usage:
  azure-resourcemanager-exporter [OPTIONS]

Application Options:
      --log.debug             debug mode [$LOG_DEBUG]
      --log.devel             development mode [$LOG_DEVEL]
      --log.json              Switch log output to json format [$LOG_JSON]
      --config=               Path to config file [$CONFIG]
      --azure.tenant=         Azure tenant id [$AZURE_TENANT_ID]
      --azure.environment=    Azure environment name (default: AZUREPUBLICCLOUD) [$AZURE_ENVIRONMENT]
      --cache.path=           Cache path (to folder, file://path... or azblob://storageaccount.blob.core.windows.net/containername or
                              k8scm://{namespace}/{configmap}}) [$CACHE_PATH]
      --server.bind=          Server address (default: :8080) [$SERVER_BIND]
      --server.timeout.read=  Server read timeout (default: 5s) [$SERVER_TIMEOUT_READ]
      --server.timeout.write= Server write timeout (default: 10s) [$SERVER_TIMEOUT_WRITE]

Help Options:
  -h, --help                  Show this help message

for Azure API authentication (using ENV vars) see https://docs.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication

Config file

see example.yaml

Deprecations/old resource metrics

Please use azure-resourcegraph-exporter for exporting resources. This exporter is using Azure ResourceGraph queries and not wasting Azure API calls for fetching metrics.

azure-resourcegraph-exporter provides a way how metrics can be build by using Kusto queries.

Azure permissions

This exporter needs Reader permissions on subscription level.

Metrics

MetricCollectorDescription
azurerm_statsExporterGeneral exporter stats
azurerm_costs_budget_infoCostsAzure CostManagement bugdet information
azurerm_costs_budget_currentCostsCurrent value of CostManagemnet budget usage
azurerm_costs_budget_limitCostsLimit of CostManagemnet budget
azurerm_costs_budget_usageCostsPercentage of usage of CostManagemnet budget
azurerm_costs_{queryName}CostsCosts query result (see example.yaml)
azurerm_subscription_infoGeneralAzure Subscription details (ID, name, ...)
azurerm_resource_healthHealthAzure Resource health information
azurerm_iam_roleassignment_infoIAMAzure IAM RoleAssignment information
azurerm_iam_roledefinition_infoIAMAzure IAM RoleDefinition information
azurerm_iam_principal_infoIAMAzure IAM Principal information
azurerm_quota_infoQuotaAzure RM quota details (readable name, scope, ...)
azurerm_quota_currentQuotaAzure RM quota current (current value)
azurerm_quota_limitQuotaAzure RM quota limit (maximum limited value)
azurerm_quota_usageQuotaAzure RM quota usage in percent
azurerm_resourcegroup_infoResourceAzure ResourceGroup details (subscriptionID, name, various tags ...)
azurerm_resource_infoResourceAzure Resource information
azurerm_defender_secure_score_percentageDefenderAzure Defender secure score percerntage per Subscription
azurerm_defender_secure_score_maxDefenderThe maximum number of points you can gain by completing all recommendations within a control
azurerm_defender_secure_score_currentDefenderThe current Azure Defender secure score
azurerm_defender_compliance_scoreDefenderAzure Defender compliance score (based on applied Policies)
azurerm_defender_compliance_resourcesDefenderAzure Defender count of compliance resource in assessment
azurerm_defender_advisor_recommendationDefenderAzure Defender recommendations (eg. security findings)
azurerm_graph_app_infoGraphAzureAD graph application information
azurerm_graph_app_tagGraphAzureAD graph application tag
azurerm_graph_app_credentialGraphAzureAD graph application credentials (create,expiry) information
azurerm_graph_serviceprincipal_infoGraphAzureAD graph servicePrincipal information
azurerm_graph_serviceprincipal_tagGraphAzureAD graph servicePrincipal tag
azurerm_graph_serviceprincipal_credentialGraphAzureAD graph servicePrincipal credentials (create,expiry) information
azurerm_publicip_infoPortscanAzure PublicIP information
azurerm_publicip_portscan_statusPortscanStatus of scanned ports (finished scan, elapsed time, updated timestamp)
azurerm_publicip_portscan_portPortscanList of opened ports per IP

ResourceTags handling

see armclient tagmanager documentation

AzureTracing metrics

see armclient tracing documentation

Caching

see prometheus collector cache documentation

# Packages

No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
Define MetricsCollectorAzureRmBudgets struct.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Define MetricsCollectorAzureRmReservation struct.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author