Skip to content

Commit

Permalink
supporting docs for metric scraping interval change
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonh-msft committed Mar 28, 2019
1 parent 3d25c55 commit ca0c378
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions adding-a-new-scraper.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This guide walks you through the process of adding a new scraper type.
## Configuration
1. Add your new scraping type to the `Promitor.Core.Scraping.Configuration.Model.ResourceType`
2. Describe the resource for which you're creating scraping metrics by creating `<New-Type>MetricDefinition`and inherit from `Promitor.Core.Scraping.Configuration.Model.Metrics.MetricDefinition` - this class should go in `.\src\Promitor.Core.Scraping\Configuration\Model\Metrics\ResourceTypes`
2. Create an example entry for your scraper in `.\samples\promitor-sample.yaml`
3. Create a new Deserializer in `.\src\Promitor.Core.Scraping\Configuration\Serialization\Deserializers`. This must inherit from `AzureMetricDeserializer`.
3. Update `Promitor.Core.Scraping.Factories.MetricDeserializerFactory` to handle your new resource type by returning a new instance of the Deserializer you created in the previous step.
4. Provide a unit test in `.\src\Promitor.Scraper.Tests.Unit\Serialization\MetricsDeclaration\` that tests the deserialization based on our sample
Expand Down
2 changes: 0 additions & 2 deletions docs/configuration/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
layout: default
title: General Configuration
---
Expand All @@ -15,7 +14,6 @@ Promitor automatically scrapes Azure Monitor and makes the information available
The behavior of this can be configured with the following environment variables:
- **PROMITOR_CONFIGURATION_PATH** - Defines the location of the YAML file that declares what Azure Monitor metrics to scrape. If nothing is specified, `/config/metrics-declaration.yaml` will be used.
- **PROMITOR_SCRAPE_BASEPATH** - Controls the path where the scraping endpoint for Prometheus is being exposed. If nothing is specified, `/prometheus/scrape` will be used.
- **PROMITOR_SCRAPE_SCHEDULE** - A cron expression that controls the fequency in which all the configured metrics will be scraped from Azure Monitor. You can use [crontab-generator.org](https://crontab-generator.org/) to generate a cron that fits your needs. If nothing is configured, `*/5 * * * *` will be used.

We're also providing feature flags to opt-out of certain features:
- **PROMITOR_FEATURE_METRICSTIMESTAMP** - Defines whether or not a timestamp should be included when the value was scraped on Azure Monitor. Supported values are `True` to opt-in & `False` to opt-out, if nothing is configured this will be turned on.
Expand Down
11 changes: 11 additions & 0 deletions docs/configuration/metrics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ azureMetadata:
metricDefaults:
aggregation:
interval: 00:05:00
scraping:
# Every minute
schedule: "0 * * ? * *"
metrics:
- name: demo_queue_size
description: "Amount of active messages of the 'myqueue' queue"
resourceType: ServiceBusQueue
namespace: promitor-messaging
queueName: orders
scraping:
# Every 2 minutes
schedule: "0 */2 * ? * *"
azureMetricConfiguration:
metricName: ActiveMessages
aggregation:
Expand Down Expand Up @@ -50,6 +56,7 @@ metrics:

## Metric Defaults

- `metricDefaults.scraping.schedule` - **[REQUIRED]** A cron expression that controls the fequency in which all the configured metrics will be scraped from Azure Monitor. You can use [crontab-generator.org](https://crontab-generator.org/) to generate a cron that fits your needs.
- `metricDefaults.aggregation.interval` - The default interval which defines over what period measurements of a metric should be aggregated.

## Metrics
Expand All @@ -64,6 +71,10 @@ Every metric that is being declared needs to define the following fields:
- `azureMetricConfiguration.aggregation.type` - The aggregation that needs to be used when querying Azure Monitor
- `azureMetricConfiguration.aggregation.interval` - Overrides the default aggregation interval defined in `metricDefaults.aggregation.interval` with a new interval

Additionally, the following fields are optional:

- `scraping.schedule` - A scraping schedule for the individual metric; overrides the the one specified in `metricDefaults`

# Supported Azure Services

Every Azure service is supported and can be scraped by using the [Generic Azure Resource](generic-azure-resource).
Expand Down

0 comments on commit ca0c378

Please sign in to comment.