-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for influxdb as a metrics provider (#1839)
* feat: add InfluxDB metric provider implementation Signed-off-by: Jayme Bird <[email protected]> * feat: add influx to metric provider util count, add missing graphite Signed-off-by: Jayme Bird <[email protected]> * feat: add protobuf definitions for InfluxdbMetric Signed-off-by: Jayme Bird <[email protected]> * feat: add docs for the Influxdb metrics provider Signed-off-by: Jayme Bird <[email protected]> * feat: add tests for influxdb metrics provider Signed-off-by: Jayme Bird <[email protected]> * feat: add go mod replace for version of moq due to security issue Signed-off-by: Jayme Bird <[email protected]> * feat: update error message to distinguish failed cases - review feedback Signed-off-by: Jayme Bird <[email protected]> * feat: update tests to simplify mocking of QueryTableResult An upstream change to the influx go client makes it easier to mock QueryTableResult in tests. This removes a lot of boilerplate duplication in the tests. Signed-off-by: Jayme Bird <[email protected]> * feat: re-run codegen Signed-off-by: Jayme Bird <[email protected]>
- Loading branch information
Showing
22 changed files
with
1,475 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# InfluxDB Metrics | ||
|
||
An [InfluxDB](https://www.influxdata.com/) query using [Flux](https://docs.influxdata.com/influxdb/cloud/query-data/get-started/query-influxdb/) can be used to obtain measurements for analysis. | ||
|
||
```yaml | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: AnalysisTemplate | ||
metadata: | ||
name: error-rate | ||
spec: | ||
args: | ||
- name: application-name | ||
metrics: | ||
- name: error-rate | ||
# NOTE: To be consistent with the prometheus metrics provider InfluxDB query results are returned as an array. | ||
# In the example we're looking at index 0 of the returned array to obtain the value we're using for the success condition | ||
successCondition: result[0] <= 0.01 | ||
provider: | ||
influxdb: | ||
profile: my-influxdb-secret # optional, defaults to 'influxdb' | ||
query: | | ||
from(bucket: "app_istio") | ||
|> range(start: -15m) | ||
|> filter(fn: (r) => r["destination_workload"] == "{{ args.application-name }}") | ||
|> filter(fn: (r) => r["_measurement"] == "istio:istio_requests_errors_percentage:rate1m:5xx") | ||
``` | ||
An InfluxDB access profile can be configured using a Kubernetes secret in the `argo-rollouts` namespace. Alternate accounts can be used by creating more secrets of the same format and specifying which secret to use in the metric provider configuration using the `profile` field. | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: influxdb | ||
type: Opaque | ||
data: | ||
address: <infuxdb-url> | ||
authToken: <influxdb-auth-token> | ||
org: <influxdb-org> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.