Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,22 +301,23 @@ azurerm_ratelimit{scope="subscription",subscriptionID="...",type="read"} 11999

one metric request per subscription and region

| GET parameter | Default | Required | Multiple | Description |
|-----------------|---------------------------|----------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `subscription` | | **yes** | **yes** | Azure Subscription ID |
| `region` | | **yes** | **yes** | Azure Regions (eg. `westeurope`, `northeurope`) |
| `resourceType` | | **yes** | no | Azure Resource type |
| `timespan` | `PT1M` | no | no | Metric timespan |
| `interval` | | no | no | Metric timespan |
| `metric` | | no | **yes** | Metric name |
| `aggregation` | | no | **yes** | Metric aggregation (`minimum`, `maximum`, `average`, `total`, `count`, multiple possible separated with `,`) |
| `name` | `azurerm_resource_metric` | no | no | Prometheus metric name |
| `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) |
| `metricTop` | | no | no | Prometheus metric dimension count (dimension support) |
| `metricOrderBy` | | no | no | Prometheus metric order by (dimension support) |
| `cache` | (same as timespan) | no | no | Use of internal metrics caching |
| `template` | set to `$METRIC_TEMPLATE` | no | no | see [metric name and help template system](#metric-name-and-help-template-system) |
| `help` | set to `$METRIC_HELP` | no | no | see [metric name and help template system](#metric-name-and-help-template-system) |
| GET parameter | Default | Required | Multiple | Description |
|-------------------|---------------------------|----------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `subscription` | | **yes** | **yes** | Azure Subscription ID |
| `region` | | **yes** | **yes** | Azure Regions (eg. `westeurope`, `northeurope`) |
| `resourceType` | | **yes** | no | Azure Resource type |
| `timespan` | `PT1M` | no | no | Metric timespan |
| `interval` | | no | no | Metric timespan |
| `metricNamespace` | | no | no | Metric namespace |
| `metric` | | no | **yes** | Metric name |
| `aggregation` | | no | **yes** | Metric aggregation (`minimum`, `maximum`, `average`, `total`, `count`, multiple possible separated with `,`) |
| `name` | `azurerm_resource_metric` | no | no | Prometheus metric name |
| `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) |
| `metricTop` | | no | no | Prometheus metric dimension count (dimension support) |
| `metricOrderBy` | | no | no | Prometheus metric order by (dimension support) |
| `cache` | (same as timespan) | no | no | Use of internal metrics caching |
| `template` | set to `$METRIC_TEMPLATE` | no | no | see [metric name and help template system](#metric-name-and-help-template-system) |
| `help` | set to `$METRIC_HELP` | no | no | see [metric name and help template system](#metric-name-and-help-template-system) |

*Hint: Multiple values can be specified multiple times or with a comma in a single value.*

Expand Down
4 changes: 4 additions & 0 deletions metrics/prober.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ func (p *MetricProber) collectMetricsFromSubscriptions() {
opts.Orderby = to.StringPtr(p.settings.MetricOrderBy)
}

if len(p.settings.MetricNamespace) >= 1 {
opts.Metricnamespace = to.StringPtr(p.settings.MetricNamespace)
}

response, err := client.ListAtSubscriptionScope(p.ctx, region, &opts)
if err != nil {
// FIXME: find a better way to report errors
Expand Down
2 changes: 1 addition & 1 deletion templates/query.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h3>Service Discovery</h3>
</div>
</div>

<div class="mb-3 row" query-endpoint-exclude="/probe/metrics">
<div class="mb-3 row">
<label for="metricNamespace" class="col-sm-2 col-form-label">metricNamespace</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="metricNamespace">
Expand Down