feat: Add Azure Monitor input plugin (#10103)
This commit is contained in:
parent
61f64506c9
commit
7ef5993d35
|
|
@ -12,7 +12,10 @@ following works:
|
|||
- github.com/Azure/azure-pipeline-go [MIT License](https://github.com/Azure/azure-pipeline-go/blob/master/LICENSE)
|
||||
- github.com/Azure/azure-sdk-for-go [MIT License](https://github.com/Azure/azure-sdk-for-go/blob/main/LICENSE.txt)
|
||||
- github.com/Azure/azure-sdk-for-go/sdk/azcore [MIT License](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azcore/LICENSE.txt)
|
||||
- github.com/Azure/azure-sdk-for-go/sdk/azidentity [MIT License](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azidentity/LICENSE.txt)
|
||||
- github.com/Azure/azure-sdk-for-go/sdk/internal [MIT License](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/internal/LICENSE.txt)
|
||||
- github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor [MIT License](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/monitor/armmonitor/LICENSE.txt)
|
||||
- github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources [MIT License](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/resources/armresources/LICENSE.txt)
|
||||
- github.com/Azure/azure-sdk-for-go/sdk/storage/azblob [MIT License](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/storage/azblob/LICENSE.txt)
|
||||
- github.com/Azure/azure-storage-blob-go [MIT License](https://github.com/Azure/azure-storage-blob-go/blob/master/LICENSE)
|
||||
- github.com/Azure/azure-storage-queue-go [MIT License](https://github.com/Azure/azure-storage-queue-go/blob/master/LICENSE)
|
||||
|
|
@ -20,6 +23,7 @@ following works:
|
|||
- github.com/Azure/go-ansiterm [MIT License](https://github.com/Azure/go-ansiterm/blob/master/LICENSE)
|
||||
- github.com/Azure/go-autorest [Apache License 2.0](https://github.com/Azure/go-autorest/blob/master/LICENSE)
|
||||
- github.com/Azure/go-ntlmssp [MIT License](https://github.com/Azure/go-ntlmssp/blob/master/LICENSE)
|
||||
- github.com/AzureAD/microsoft-authentication-library-for-go [MIT License](https://github.com/AzureAD/microsoft-authentication-library-for-go/blob/main/LICENSE)
|
||||
- github.com/ClickHouse/clickhouse-go [MIT License](https://github.com/ClickHouse/clickhouse-go/blob/master/LICENSE)
|
||||
- github.com/Masterminds/goutils [Apache License 2.0](https://github.com/Masterminds/goutils/blob/master/LICENSE.txt)
|
||||
- github.com/Masterminds/semver [MIT License](https://github.com/Masterminds/semver/blob/master/LICENSE.txt)
|
||||
|
|
@ -201,6 +205,7 @@ following works:
|
|||
- github.com/kolo/xmlrpc [MIT License](https://github.com/kolo/xmlrpc/blob/master/LICENSE)
|
||||
- github.com/kylelemons/godebug [Apache License 2.0](https://github.com/kylelemons/godebug/blob/master/LICENSE)
|
||||
- github.com/leodido/ragel-machinery [MIT License](https://github.com/leodido/ragel-machinery/blob/develop/LICENSE)
|
||||
- github.com/logzio/azure-monitor-metrics-receiver [MIT License](https://github.com/logzio/azure-monitor-metrics-receiver/blob/master/LICENSE)
|
||||
- github.com/magiconair/properties [BSD 2-Clause "Simplified" License](https://github.com/magiconair/properties/blob/main/LICENSE.md)
|
||||
- github.com/mailru/easyjson [MIT License](https://github.com/mailru/easyjson/blob/master/LICENSE)
|
||||
- github.com/mattn/go-colorable [MIT License](https://github.com/mattn/go-colorable/blob/master/LICENSE)
|
||||
|
|
|
|||
10
go.mod
10
go.mod
|
|
@ -10,6 +10,8 @@ require (
|
|||
collectd.org v0.5.0
|
||||
github.com/Azure/azure-event-hubs-go/v3 v3.3.20
|
||||
github.com/Azure/azure-kusto-go v0.8.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor v0.4.1
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v0.3.1
|
||||
github.com/Azure/azure-storage-queue-go v0.0.0-20191125232315-636801874cdd
|
||||
github.com/Azure/go-autorest/autorest v0.11.28
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.21
|
||||
|
|
@ -109,6 +111,7 @@ require (
|
|||
github.com/karrick/godirwalk v1.17.0
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
||||
github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b
|
||||
github.com/logzio/azure-monitor-metrics-receiver v1.0.0
|
||||
github.com/lxc/lxd v0.0.0-20220920163450-e9b4b514106a
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369
|
||||
github.com/mdlayher/apcupsd v0.0.0-20220319200143-473c7b5f3c6a
|
||||
|
|
@ -204,7 +207,8 @@ require (
|
|||
github.com/Azure/azure-pipeline-go v0.2.3 // indirect
|
||||
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.2 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0 // indirect
|
||||
github.com/Azure/azure-storage-blob-go v0.15.0 // indirect
|
||||
github.com/Azure/go-amqp v0.17.0 // indirect
|
||||
|
|
@ -217,6 +221,7 @@ require (
|
|||
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
||||
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
||||
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e // indirect
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect
|
||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||
github.com/Masterminds/semver v1.5.0 // indirect
|
||||
github.com/Microsoft/go-winio v0.5.2 // indirect
|
||||
|
|
@ -274,6 +279,7 @@ require (
|
|||
github.com/goburrow/modbus v0.1.0 // indirect
|
||||
github.com/goburrow/serial v0.1.1-0.20211022031912-bfb69110f8dd // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
|
||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
|
||||
github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
|
|
@ -339,7 +345,7 @@ require (
|
|||
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
|
||||
github.com/montanaflynn/stats v0.6.6 // indirect
|
||||
github.com/morikuni/aec v1.0.0 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/naoina/go-stringutil v0.1.0 // indirect
|
||||
|
|
|
|||
21
go.sum
21
go.sum
|
|
@ -107,12 +107,21 @@ github.com/Azure/azure-sdk-for-go v61.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo
|
|||
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw=
|
||||
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 h1:qoVeMsc9/fh/yhxVaA0obYjVH/oI/ihrOoMwsLS9KSA=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.2 h1:mM/yraAumqMMIYev6zX0oxHqX6hreUs5wXf76W47r38=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.2/go.mod h1:+nVKciyKD2J9TyVcEQ82Bo9b+3F92PiQfHrIE/zqLqM=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor v0.4.1 h1:P6UDRqlbywdpvhpVZeiB5p+DuhMTrVD4xfvPW55bs8M=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor v0.4.1/go.mod h1:s5NeyuuFrHc/83W6N/vmD4Zmc42WDPty3Db2+37cF/w=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v0.3.1 h1:EXTDtCSTfPauGawsG+Ae/W46B1PkrgzuKNrcFqy4ljM=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v0.3.1/go.mod h1:PoA99xQAlN13MyUjzgIPWMZEr0etHpYSuT25LmhR3zQ=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0 h1:Px2UA+2RvSSvv+RvJNuUB6n7rs5Wsel4dXLe90Um2n4=
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo=
|
||||
github.com/Azure/azure-storage-blob-go v0.15.0 h1:rXtgp8tN1p29GvpGgfJetavIG0V7OgcSXPpwp3tx6qk=
|
||||
|
|
@ -175,6 +184,8 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM
|
|||
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
|
||||
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e h1:NeAW1fUYUEWhft7pkxDf6WoUvEZJ/uOKsvtpjLnn8MU=
|
||||
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c=
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
|
||||
|
|
@ -1123,6 +1134,8 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP
|
|||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A=
|
||||
github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
|
||||
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
|
||||
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
|
||||
github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs=
|
||||
|
|
@ -1707,6 +1720,8 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b
|
|||
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
|
||||
github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
|
||||
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
||||
github.com/logzio/azure-monitor-metrics-receiver v1.0.0 h1:TAzhIZL2ueyyc81qIw8FGg4nUbts4Hvc3oOxSobY1IA=
|
||||
github.com/logzio/azure-monitor-metrics-receiver v1.0.0/go.mod h1:UIaQ7UgxZ8jO3L0JB2hctsHFBbZqL6mbxYscQAeFpl4=
|
||||
github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s=
|
||||
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
|
||||
|
|
@ -1883,8 +1898,9 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
|
|||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0=
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
|
||||
github.com/montanaflynn/stats v0.6.6 h1:Duep6KMIDpY4Yo11iFsvyqJDyfzLF9+sndUKT+v64GQ=
|
||||
github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||
github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k=
|
||||
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
|
||||
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
|
||||
|
|
@ -2120,6 +2136,7 @@ github.com/pion/transport v0.13.0/go.mod h1:yxm9uXpK9bpBBWkITk13cLo1y5/ur5VQpG22
|
|||
github.com/pion/udp v0.1.1 h1:8UAPvyqmsxK8oOjloDk4wUt63TzFe9WEJkg5lChlj7o=
|
||||
github.com/pion/udp v0.1.1/go.mod h1:6AFo+CMdKQm7UiA0eUPA8/eVCTx8jBIITLZHc9DWX5M=
|
||||
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
|
||||
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ=
|
||||
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
|
||||
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
//go:build !custom || inputs || inputs.azure_monitor
|
||||
|
||||
package all
|
||||
|
||||
import _ "github.com/influxdata/telegraf/plugins/inputs/azure_monitor" // register plugin
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
# Azure Monitor Input Plugin
|
||||
|
||||
The `azure_monitor` plugin, gathers metrics of each Azure
|
||||
resource using Azure Monitor API. Uses **Logz.io
|
||||
azure-monitor-metrics-receiver** package -
|
||||
an SDK wrapper for Azure Monitor SDK.
|
||||
|
||||
## Azure Credential
|
||||
|
||||
This plugin uses `client_id`, `client_secret` and `tenant_id`
|
||||
for authentication (access token), and `subscription_id`
|
||||
is for accessing Azure resources.
|
||||
|
||||
## Property Locations
|
||||
|
||||
`subscription_id` can be found under **Overview**->**Essentials** in
|
||||
the Azure portal for your application/service.
|
||||
|
||||
`client_id` and `client_secret` can be obtained by registering an
|
||||
application under Azure Active Directory.
|
||||
|
||||
`tenant_id` can be found under **Azure Active Directory**->**Properties**.
|
||||
|
||||
resource target `resource_id` can be found under
|
||||
**Overview**->**Essentials**->**JSON View** (link) in the Azure
|
||||
portal for your application/service.
|
||||
|
||||
## More Information
|
||||
|
||||
To see a table of resource types and their metrics, please use this link:
|
||||
|
||||
`https://docs.microsoft.com/en-us/azure/azure-monitor/
|
||||
essentials/metrics-supported`
|
||||
|
||||
## Rate Limits
|
||||
|
||||
Azure API read limit is 12000 requests per hour.
|
||||
Please make sure the total number of metrics you are requesting is proportional
|
||||
to your time interval.
|
||||
|
||||
## Usage
|
||||
|
||||
Use `resource_targets` to collect metrics from specific resources using
|
||||
resource id.
|
||||
|
||||
Use `resource_group_targets` to collect metrics from resources under the
|
||||
resource group with resource type.
|
||||
|
||||
Use `subscription_targets` to collect metrics from resources under the
|
||||
subscription with resource type.
|
||||
|
||||
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
|
||||
|
||||
In addition to the plugin-specific configuration settings, plugins support
|
||||
additional global and plugin configuration settings. These settings are used to
|
||||
modify metrics, tags, and field or create aliases and configure ordering, etc.
|
||||
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
||||
|
||||
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md
|
||||
|
||||
## Configuration
|
||||
|
||||
```toml @sample.conf
|
||||
# Gather Azure resources metrics from Azure Monitor API
|
||||
[[inputs.azure_monitor]]
|
||||
# can be found under Overview->Essentials in the Azure portal for your application/service
|
||||
subscription_id = "<<SUBSCRIPTION_ID>>"
|
||||
# can be obtained by registering an application under Azure Active Directory
|
||||
client_id = "<<CLIENT_ID>>"
|
||||
# can be obtained by registering an application under Azure Active Directory
|
||||
client_secret = "<<CLIENT_SECRET>>"
|
||||
# can be found under Azure Active Directory->Properties
|
||||
tenant_id = "<<TENANT_ID>>"
|
||||
|
||||
# resource target #1 to collect metrics from
|
||||
[[inputs.azure_monitor.resource_target]]
|
||||
# can be found undet Overview->Essentials->JSON View in the Azure portal for your application/service
|
||||
# must start with 'resourceGroups/...' ('/subscriptions/xxxxxxxx-xxxx-xxxx-xxx-xxxxxxxxxxxx'
|
||||
# must be removed from the beginning of Resource ID property value)
|
||||
resource_id = "<<RESOURCE_ID>>"
|
||||
# the metric names to collect
|
||||
# leave the array empty to use all metrics available to this resource
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
# metrics aggregation type value to collect
|
||||
# can be 'Total', 'Count', 'Average', 'Minimum', 'Maximum'
|
||||
# leave the array empty to collect all aggregation types values for each metric
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# resource target #2 to collect metrics from
|
||||
[[inputs.azure_monitor.resource_target]]
|
||||
resource_id = "<<RESOURCE_ID>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# resource group target #1 to collect metrics from resources under it with resource type
|
||||
[[inputs.azure_monitor.resource_group_target]]
|
||||
# the resource group name
|
||||
resource_group = "<<RESOURCE_GROUP_NAME>>"
|
||||
|
||||
# defines the resources to collect metrics from
|
||||
[[inputs.azure_monitor.resource_group_target.resource]]
|
||||
# the resource type
|
||||
resource_type = "<<RESOURCE_TYPE>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# defines the resources to collect metrics from
|
||||
[[inputs.azure_monitor.resource_group_target.resource]]
|
||||
resource_type = "<<RESOURCE_TYPE>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# resource group target #2 to collect metrics from resources under it with resource type
|
||||
[[inputs.azure_monitor.resource_group_target]]
|
||||
resource_group = "<<RESOURCE_GROUP_NAME>>"
|
||||
|
||||
[[inputs.azure_monitor.resource_group_target.resource]]
|
||||
resource_type = "<<RESOURCE_TYPE>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# subscription target #1 to collect metrics from resources under it with resource type
|
||||
[[inputs.azure_monitor.subscription_target]]
|
||||
resource_type = "<<RESOURCE_TYPE>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# subscription target #2 to collect metrics from resources under it with resource type
|
||||
[[inputs.azure_monitor.subscription_target]]
|
||||
resource_type = "<<RESOURCE_TYPE>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
```
|
||||
|
||||
## Metrics
|
||||
|
||||
* azure_monitor_<<RESOURCE_NAMESPACE>>_<<METRIC_NAME>>
|
||||
* fields:
|
||||
* total (float64)
|
||||
* count (float64)
|
||||
* average (float64)
|
||||
* minimum (float64)
|
||||
* maximum (float64)
|
||||
* tags:
|
||||
* namespace
|
||||
* resource_group
|
||||
* resource_name
|
||||
* subscription_id
|
||||
* resource_region
|
||||
* unit
|
||||
|
||||
## Example Output
|
||||
|
||||
```shell
|
||||
> azure_monitor_microsoft_storage_storageaccounts_used_capacity,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=Bytes average=9065573,maximum=9065573,minimum=9065573,timeStamp="2021-11-08T09:52:00Z",total=9065573 1636368744000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_transactions,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=Count average=1,count=6,maximum=1,minimum=0,timeStamp="2021-11-08T09:52:00Z",total=6 1636368744000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_ingress,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=Bytes average=5822.333333333333,count=6,maximum=5833,minimum=0,timeStamp="2021-11-08T09:52:00Z",total=34934 1636368744000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_egress,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=Bytes average=840.1666666666666,count=6,maximum=841,minimum=0,timeStamp="2021-11-08T09:52:00Z",total=5041 1636368744000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_success_server_latency,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=MilliSeconds average=12.833333333333334,count=6,maximum=30,minimum=8,timeStamp="2021-11-08T09:52:00Z",total=77 1636368744000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_success_e2e_latency,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=MilliSeconds average=12.833333333333334,count=6,maximum=30,minimum=8,timeStamp="2021-11-08T09:52:00Z",total=77 1636368744000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_availability,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=Percent average=100,count=6,maximum=100,minimum=100,timeStamp="2021-11-08T09:52:00Z",total=600 1636368744000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_used_capacity,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=Bytes average=9065573,maximum=9065573,minimum=9065573,timeStamp="2021-11-08T09:52:00Z",total=9065573 1636368745000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_transactions,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=Count average=1,count=6,maximum=1,minimum=0,timeStamp="2021-11-08T09:52:00Z",total=6 1636368745000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_ingress,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=Bytes average=5822.333333333333,count=6,maximum=5833,minimum=0,timeStamp="2021-11-08T09:52:00Z",total=34934 1636368745000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_egress,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=Bytes average=840.1666666666666,count=6,maximum=841,minimum=0,timeStamp="2021-11-08T09:52:00Z",total=5041 1636368745000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_success_server_latency,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=MilliSeconds average=12.833333333333334,count=6,maximum=30,minimum=8,timeStamp="2021-11-08T09:52:00Z",total=77 1636368745000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_success_e2e_latency,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=MilliSeconds average=12.833333333333334,count=6,maximum=30,minimum=8,timeStamp="2021-11-08T09:52:00Z",total=77 1636368745000000000
|
||||
> azure_monitor_microsoft_storage_storageaccounts_availability,host=Azure-MBP,namespace=Microsoft.Storage/storageAccounts,resource_group=azure-rg,resource_name=azuresa,resource_region=eastus,subscription_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,unit=Percent average=100,count=6,maximum=100,minimum=100,timeStamp="2021-11-08T09:52:00Z",total=600 1636368745000000000
|
||||
```
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
//go:generate ../../../tools/readme_config_includer/generator
|
||||
package azure_monitor
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/plugins/inputs"
|
||||
receiver "github.com/logzio/azure-monitor-metrics-receiver"
|
||||
)
|
||||
|
||||
type AzureMonitor struct {
|
||||
SubscriptionID string `toml:"subscription_id"`
|
||||
ClientID string `toml:"client_id"`
|
||||
ClientSecret string `toml:"client_secret"`
|
||||
TenantID string `toml:"tenant_id"`
|
||||
ResourceTargets []*ResourceTarget `toml:"resource_target"`
|
||||
ResourceGroupTargets []*ResourceGroupTarget `toml:"resource_group_target"`
|
||||
SubscriptionTargets []*Resource `toml:"subscription_target"`
|
||||
Log telegraf.Logger `toml:"-"`
|
||||
|
||||
receiver *receiver.AzureMonitorMetricsReceiver
|
||||
azureManager azureClientsCreator
|
||||
azureClients *receiver.AzureClients
|
||||
}
|
||||
|
||||
type ResourceTarget struct {
|
||||
ResourceID string `toml:"resource_id"`
|
||||
Metrics []string `toml:"metrics"`
|
||||
Aggregations []string `toml:"aggregations"`
|
||||
}
|
||||
|
||||
type ResourceGroupTarget struct {
|
||||
ResourceGroup string `toml:"resource_group"`
|
||||
Resources []*Resource `toml:"resource"`
|
||||
}
|
||||
|
||||
type Resource struct {
|
||||
ResourceType string `toml:"resource_type"`
|
||||
Metrics []string `toml:"metrics"`
|
||||
Aggregations []string `toml:"aggregations"`
|
||||
}
|
||||
|
||||
type azureClientsManager struct{}
|
||||
|
||||
type azureClientsCreator interface {
|
||||
createAzureClients(subscriptionID string, clientID string, clientSecret string, tenantID string) (*receiver.AzureClients, error)
|
||||
}
|
||||
|
||||
//go:embed sample.conf
|
||||
var sampleConfig string
|
||||
|
||||
func (am *AzureMonitor) SampleConfig() string {
|
||||
return sampleConfig
|
||||
}
|
||||
|
||||
// Init is for setup, and validating config.
|
||||
func (am *AzureMonitor) Init() error {
|
||||
var err error
|
||||
am.azureClients, err = am.azureManager.createAzureClients(am.SubscriptionID, am.ClientID, am.ClientSecret, am.TenantID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = am.setReceiver(); err != nil {
|
||||
return fmt.Errorf("error setting Azure Monitor receiver: %w", err)
|
||||
}
|
||||
|
||||
if err = am.receiver.CreateResourceTargetsFromResourceGroupTargets(); err != nil {
|
||||
return fmt.Errorf("error creating resource targets from resource group targets: %w", err)
|
||||
}
|
||||
|
||||
if err = am.receiver.CreateResourceTargetsFromSubscriptionTargets(); err != nil {
|
||||
return fmt.Errorf("error creating resource targets from subscription targets: %w", err)
|
||||
}
|
||||
|
||||
if err = am.receiver.CheckResourceTargetsMetricsValidation(); err != nil {
|
||||
return fmt.Errorf("error checking resource targets metrics validation: %w", err)
|
||||
}
|
||||
|
||||
if err = am.receiver.SetResourceTargetsMetrics(); err != nil {
|
||||
return fmt.Errorf("error setting resource targets metrics: %w", err)
|
||||
}
|
||||
|
||||
if err = am.receiver.SplitResourceTargetsMetricsByMinTimeGrain(); err != nil {
|
||||
return fmt.Errorf("error spliting resource targets metrics by min time grain: %w", err)
|
||||
}
|
||||
|
||||
am.receiver.SplitResourceTargetsWithMoreThanMaxMetrics()
|
||||
am.receiver.SetResourceTargetsAggregations()
|
||||
|
||||
am.Log.Debug("Total resource targets: ", len(am.receiver.Targets.ResourceTargets))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (am *AzureMonitor) Gather(acc telegraf.Accumulator) error {
|
||||
var waitGroup sync.WaitGroup
|
||||
|
||||
for _, target := range am.receiver.Targets.ResourceTargets {
|
||||
am.Log.Debug("Collecting metrics for resource target ", target.ResourceID)
|
||||
waitGroup.Add(1)
|
||||
|
||||
go func(target *receiver.ResourceTarget) {
|
||||
defer waitGroup.Done()
|
||||
|
||||
collectedMetrics, notCollectedMetrics, err := am.receiver.CollectResourceTargetMetrics(target)
|
||||
if err != nil {
|
||||
acc.AddError(err)
|
||||
}
|
||||
|
||||
for _, collectedMetric := range collectedMetrics {
|
||||
acc.AddFields(collectedMetric.Name, collectedMetric.Fields, collectedMetric.Tags)
|
||||
}
|
||||
|
||||
for _, notCollectedMetric := range notCollectedMetrics {
|
||||
am.Log.Info("Did not get any metric value from Azure Monitor API for the metric ID ", notCollectedMetric)
|
||||
}
|
||||
}(target)
|
||||
}
|
||||
|
||||
waitGroup.Wait()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (am *AzureMonitor) setReceiver() error {
|
||||
var resourceTargets []*receiver.ResourceTarget
|
||||
var resourceGroupTargets []*receiver.ResourceGroupTarget
|
||||
var subscriptionTargets []*receiver.Resource
|
||||
|
||||
for _, target := range am.ResourceTargets {
|
||||
resourceTargets = append(resourceTargets, receiver.NewResourceTarget(target.ResourceID, target.Metrics, target.Aggregations))
|
||||
}
|
||||
|
||||
for _, target := range am.ResourceGroupTargets {
|
||||
var resources []*receiver.Resource
|
||||
for _, resource := range target.Resources {
|
||||
resources = append(resources, receiver.NewResource(resource.ResourceType, resource.Metrics, resource.Aggregations))
|
||||
}
|
||||
|
||||
resourceGroupTargets = append(resourceGroupTargets, receiver.NewResourceGroupTarget(target.ResourceGroup, resources))
|
||||
}
|
||||
|
||||
for _, target := range am.SubscriptionTargets {
|
||||
subscriptionTargets = append(subscriptionTargets, receiver.NewResource(target.ResourceType, target.Metrics, target.Aggregations))
|
||||
}
|
||||
|
||||
targets := receiver.NewTargets(resourceTargets, resourceGroupTargets, subscriptionTargets)
|
||||
var err error
|
||||
am.receiver, err = receiver.NewAzureMonitorMetricsReceiver(am.SubscriptionID, am.ClientID, am.ClientSecret, am.TenantID, targets, am.azureClients)
|
||||
return err
|
||||
}
|
||||
|
||||
func (acm *azureClientsManager) createAzureClients(
|
||||
subscriptionID string,
|
||||
clientID string,
|
||||
clientSecret string,
|
||||
tenantID string,
|
||||
) (*receiver.AzureClients, error) {
|
||||
azureClients, err := receiver.CreateAzureClients(subscriptionID, clientID, clientSecret, tenantID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating Azure clients: %w", err)
|
||||
}
|
||||
|
||||
return azureClients, nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
inputs.Add("azure_monitor", func() telegraf.Input {
|
||||
return &AzureMonitor{
|
||||
azureManager: &azureClientsManager{},
|
||||
}
|
||||
})
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,69 @@
|
|||
# Gather Azure resources metrics from Azure Monitor API
|
||||
[[inputs.azure_monitor]]
|
||||
# can be found under Overview->Essentials in the Azure portal for your application/service
|
||||
subscription_id = "<<SUBSCRIPTION_ID>>"
|
||||
# can be obtained by registering an application under Azure Active Directory
|
||||
client_id = "<<CLIENT_ID>>"
|
||||
# can be obtained by registering an application under Azure Active Directory
|
||||
client_secret = "<<CLIENT_SECRET>>"
|
||||
# can be found under Azure Active Directory->Properties
|
||||
tenant_id = "<<TENANT_ID>>"
|
||||
|
||||
# resource target #1 to collect metrics from
|
||||
[[inputs.azure_monitor.resource_target]]
|
||||
# can be found undet Overview->Essentials->JSON View in the Azure portal for your application/service
|
||||
# must start with 'resourceGroups/...' ('/subscriptions/xxxxxxxx-xxxx-xxxx-xxx-xxxxxxxxxxxx'
|
||||
# must be removed from the beginning of Resource ID property value)
|
||||
resource_id = "<<RESOURCE_ID>>"
|
||||
# the metric names to collect
|
||||
# leave the array empty to use all metrics available to this resource
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
# metrics aggregation type value to collect
|
||||
# can be 'Total', 'Count', 'Average', 'Minimum', 'Maximum'
|
||||
# leave the array empty to collect all aggregation types values for each metric
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# resource target #2 to collect metrics from
|
||||
[[inputs.azure_monitor.resource_target]]
|
||||
resource_id = "<<RESOURCE_ID>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# resource group target #1 to collect metrics from resources under it with resource type
|
||||
[[inputs.azure_monitor.resource_group_target]]
|
||||
# the resource group name
|
||||
resource_group = "<<RESOURCE_GROUP_NAME>>"
|
||||
|
||||
# defines the resources to collect metrics from
|
||||
[[inputs.azure_monitor.resource_group_target.resource]]
|
||||
# the resource type
|
||||
resource_type = "<<RESOURCE_TYPE>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# defines the resources to collect metrics from
|
||||
[[inputs.azure_monitor.resource_group_target.resource]]
|
||||
resource_type = "<<RESOURCE_TYPE>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# resource group target #2 to collect metrics from resources under it with resource type
|
||||
[[inputs.azure_monitor.resource_group_target]]
|
||||
resource_group = "<<RESOURCE_GROUP_NAME>>"
|
||||
|
||||
[[inputs.azure_monitor.resource_group_target.resource]]
|
||||
resource_type = "<<RESOURCE_TYPE>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# subscription target #1 to collect metrics from resources under it with resource type
|
||||
[[inputs.azure_monitor.subscription_target]]
|
||||
resource_type = "<<RESOURCE_TYPE>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
|
||||
# subscription target #2 to collect metrics from resources under it with resource type
|
||||
[[inputs.azure_monitor.subscription_target]]
|
||||
resource_type = "<<RESOURCE_TYPE>>"
|
||||
metrics = [ "<<METRIC>>", "<<METRIC>>" ]
|
||||
aggregations = [ "<<AGGREGATION>>", "<<AGGREGATION>>" ]
|
||||
114
plugins/inputs/azure_monitor/testdata/json/azure_metric_definitions_responses.json
vendored
Normal file
114
plugins/inputs/azure_monitor/testdata/json/azure_metric_definitions_responses.json
vendored
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
[
|
||||
[
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1",
|
||||
"name": {
|
||||
"value": "metric1"
|
||||
},
|
||||
"metricAvailabilities": [
|
||||
{
|
||||
"timeGrain": "PT1M"
|
||||
},
|
||||
{
|
||||
"timeGrain": "PT5M"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1",
|
||||
"name": {
|
||||
"value": "metric2"
|
||||
},
|
||||
"metricAvailabilities": [
|
||||
{
|
||||
"timeGrain": "PT1M"
|
||||
},
|
||||
{
|
||||
"timeGrain": "PT5M"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1",
|
||||
"name": {
|
||||
"value": "metric3"
|
||||
},
|
||||
"metricAvailabilities": [
|
||||
{
|
||||
"timeGrain": "PT5M"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup1/providers/Microsoft.Test/type2/resource2",
|
||||
"name": {
|
||||
"value": "metric1"
|
||||
},
|
||||
"metricAvailabilities": [
|
||||
{
|
||||
"timeGrain": "PT1M"
|
||||
},
|
||||
{
|
||||
"timeGrain": "PT5M"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup1/providers/Microsoft.Test/type2/resource2",
|
||||
"name": {
|
||||
"value": "metric2"
|
||||
},
|
||||
"metricAvailabilities": [
|
||||
{
|
||||
"timeGrain": "PT1M"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup2/providers/Microsoft.Test/type1/resource3",
|
||||
"name": {
|
||||
"value": "metric1"
|
||||
},
|
||||
"metricAvailabilities": [
|
||||
{
|
||||
"timeGrain": "PT1M"
|
||||
},
|
||||
{
|
||||
"timeGrain": "PT5M"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup2/providers/Microsoft.Test/type1/resource3",
|
||||
"name": {
|
||||
"value": "metric2"
|
||||
},
|
||||
"metricAvailabilities": [
|
||||
{
|
||||
"timeGrain": "PT1M"
|
||||
},
|
||||
{
|
||||
"timeGrain": "PT5M"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup2/providers/Microsoft.Test/type1/resource3",
|
||||
"name": {
|
||||
"value": "metric3"
|
||||
},
|
||||
"metricAvailabilities": [
|
||||
{
|
||||
"timeGrain": "PT1M"
|
||||
},
|
||||
{
|
||||
"timeGrain": "PT5M"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
|
@ -0,0 +1,243 @@
|
|||
[
|
||||
{
|
||||
"namespace": "Microsoft.Test/type1",
|
||||
"resourceregion": "eastus",
|
||||
"value": [
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1/providers/Microsoft.Insights/metrics/metric1",
|
||||
"name": {
|
||||
"localizedValue": "metric1"
|
||||
},
|
||||
"unit": "Count",
|
||||
"timeseries": [
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:00:00Z",
|
||||
"total": 1.0,
|
||||
"maximum": 1.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:01:00Z",
|
||||
"total": 2.0,
|
||||
"maximum": 2.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:02:00Z",
|
||||
"total": 2.5,
|
||||
"maximum": 2.5
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:58:00Z",
|
||||
"total": 2.0,
|
||||
"maximum": 2.5
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:59:00Z",
|
||||
"total": 5.0,
|
||||
"maximum": 5.0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"errorCode": "Success"
|
||||
},
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1/providers/Microsoft.Insights/metrics/metric2",
|
||||
"name": {
|
||||
"localizedValue": "metric2"
|
||||
},
|
||||
"unit": "Count",
|
||||
"timeseries": [
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:00:00Z",
|
||||
"total": 2.0,
|
||||
"maximum": 2.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:01:00Z",
|
||||
"total": 1.0,
|
||||
"maximum": 2.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:02:00Z",
|
||||
"total": 1.0,
|
||||
"maximum": 2.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:58:00Z",
|
||||
"total": 2.5,
|
||||
"maximum": 2.5
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:59:00Z",
|
||||
"total": 2.5,
|
||||
"maximum": 2.5
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"errorCode": "Success"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"namespace": "Microsoft.Test/type2",
|
||||
"resourceregion": "eastus",
|
||||
"value": [
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup1/providers/Microsoft.Test/type2/resource2/providers/Microsoft.Insights/metrics/metric1",
|
||||
"name": {
|
||||
"localizedValue": "metric1"
|
||||
},
|
||||
"unit": "Count",
|
||||
"timeseries": [
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:00:00Z",
|
||||
"total": 5.0,
|
||||
"minimum": 5.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:01:00Z",
|
||||
"total": 3.0,
|
||||
"minimum": 3.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:02:00Z",
|
||||
"total": 5.0,
|
||||
"minimum": 3.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:58:00Z",
|
||||
"total": 2.5,
|
||||
"minimum": 2.5
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:59:00Z",
|
||||
"total": 5.0,
|
||||
"minimum": 2.5
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"errorCode": "Success"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"namespace": "Microsoft.Test/type1",
|
||||
"resourceregion": "eastus",
|
||||
"value": [
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup2/providers/Microsoft.Test/type1/resource3/providers/Microsoft.Insights/metrics/metric1",
|
||||
"name": {
|
||||
"localizedValue": "metric1"
|
||||
},
|
||||
"unit": "Bytes",
|
||||
"timeseries": [
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:00:00Z",
|
||||
"total": 5.0,
|
||||
"minimum": 5.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:01:00Z",
|
||||
"total": 3.0,
|
||||
"minimum": 3.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:02:00Z",
|
||||
"total": 5.0,
|
||||
"minimum": 3.0
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:58:00Z",
|
||||
"total": 2.5,
|
||||
"minimum": 2.5
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:59:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"errorCode": "Success"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"namespace": "Microsoft.Test/type2",
|
||||
"resourceregion": "eastus",
|
||||
"value": [
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup2/providers/Microsoft.Test/type2/resource4/providers/Microsoft.Insights/metrics/metric1",
|
||||
"name": {
|
||||
"localizedValue": "metric1"
|
||||
},
|
||||
"unit": "Bytes",
|
||||
"timeseries": [
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:00:00Z"
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:01:00Z"
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:02:00Z"
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:58:00Z"
|
||||
},
|
||||
{
|
||||
"timeStamp": "2022-02-22T22:59:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"errorCode": "Success"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"namespace": "Microsoft.Test/type2",
|
||||
"resourceregion": "eastus",
|
||||
"value": [
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup2/providers/Microsoft.Test/type2/resource5/providers/Microsoft.Insights/metrics/metric2",
|
||||
"name": {
|
||||
"localizedValue": "metric2"
|
||||
},
|
||||
"unit": "Bytes",
|
||||
"timeseries": [
|
||||
{
|
||||
"data": []
|
||||
}
|
||||
],
|
||||
"errorCode": "Success"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"namespace": "Microsoft.Test/type2",
|
||||
"resourceregion": "eastus",
|
||||
"value": [
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup2/providers/Microsoft.Test/type2/resource6/providers/Microsoft.Insights/metrics/metric2",
|
||||
"name": {
|
||||
"localizedValue": "metric2"
|
||||
},
|
||||
"unit": "Bytes",
|
||||
"timeseries": [],
|
||||
"errorCode": "Success"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
[
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1",
|
||||
"type": "Microsoft.Test/type1"
|
||||
},
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup1/providers/Microsoft.Test/type2/resource2",
|
||||
"type": "Microsoft.Test/type2"
|
||||
},
|
||||
{
|
||||
"id": "/subscriptions/subscriptionID/resourceGroups/resourceGroup2/providers/Microsoft.Test/type1/resource3",
|
||||
"type": "Microsoft.Test/type1"
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = ["metric1", "metric2"]
|
||||
aggregations = ["Total", "Maximum"]
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type2/resource2"
|
||||
metrics = ["metric1"]
|
||||
aggregations = ["Total", "Minimum"]
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup2/providers/Microsoft.Test/type1/resource3"
|
||||
metrics = ["metric1"]
|
||||
aggregations = ["Total", "Minimum"]
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup2/providers/Microsoft.Test/type2/resource4"
|
||||
metrics = ["metric1"]
|
||||
aggregations = ["Total", "Maximum"]
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup2/providers/Microsoft.Test/type2/resource5"
|
||||
metrics = ["metric2"]
|
||||
aggregations = ["Total"]
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup2/providers/Microsoft.Test/type2/resource6"
|
||||
metrics = ["metric2"]
|
||||
aggregations = ["Average"]
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type2/resource2"
|
||||
metrics = ["metric1", "metric2"]
|
||||
aggregations = []
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup2/providers/Microsoft.Test/type1/resource3"
|
||||
metrics = []
|
||||
aggregations = ["Total"]
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type2/resource2"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "resourceGroup1"
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = []
|
||||
aggregations = ["Average"]
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = ["metric2"]
|
||||
aggregations = []
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = ["metric2"]
|
||||
aggregations = []
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "resourceGroup2"
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = ["metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = []
|
||||
aggregations = ["Average"]
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = ["metric2"]
|
||||
aggregations = []
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
12
plugins/inputs/azure_monitor/testdata/toml/init_resource_group_target_no_resource_found.toml
vendored
Normal file
12
plugins/inputs/azure_monitor/testdata/toml/init_resource_group_target_no_resource_found.toml
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "resourceGroup2"
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = ["metric1", "metric2"]
|
||||
aggregations = ["Total"]
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "resourceGroup1"
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = []
|
||||
aggregations = ["Invalid"]
|
||||
12
plugins/inputs/azure_monitor/testdata/toml/init_resource_group_target_with_invalid_metric.toml
vendored
Normal file
12
plugins/inputs/azure_monitor/testdata/toml/init_resource_group_target_with_invalid_metric.toml
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "resourceGroup1"
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = ["invalid"]
|
||||
aggregations = []
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "invalid"
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "resourceGroup1"
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/invalid"
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "resourceGroup1"
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_group_target]]
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
7
plugins/inputs/azure_monitor/testdata/toml/init_resource_group_target_without_resources.toml
vendored
Normal file
7
plugins/inputs/azure_monitor/testdata/toml/init_resource_group_target_without_resources.toml
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "resourceGroup1"
|
||||
40
plugins/inputs/azure_monitor/testdata/toml/init_resource_group_targets_only.toml
vendored
Normal file
40
plugins/inputs/azure_monitor/testdata/toml/init_resource_group_targets_only.toml
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "resourceGroup1"
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = []
|
||||
aggregations = ["Average"]
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = ["metric2"]
|
||||
aggregations = []
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = ["metric2"]
|
||||
aggregations = []
|
||||
|
||||
[[resource_group_target]]
|
||||
resource_group = "resourceGroup2"
|
||||
|
||||
[[resource_group_target.resource]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = ["metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Invalid"]
|
||||
9
plugins/inputs/azure_monitor/testdata/toml/init_resource_target_with_invalid_metric.toml
vendored
Normal file
9
plugins/inputs/azure_monitor/testdata/toml/init_resource_target_with_invalid_metric.toml
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = ["invalid"]
|
||||
aggregations = []
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "invalid"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
8
plugins/inputs/azure_monitor/testdata/toml/init_resource_target_without_resource_id.toml
vendored
Normal file
8
plugins/inputs/azure_monitor/testdata/toml/init_resource_target_without_resource_id.toml
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type2/resource2"
|
||||
metrics = ["metric1", "metric2"]
|
||||
aggregations = []
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup2/providers/Microsoft.Test/type1/resource3"
|
||||
metrics = []
|
||||
aggregations = ["Total"]
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type2/resource2"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
||||
[[resource_target]]
|
||||
resource_id = "resourceGroups/resourceGroup1/providers/Microsoft.Test/type1/resource1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
9
plugins/inputs/azure_monitor/testdata/toml/init_subscription_target_no_resource_found.toml
vendored
Normal file
9
plugins/inputs/azure_monitor/testdata/toml/init_subscription_target_no_resource_found.toml
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type3"
|
||||
metrics = ["metric1", "metric2"]
|
||||
aggregations = ["Total"]
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = []
|
||||
aggregations = ["Invalid"]
|
||||
9
plugins/inputs/azure_monitor/testdata/toml/init_subscription_target_with_invalid_metric.toml
vendored
Normal file
9
plugins/inputs/azure_monitor/testdata/toml/init_subscription_target_with_invalid_metric.toml
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = ["invalid"]
|
||||
aggregations = []
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/invalid"
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[subscription_target]]
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
29
plugins/inputs/azure_monitor/testdata/toml/init_subscription_targets_only.toml
vendored
Normal file
29
plugins/inputs/azure_monitor/testdata/toml/init_subscription_targets_only.toml
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
subscription_id = "subscriptionID"
|
||||
client_id = "clientID"
|
||||
client_secret = "clientSecret"
|
||||
tenant_id = "tenantID"
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = ["metric1", "metric2", "metric3"]
|
||||
aggregations = ["Total", "Average"]
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = []
|
||||
aggregations = ["Average"]
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = ["metric2"]
|
||||
aggregations = []
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type2"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
|
||||
[[subscription_target]]
|
||||
resource_type = "Microsoft.Test/type1"
|
||||
metrics = []
|
||||
aggregations = []
|
||||
Loading…
Reference in New Issue