Skip to content

Commit bf5a208

Browse files
committed
update readme
Signed-off-by: Markus Blaschke <[email protected]>
1 parent f6bf270 commit bf5a208

File tree

1 file changed

+50
-48
lines changed

1 file changed

+50
-48
lines changed

README.md

Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ TOC:
2020
- [template `{name}_{metric}_{unit}`](#template-name_metric_unit)
2121
- [template `{name}_{metric}_{aggregation}_{unit}`](#template-name_metric_aggregation_unit)
2222
* [HTTP Endpoints](#http-endpoints)
23+
+ [/probe/metrics parameters](#probemetrics-parameters)
2324
+ [/probe/metrics/resource parameters](#probemetricsresource-parameters)
2425
+ [/probe/metrics/list parameters](#probemetricslist-parameters)
2526
+ [/probe/metrics/scrape parameters](#probemetricsscrape-parameters)
@@ -66,18 +67,16 @@ Usage:
6667
6768
Application Options:
6869
--log.debug debug mode [$LOG_DEBUG]
69-
--log.trace trace mode [$LOG_TRACE]
70+
--log.devel development mode [$LOG_DEVEL]
7071
--log.json Switch log output to json format [$LOG_JSON]
7172
--azure-environment= Azure environment name (default: AZUREPUBLICCLOUD) [$AZURE_ENVIRONMENT]
72-
--azure-ad-resource-url= Specifies the AAD resource ID to use. If not set, it defaults to
73-
ResourceManagerEndpoint for operations with Azure Resource Manager
74-
[$AZURE_AD_RESOURCE]
75-
--azure.servicediscovery.cache= Duration for caching Azure ServiceDiscovery of workspaces to reduce API calls
76-
(time.Duration) (default: 30m) [$AZURE_SERVICEDISCOVERY_CACHE]
73+
--azure-ad-resource-url= Specifies the AAD resource ID to use. If not set, it defaults to ResourceManagerEndpoint for
74+
operations with Azure Resource Manager [$AZURE_AD_RESOURCE]
75+
--azure.servicediscovery.cache= Duration for caching Azure ServiceDiscovery of workspaces to reduce API calls (time.Duration)
76+
(default: 30m) [$AZURE_SERVICEDISCOVERY_CACHE]
7777
--azure.resource-tag= Azure Resource tags (space delimiter) (default: owner) [$AZURE_RESOURCE_TAG]
7878
--metrics.template= Template for metric name (default: {name}) [$METRIC_TEMPLATE]
79-
--metrics.help= Metric help (with template support) (default: Azure monitor insight metric)
80-
[$METRIC_HELP]
79+
--metrics.help= Metric help (with template support) (default: Azure monitor insight metric) [$METRIC_HELP]
8180
--concurrency.subscription= Concurrent subscription fetches (default: 5) [$CONCURRENCY_SUBSCRIPTION]
8281
--concurrency.subscription.resource= Concurrent requests per resource (inside subscription requests) (default: 10)
8382
[$CONCURRENCY_SUBSCRIPTION_RESOURCE]
@@ -111,38 +110,14 @@ webui is available under url `/query`
111110
| `azurerm_api_ratelimit` | Azure ratelimit metrics (only on /metrics, resets after query) |
112111
| `azurerm_api_request_*` | Azure request count and latency as histogram |
113112

114-
## AzureTracing metrics
113+
### ResourceTags handling
115114

116-
(with 22.2.0 and later)
115+
see [armclient tagmanager documentation](https://github.com/webdevops/go-common/blob/main/azuresdk/README.md#tag-manager)
117116

118-
Azuretracing metrics collects latency and latency from azure-sdk-for-go and creates metrics and is controllable using
119-
environment variables (eg. setting buckets, disabling metrics or disable autoreset).
117+
### AzureTracing metrics
120118

121-
| Metric | Description |
122-
|------------------------------------------|----------------------------------------------------------------------------------------|
123-
| `azurerm_api_ratelimit` | Azure ratelimit metrics (only on /metrics, resets after query due to limited validity) |
124-
| `azurerm_api_request_*` | Azure request count and latency as histogram |
125-
126-
### Settings
127-
128-
| Environment variable | Example | Description |
129-
|------------------------------------------|------------------------------------|----------------------------------------------------------------|
130-
| `METRIC_AZURERM_API_REQUEST_BUCKETS` | `1, 2.5, 5, 10, 30, 60, 90, 120` | Sets buckets for `azurerm_api_request` histogram metric |
131-
| `METRIC_AZURERM_API_REQUEST_ENABLE` | `false` | Enables/disables `azurerm_api_request_*` metric |
132-
| `METRIC_AZURERM_API_REQUEST_LABELS` | `apiEndpoint, method, statusCode` | Controls labels of `azurerm_api_request_*` metric |
133-
| `METRIC_AZURERM_API_RATELIMIT_ENABLE` | `false` | Enables/disables `azurerm_api_ratelimit` metric |
134-
| `METRIC_AZURERM_API_RATELIMIT_AUTORESET` | `false` | Enables/disables `azurerm_api_ratelimit` autoreset after fetch |
135-
136-
137-
| `azurerm_api_request` label | Status | Description |
138-
|-----------------------------|--------------------|----------------------------------------------------------------------------------------------------------|
139-
| `apiEndpoint` | enabled by default | hostname of endpoint (max 3 parts) |
140-
| `routingRegion` | enabled by default | detected region for API call, either routing region from Azure Management API or Azure resource location |
141-
| `subscriptionID` | enabled by default | detected subscriptionID |
142-
| `tenantID` | enabled by default | detected tenantID (extracted from jwt auth token) |
143-
| `resourceProvider` | enabled by default | detected Azure Management API provider |
144-
| `method` | enabled by default | HTTP method |
145-
| `statusCode` | enabled by default | HTTP status code |
119+
see [armclient tracing documentation](https://github.com/webdevops/go-common/blob/main/azuresdk/README.md#azuretracing-metrics)
120+
|
146121

147122
### Metric name and help template system
148123

@@ -313,16 +288,41 @@ azurerm_ratelimit{scope="subscription",subscriptionID="...",type="read"} 11999
313288

314289
## HTTP Endpoints
315290

316-
| Endpoint | Description |
317-
|--------------------------------|--------------------------------------------------------------------------------------------------------|
318-
| `/metrics` | Default prometheus golang metrics |
319-
| `/probe/metrics/resource` | Probe metrics for one resource (see `azurerm_resource_metric`) |
320-
| `/probe/metrics/list` | Probe metrics for list of resources (see `azurerm_resource_metric`) |
321-
| `/probe/metrics/scrape` | Probe metrics for list of resources and config on resource by tag name (see `azurerm_resource_metric`) |
322-
| `/probe/metrics/resourcegraph` | Probe metrics for list of resources based on a kusto query and the resource graph API |
291+
| Endpoint | Description |
292+
|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
293+
| `/metrics` | Default prometheus golang metrics |
294+
| `/probe/metrics` | Probe metrics by subscription and region, split by resource (one query per subscription and region; see `azurerm_resource_metric`) |
295+
| `/probe/metrics/resource` | Probe metrics for one resource (one query per resource; see `azurerm_resource_metric`) |
296+
| `/probe/metrics/list` | Probe metrics for list of resources (sone query per resource; see `azurerm_resource_metric`) |
297+
| `/probe/metrics/scrape` | Probe metrics for list of resources and config on resource by tag name (one query per resource; see `azurerm_resource_metric`) |
298+
| `/probe/metrics/resourcegraph` | Probe metrics for list of resources based on a kusto query and the resource graph API (one query per resource) |
299+
300+
### /probe/metrics parameters
301+
302+
one metric request per subscription and region
303+
304+
| GET parameter | Default | Required | Multiple | Description |
305+
|-----------------|---------------------------|----------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------|
306+
| `subscription` | | **yes** | **yes** | Azure Subscription ID |
307+
| `region` | | **yes** | **yes** | Azure Regions (eg. `westeurope`, `northeurope`) |
308+
| `resourceType` | | **yes** | no | Azure Resource type |
309+
| `timespan` | `PT1M` | no | no | Metric timespan |
310+
| `interval` | | no | no | Metric timespan |
311+
| `metric` | | no | **yes** | Metric name |
312+
| `aggregation` | | no | **yes** | Metric aggregation (`minimum`, `maximum`, `average`, `total`, `count`, multiple possible separated with `,`) |
313+
| `name` | `azurerm_resource_metric` | no | no | Prometheus metric name |
314+
| `metricFilter` | | no | no | Prometheus metric filter (dimension support; supports only 2 filters in subscription query mode as the first filter is used to split by resource id) |
315+
| `metricTop` | | no | no | Prometheus metric dimension count (dimension support) |
316+
| `metricOrderBy` | | no | no | Prometheus metric order by (dimension support) |
317+
| `cache` | (same as timespan) | no | no | Use of internal metrics caching |
318+
| `template` | set to `$METRIC_TEMPLATE` | no | no | see [metric name and help template system](#metric-name-and-help-template-system) |
319+
| `help` | set to `$METRIC_HELP` | no | no | see [metric name and help template system](#metric-name-and-help-template-system) |
320+
321+
*Hint: Multiple values can be specified multiple times or with a comma in a single value.*
323322

324323
### /probe/metrics/resource parameters
325324

325+
metrics are requested per resource in chunks of 20 metric names (35 metric names = 2 requests per resource)
326326

327327
| GET parameter | Default | Required | Multiple | Description |
328328
|--------------------|---------------------------|----------|----------|--------------------------------------------------------------------------------------------------------------|
@@ -345,6 +345,8 @@ azurerm_ratelimit{scope="subscription",subscriptionID="...",type="read"} 11999
345345

346346
### /probe/metrics/list parameters
347347

348+
metrics are requested per resource in chunks of 20 metric names (35 metric names = 2 requests per resource)
349+
348350
HINT: service discovery information is cached for duration set by `$AZURE_SERVICEDISCOVERY_CACHE` (set to `0` to disable)
349351

350352
| GET parameter | Default | Required | Multiple | Description |
@@ -396,6 +398,8 @@ HINT: service discovery information is cached for duration set by `$AZURE_SERVIC
396398

397399
This endpoint is using Azure ResoruceGraph API for servicediscovery (with 21.9.0 and later)
398400

401+
metrics are requested per resource in chunks of 20 metric names (35 metric names = 2 requests per resource)
402+
399403
HINT: service discovery information is cached for duration set by `$AZURE_SERVICEDISCOVERY_CACHE` (set to `0` to disable)
400404

401405
| GET parameter | Default | Required | Multiple | Description |
@@ -639,7 +643,5 @@ The [List of supported metrics](https://docs.microsoft.com/en-us/azure/azure-mon
639643

640644
### Development and testing query webui
641645

642-
(with 21.10.0-beta1 and later)
643-
644-
if azure-metrics-exporter is started with `--development.webui` there is a webui at `http://url-to-exporter/query`.
645-
Here you can test different query settings and get the generated prometheus scrape_config.
646+
azure-metrics-exporter provides a query webui at `http://url-to-exporter/query` where you can
647+
test different query settings and endpoints. the query webui also generates an example prometheus scrape_config.

0 commit comments

Comments
 (0)