From 5e69ae36f59b1cfc4d562852b6acf24c8404834e Mon Sep 17 00:00:00 2001 From: Mischa Thompson Date: Wed, 13 Sep 2023 21:16:24 -0700 Subject: [PATCH 1/2] Update prometheus.exporter.cloudwatch docs --- .../prometheus.exporter.cloudwatch.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md b/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md index d33d135d80a9..cb8ae20d7764 100644 --- a/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md +++ b/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md @@ -154,9 +154,9 @@ job. [static]: #static-block [metric]: #metric-block [role]: #role-block -[decoupled_scraping]: #decoupled-scraping-block +[decoupled_scraping]: #decoupled_scraping-block -## discovery block +### discovery block The `discovery` block allows the component to scrape CloudWatch metrics with only the AWS service and a list of metrics under that service/namespace. @@ -201,7 +201,7 @@ different `search_tags`. [supported-services]: #supported-services-in-discovery-jobs -## static block +### static block The `static` block configures the component to scrape a specific set of CloudWatch metrics. The metrics need to be fully qualified with the following specifications: @@ -258,7 +258,7 @@ require `Resource`, `Service`, `Class`, and `Type` dimensions to be specified. T metrics, all dimensions attached to a metric when saved in CloudWatch are required. -## metric block +### metric block Represents an AWS Metrics to scrape. To see available metrics, AWS does not keep a documentation page with all available metrics. @@ -274,7 +274,7 @@ on how to explore metrics, to easily pick the ones you need. [period]: #period-and-length -## role block +### role block Represents an [AWS IAM Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html). If omitted, the AWS role that corresponds to the credentials configured in the environment will be used. @@ -293,7 +293,21 @@ in the AWS IAM documentation for more information about how to configure this. [details]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html -## period and length +### decoupled_scraping block + +The `decoupled_scraping` block configures an optional feature that scrapes CloudWatch metrics in the background on a +scheduled interval. When this feature is enabled, CloudWatch metrics are gathered asynchronously at the scheduled interval instead +of synchronously when the CloudWatch component is scraped. + +The decoupled scraping feature reduces the number of API requests sent to AWS. +This feature also prevents component scrape timeouts when you gather high volumes of CloudWatch metrics + +| Name | Type | Description | Default | Required | +| ----------------- | -------- | ----------------------------------------------------------------------- | ------- | -------- | +| `enabled` | `bool` | Controls whether the decoupled scraping featured is enabled | false | no | +| `scrape_interval` | `string` | Controls how frequently to asynchronously gather new CloudWatch metrics | 5m | no | + +## `period` and `length` `period` controls primarily the width of the time bucket used for aggregating metrics collected from CloudWatch. `length` @@ -325,20 +339,6 @@ is exported to CloudWatch. ![](https://grafana.com/media/docs/agent/cloudwatch-multiple-period-time-model.png) -## decoupled scraping block - -The decoupled scraping block configures an optional feature that scrapes CloudWatch metrics in the background on a -scheduled interval. When this feature is enabled, CloudWatch metrics are gathered asynchronously at the scheduled interval instead -of synchronously when the CloudWatch component is scraped. - -The decoupled scraping feature reduces the number of API requests sent to AWS. -This feature also prevents component scrape timeouts when you gather high volumes of CloudWatch metrics - -| Name | Type | Description | Default | Required | -| ----------------- | -------- | ----------------------------------------------------------------------- | ------- | -------- | -| `enabled` | `bool` | Controls whether the decoupled scraping featured is enabled | false | no | -| `scrape_interval` | `string` | Controls how frequently to asynchronously gather new CloudWatch metrics | 5m | no | - ## Exported fields {{< docs/shared lookup="flow/reference/components/exporter-component-exports.md" source="agent" version="" >}} From e69deac61ffaa3246ebbc0982f82c330950ff746 Mon Sep 17 00:00:00 2001 From: Mischa Thompson Date: Thu, 14 Sep 2023 10:01:33 -0700 Subject: [PATCH 2/2] Move period and length section and remove backticks from header --- .../prometheus.exporter.cloudwatch.md | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md b/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md index cb8ae20d7764..53f26404ac47 100644 --- a/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md +++ b/docs/sources/flow/reference/components/prometheus.exporter.cloudwatch.md @@ -274,6 +274,38 @@ on how to explore metrics, to easily pick the ones you need. [period]: #period-and-length +#### period and length + +`period` controls primarily the width of the time bucket used for aggregating metrics collected from +CloudWatch. `length` +controls how far back in time CloudWatch metrics are considered during each agent scrape. If both settings are +configured, +the time parameters when calling CloudWatch APIs works as follows: + +![](https://grafana.com/media/docs/agent/cloudwatch-period-and-length-time-model-2.png) + +As noted above, if across multiple metrics under the same static or discovery job, there's different `period` +and/or `length` +the minimum of all periods, and maximum of all lengths is configured. + +On the other hand, if `length` is not configured, both period and length settings will be calculated based on the +required +`period` configuration attribute. + +If all metrics within a job (discovery or static) have the same `period` value configured, CloudWatch APIs will be +requested +for metrics from the scrape time, to `period`s seconds in the past. The values of these are exported to Prometheus. + +![](https://grafana.com/media/docs/agent/cloudwatch-single-period-time-model.png) + +On the other hand, if metrics with different `period`s are configured under an individual job, this works differently. +First, two variables are calculated aggregating all periods: `length`, taking the maximum value of all periods, and +the new `period` value, taking the minimum of all periods. Then, CloudWatch APIs will be requested for metrics from +`now - length` to `now`, aggregating each in samples for `period` seconds. For each metric, the most recent sample +is exported to CloudWatch. + +![](https://grafana.com/media/docs/agent/cloudwatch-multiple-period-time-model.png) + ### role block Represents an [AWS IAM Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html). If omitted, the AWS role @@ -307,38 +339,6 @@ This feature also prevents component scrape timeouts when you gather high volume | `enabled` | `bool` | Controls whether the decoupled scraping featured is enabled | false | no | | `scrape_interval` | `string` | Controls how frequently to asynchronously gather new CloudWatch metrics | 5m | no | -## `period` and `length` - -`period` controls primarily the width of the time bucket used for aggregating metrics collected from -CloudWatch. `length` -controls how far back in time CloudWatch metrics are considered during each agent scrape. If both settings are -configured, -the time parameters when calling CloudWatch APIs works as follows: - -![](https://grafana.com/media/docs/agent/cloudwatch-period-and-length-time-model-2.png) - -As noted above, if across multiple metrics under the same static or discovery job, there's different `period` -and/or `length` -the minimum of all periods, and maximum of all lengths is configured. - -On the other hand, if `length` is not configured, both period and length settings will be calculated based on the -required -`period` configuration attribute. - -If all metrics within a job (discovery or static) have the same `period` value configured, CloudWatch APIs will be -requested -for metrics from the scrape time, to `period`s seconds in the past. The values of these are exported to Prometheus. - -![](https://grafana.com/media/docs/agent/cloudwatch-single-period-time-model.png) - -On the other hand, if metrics with different `period`s are configured under an individual job, this works differently. -First, two variables are calculated aggregating all periods: `length`, taking the maximum value of all periods, and -the new `period` value, taking the minimum of all periods. Then, CloudWatch APIs will be requested for metrics from -`now - length` to `now`, aggregating each in samples for `period` seconds. For each metric, the most recent sample -is exported to CloudWatch. - -![](https://grafana.com/media/docs/agent/cloudwatch-multiple-period-time-model.png) - ## Exported fields {{< docs/shared lookup="flow/reference/components/exporter-component-exports.md" source="agent" version="" >}}