Input plugin of Azure Monitor Metrics for Fluentd
Перейти к файлу
Ilana Kantorov e389a83d17 Upgrade Azure monitor api to 2017-05-01-preview (#3)
* Delete unsupported paramater $orderby
* Fix exception loggin
2018-02-28 17:26:51 +02:00
.bundle Add support for multi metric query (#2) 2017-11-24 07:55:29 +02:00
lib/fluent/plugin Upgrade Azure monitor api to 2017-05-01-preview (#3) 2018-02-28 17:26:51 +02:00
test Upgrade Azure monitor api to 2017-05-01-preview (#3) 2018-02-28 17:26:51 +02:00
.gitignore Add support for multi metric query (#2) 2017-11-24 07:55:29 +02:00
Gemfile Initial commit 2017-10-23 06:55:39 +00:00
Gemfile.fluentd.0.12 Initial commit 2017-10-23 06:55:39 +00:00
Gemfile.lock Upgrade Azure monitor api to 2017-05-01-preview (#3) 2018-02-28 17:26:51 +02:00
LICENSE Initial commit 2017-10-23 06:55:39 +00:00
README.md Upgrade Azure monitor api to 2017-05-01-preview (#3) 2018-02-28 17:26:51 +02:00
Rakefile Initial commit 2017-10-23 06:55:39 +00:00
fluent-plugin-azuremonitormetrics.gemspec Upgrade Azure monitor api to 2017-05-01-preview (#3) 2018-02-28 17:26:51 +02:00

README.md

fluent-plugin-azuremonitormetric, a plugin for Fluentd

Overview

Azure Monitor Metrics input plugin.

This plugin gets the monitor metrics from Azure Monitor API to fluentd.

Installation

To use this plugin, you need to have Azure Service Principal.
Create an Azure Service Principal through Azure CLI or Azure portal.

Install from RubyGems:

$ gem install fluent-plugin-azuremonitormetrics

Configuration

<source>
  @type         azuremonitormetrics
  tag           azuremonitormetrics
  tenant_id     [Azure_Tenant_ID]
  client_id     [Azure_Client_Id]
  client_secret [Azure_Client_Secret]

  timespan          [The query timespan in seconds - must be greater than 60] (default: 300)
  interval          [timegrain of the query] (default: PT1M, allowed values are: PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H, PT24H)
  resource_uri      [the identifier of the resource]
  aggregation       [list of aggregation types, sperated by commas] (example: Average,count)
  top               [Max number of records to retrive - vaild only if filter is specified. default is 10]
  filter            [filter to reduce metric data] (example A eq 'a1' and B eq '*')
  result_type       [reduces the set of data collected]
  metrics           [The names of the metrics to retrive, sperated by commas] (example: Network Out,Percentage CPU)
  api_version       [api version]   (default: "2017-05-01-preview")
</source>

Documentation for all the parameters can found here
This plugin is porting from fluent-plugin-cloudwatch

Start fluentd:

$ fluentd -c ./fluentd.conf

output data format

Example of Average and Count aggregations on Percentage CPU and Network Out metrics, on timespan of 5 minutes and 5 minute grain:

2017-10-22 14:25:28 azuremonitormetrics [
   {
      "data":[
         {
            "timeStamp":"2017-11-23T14:30:00Z",
            "count":200.0,
            "average":1115.29
         }
      ],
      "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Compute/virtualMachines/mymachine/providers/Microsoft.Insights/metrics/Network Out",
      "name":{
         "value":"Network Out",
         "localizedValue":"Network Out"
      },
      "type":"Microsoft.Insights/metrics",
      "unit":"Bytes"
   },
   {
      "data":[
         {
            "timeStamp":"2017-11-23T14:30:00Z",
            "count":40.0,
            "average":0.732
         }
      ],
      "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Compute/virtualMachines/mymachine/providers/Microsoft.Insights/metrics/Percentage CPU",
      "name":{
         "value":"Percentage CPU",
         "localizedValue":"Percentage CPU"
      },
      "type":"Microsoft.Insights/metrics",
      "unit":"Percent"
   }
]

Test

Run tests:

$ rake test

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request