This guide walks you through the process of adding a new scraper type.
📢 Before implementing a new scraping type, please open an issue to discuss your scenario
Provide a sample configuration in samples\promitor-sample.yaml
.
- Add your new scraping type to
ResourceType
- Describe what your configuration by creating
<New-Type>MetricDefinition
and inherit fromMetricDefinition
- Update the deserialization to support your new type in
MetricsDeserializer
- Provide a unit test that tests the deserialization based on our sample
Going forward in this guide, TMetricDefinition
will refer to your newly created configuration type.
For every scraper type we provide validation for the configuration so that Promitor fails to start up.
This requires the following steps:
- Create a new validator that implements
IMetricValidator<TMetricDefinition>
- Hook your new validator in our validation pipeline in
MetricsValidator
- Provide a unit test for every validation rule that was added
- Implement a scraper that inherits from
Scraper<TMetricDefinition>
. This one will specify how to call Azure Monitor. - Hook your new scraper in our
MetricScraperFactory
which determines what scraper to use for the passed configuration
📝 Currently we don't have integration tests
Features are great to have but without clear & well-written documentation they are somewhat useless.
It would be good if you could provide documentation on the following:
- What Azure service it supports and how to use it
- What fields need to be configured and what they are for
- An example configuration
This should be provided in a new file under docs\configuration\metrics
.