diff --git a/changelog/content/experimental/unreleased.md b/changelog/content/experimental/unreleased.md index 76b331eec..0db786797 100644 --- a/changelog/content/experimental/unreleased.md +++ b/changelog/content/experimental/unreleased.md @@ -6,8 +6,13 @@ version: #### Scraper -None. +- {{% tag added %}} Provide system metrics related to agent performance & resources ([docs](https://promitor.io/operations/#performance) + | [#341](https://github.com/tomkerkhove/promitor/issues/341)) #### Resource Discovery -None. +- {{% tag added %}} Provide Prometheus endpoint for scraping metrics +- {{% tag added %}} Provide system metrics related to agent performance & resources ([docs](https://promitor.io/operations/#performance)) + | [#341](https://github.com/tomkerkhove/promitor/issues/341)) +- {{% tag added %}} Provide system metric related to HTTP request performance ([docs](https://promitor.io/operations/#performance) + | [#1717](https://github.com/tomkerkhove/promitor/issues/1717)) diff --git a/docs/operations/index.md b/docs/operations/index.md index ed5ec7d85..2d73b9811 100644 --- a/docs/operations/index.md +++ b/docs/operations/index.md @@ -8,6 +8,8 @@ Here is an overview of how you can operate Promitor. - [Health](#health) - [Consuming the health endpoint](#consuming-the-health-endpoint) - [Performance](#performance) + - [Scraping Prometheus endpoint](#scraping-prometheus-endpoint) + - [Scraping Azure Monitor](#scraping-azure-monitor) - [System](#system) - [Consuming the System endpoint](#consuming-the-system-endpoint) - [Exploring our REST APIs](#exploring-our-rest-apis) @@ -17,6 +19,9 @@ Here is an overview of how you can operate Promitor. ## Health +![Resource Discovery Support Badge](https://img.shields.io/badge/Support%20for%20Resource%20Discovery-Yes-green.svg) +![Scraper Support Badge](https://img.shields.io/badge/Support%20for%20Scraper-Yes-green.svg) + Promitor provides a basic health endpoint that indicates the state of the scraper. Health endpoints can be useful for monitoring the scraper, running sanity tests @@ -41,25 +46,21 @@ The endpoint provides more details on integration with following dependencies: ## Performance -You can easily monitor the performance of Promitor through the following Prometheus metrics: - -- `promitor_scrape_error` - Provides indication of all configured metrics that were unable to be scraped in Azure Monitor - -```prom -# HELP promitor_scrape_error Provides an indication that the scraping of the resource has failed -# TYPE promitor_scrape_error gauge -promitor_scrape_error{metric_name="promitor_demo_app_insights_dependency_duration_200_OK",resource_group="docker-hub-metrics",resource_name="Microsoft.Insights/Components/docker-hub-metrics",resource_type="Generic",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",tenant_id="c8819874-9e56-4e3f-b1a8-1c0325138f27"} 1 1623691623231 -``` - -- `promitor_scrape_success` - Provides indication of all configured metrics that were successfully scraped and reported in -the configured metric sinks +![Resource Discovery Support Badge](https://img.shields.io/badge/Support%20for%20Resource%20Discovery-Yes-green.svg) +![Scraper Support Badge](https://img.shields.io/badge/Support%20for%20Scraper-Yes-green.svg) -```text -# HELP promitor_scrape_success Provides an indication that the scraping of the resource was successful -# TYPE promitor_scrape_success gauge -promitor_scrape_success{metric_name="promitor_demo_automation_update_deployment_machine_runs",resource_group="promitor-sources",resource_name="promitor-sandbox",resource_type="AutomationAccount",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",tenant_id="c8819874-9e56-4e3f-b1a8-1c0325138f27"} 1 1623691626335 -``` +You can easily monitor the performance of Promitor through the following Prometheus metrics: +- `promitor_runtime_dotnet_collection_count_total` - Provides information related to garbage collection count per generation +- `promitor_runtime_dotnet_totalmemory` - Provides information related to total known allocated memory +- `promitor_runtime_process_cpu_seconds_total` - Provides information related to total user & system CPU time spent in seconds +- `promitor_runtime_process_virtual_bytes` - Provides information related to virtual memory size +- `promitor_runtime_process_working_set` - Provides information related to process working set +- `promitor_runtime_process_private_bytes` - Provides information related to process private memory size +- `promitor_runtime_process_num_threads` - Provides information related to total number of threads +- `promitor_runtime_process_processid` - Provides information related to process ID +- `promitor_runtime_process_start_time_seconds` - Provides information related to the start time of the process since + unix epoch in seconds - `promitor_runtime_http_request_duration_seconds` - Provides information related to the performance of HTTP routes and outcomes ```text @@ -84,8 +85,40 @@ promitor_runtime_http_request_duration_seconds_sum{status_code="200",method="GET promitor_runtime_http_request_duration_seconds_count{status_code="200",method="GET",path="/scrape"} 34 ``` +### Scraping Prometheus endpoint + +Every Promitor agent supports exposing Prometheus metrics: + +- **Resource Discovery agent** - Exposed on `/metrics` endpoint +- **Scraper agent** - Exposed through Prometheus metric sink ([docs](/configuration/v2.x/runtime/scraper#prometheus-scraping-endpoint)) + +### Scraping Azure Monitor + +You can easily monitor the performance of Promitor Scraper agent integrating with Azure Monitor + through the following Prometheus metrics: + +- `promitor_scrape_error` - Provides indication of all configured metrics that were unable to be scraped in Azure Monitor + +```prom +# HELP promitor_scrape_error Provides an indication that the scraping of the resource has failed +# TYPE promitor_scrape_error gauge +promitor_scrape_error{metric_name="promitor_demo_app_insights_dependency_duration_200_OK",resource_group="docker-hub-metrics",resource_name="Microsoft.Insights/Components/docker-hub-metrics",resource_type="Generic",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",tenant_id="c8819874-9e56-4e3f-b1a8-1c0325138f27"} 1 1623691623231 +``` + +- `promitor_scrape_success` - Provides indication of all configured metrics that were successfully scraped and reported in +the configured metric sinks + +```text +# HELP promitor_scrape_success Provides an indication that the scraping of the resource was successful +# TYPE promitor_scrape_success gauge +promitor_scrape_success{metric_name="promitor_demo_automation_update_deployment_machine_runs",resource_group="promitor-sources",resource_name="promitor-sandbox",resource_type="AutomationAccount",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",tenant_id="c8819874-9e56-4e3f-b1a8-1c0325138f27"} 1 1623691626335 +``` + ## System +![Resource Discovery Support Badge](https://img.shields.io/badge/Support%20for%20Resource%20Discovery-Yes-green.svg) +![Scraper Support Badge](https://img.shields.io/badge/Support%20for%20Scraper-Yes-green.svg) + Promitor provides a basic system endpoint that provides information about itself such as its version. ### Consuming the System endpoint @@ -111,6 +144,9 @@ We provide API documentation to make it easier for you to consume our REST APIs ### Azure Resource Manager API - Consumption & Throttling +![Resource Discovery Support Badge](https://img.shields.io/badge/Support%20for%20Resource%20Discovery-No-red.svg) +![Scraper Support Badge](https://img.shields.io/badge/Support%20for%20Scraper-Yes-green.svg) + Promitor exposes runtime metrics to provide insights on the API consumption of Azure Resource Manager API: diff --git a/src/Promitor.Agents.ResourceDiscovery/Scheduling/AzureLandscapeDiscoveryBackgroundJob.cs b/src/Promitor.Agents.ResourceDiscovery/Scheduling/AzureLandscapeDiscoveryBackgroundJob.cs new file mode 100644 index 000000000..e39929a9b --- /dev/null +++ b/src/Promitor.Agents.ResourceDiscovery/Scheduling/AzureLandscapeDiscoveryBackgroundJob.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Promitor.Agents.ResourceDiscovery.Scheduling +{ + public class AzureLandscapeDiscoveryBackgroundJob + { + } +}