Skip to content

Commit 47d620d

Browse files
committed
update azuretracing
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
1 parent cd7469d commit 47d620d

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ available on `/metrics`
9494
| `azure_loganalytics_query_results` | Number of results from query |
9595
| `azure_loganalytics_query_requests` | Count of requests (eg paged subqueries) per query |
9696

97-
### Azuretracing metrics
97+
98+
### AzureTracing metrics
9899

99100
(with 22.2.0 and later)
100101

@@ -106,12 +107,26 @@ environment variables (eg. setting buckets, disabling metrics or disable autores
106107
| `azurerm_api_ratelimit` | Azure ratelimit metrics (only on /metrics, resets after query due to limited validity) |
107108
| `azurerm_api_request_*` | Azure request count and latency as histogram |
108109

109-
| Environment variable | Example | Description |
110-
|------------------------------------------|----------------------------------|----------------------------------------------------------|
111-
| `METRIC_AZURERM_API_REQUEST_BUCKETS` | `1, 2.5, 5, 10, 30, 60, 90, 120` | Sets buckets for `azurerm_api_request` histogram metric |
112-
| `METRIC_AZURERM_API_REQUEST_DISABLE` | `false` | Disables `azurerm_api_request_*` metric |
113-
| `METRIC_AZURERM_API_RATELIMIT_DISABLE` | `false` | Disables `azurerm_api_ratelimit` metric |
114-
| `METRIC_AZURERM_API_RATELIMIT_AUTORESET` | `false` | Disables `azurerm_api_ratelimit` autoreset after fetch |
110+
#### Settings
111+
112+
| Environment variable | Example | Description |
113+
|------------------------------------------|------------------------------------|----------------------------------------------------------------|
114+
| `METRIC_AZURERM_API_REQUEST_BUCKETS` | `1, 2.5, 5, 10, 30, 60, 90, 120` | Sets buckets for `azurerm_api_request` histogram metric |
115+
| `METRIC_AZURERM_API_REQUEST_ENABLE` | `false` | Enables/disables `azurerm_api_request_*` metric |
116+
| `METRIC_AZURERM_API_REQUEST_LABELS` | `apiEndpoint, method, statusCode` | Controls labels of `azurerm_api_request_*` metric |
117+
| `METRIC_AZURERM_API_RATELIMIT_ENABLE` | `false` | Enables/disables `azurerm_api_ratelimit` metric |
118+
| `METRIC_AZURERM_API_RATELIMIT_AUTORESET` | `false` | Enables/disables `azurerm_api_ratelimit` autoreset after fetch |
119+
120+
121+
| `azurerm_api_request` label | Status | Description |
122+
|-----------------------------|--------------------|----------------------------------------------------------------------------------------------------------|
123+
| `apiEndpoint` | enabled by default | hostname of endpoint (max 3 parts) |
124+
| `routingRegion` | enabled by default | detected region for API call, either routing region from Azure Management API or Azure resource location |
125+
| `subscriptionID` | enabled by default | detected subscriptionID |
126+
| `tenantID` | enabled by default | detected tenantID (extracted from jwt auth token) |
127+
| `resourceProvider` | enabled by default | detected Azure Management API provider |
128+
| `method` | enabled by default | HTTP method |
129+
| `statusCode` | enabled by default | HTTP status code |
115130

116131
## Examples
117132

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/remeh/sizedwaitgroup v1.0.0
1414
github.com/sirupsen/logrus v1.8.1
1515
github.com/webdevops/azure-resourcegraph-exporter v0.0.0-20220211155142-96a70b1d912f
16-
github.com/webdevops/go-prometheus-common v0.0.0-20220211101814-4c9913788fe1
16+
github.com/webdevops/go-prometheus-common v0.0.0-20220214222004-cea8f38b44b7
1717
)
1818

1919
require (

go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,9 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy
231231
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
232232
github.com/webdevops/azure-resourcegraph-exporter v0.0.0-20220211155142-96a70b1d912f h1:Hbtrj8gZOSPzywrok7vxakGiM9cloDiwZApEjyNQ9Js=
233233
github.com/webdevops/azure-resourcegraph-exporter v0.0.0-20220211155142-96a70b1d912f/go.mod h1:7/oZePL6o+quZtWhtM97XjTh2JCEAYSPkpkx9wmNz2s=
234-
github.com/webdevops/go-prometheus-common v0.0.0-20220211101814-4c9913788fe1 h1:wIf6O43jGEarp8ojgInXRIt6jHeQ94JUvsy4O3wqKHY=
235234
github.com/webdevops/go-prometheus-common v0.0.0-20220211101814-4c9913788fe1/go.mod h1:naEkgDRh6L+Ef0qzaS9Q60m1GkwN5Mu6xaNd/Ha84Sg=
235+
github.com/webdevops/go-prometheus-common v0.0.0-20220214222004-cea8f38b44b7 h1:ZOtpPy4/dAM+Zmk84xhmBdNtt+LvKj7f2Lb9rE6o7Zc=
236+
github.com/webdevops/go-prometheus-common v0.0.0-20220214222004-cea8f38b44b7/go.mod h1:xlUEdI06d5YFMOtbdRoRkANLkyQFP/YI+E4UJydVCY0=
236237
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
237238
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
238239
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

loganalytics/prober.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,5 +379,5 @@ func (p *LogAnalyticsProber) decorateAzureAutoRest(client *autorest.Client) {
379379
if err := client.AddToUserAgent(p.UserAgent); err != nil {
380380
log.Panic(err)
381381
}
382-
azuretracing.DecoreAzureAutoRest(client)
382+
azuretracing.DecorateAzureAutoRestClient(client)
383383
}

0 commit comments

Comments
 (0)