Skip to content

Commit

Permalink
feat(analysis): Add Datadog metric provider. Fixes #702 (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-harris authored Oct 9, 2020
1 parent be3495d commit 6c3fcfe
Show file tree
Hide file tree
Showing 14 changed files with 655 additions and 1 deletion.
39 changes: 39 additions & 0 deletions docs/features/analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -881,3 +881,42 @@ was greater than `0.90`
NOTE: if the result is a string, two convenience functions `asInt` and `asFloat` are provided
to convert a result value to a numeric type so that mathematical comparison operators can be used
(e.g. >, <, >=, <=).

## Datadog Metrics

A [Datadog](https://www.datadoghq.com/) query can be used to obtain measurements for analysis.

```yaml
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: loq-error-rate
spec:
args:
- name: service-name
metrics:
- name: error-rate
interval: 5m
successCondition: result <= 0.01
failureLimit: 3
provider:
datadog:
interval: 5m
query: |
sum:requests.error.count{service:{{args.service-name}}} /
sum:requests.request.count{service:{{args.service-name}}}
```

Datadog api and app tokens can be configured in a kubernetes secret in argo-rollouts namespace.

```yaml
apiVersion: v1
kind: Secret
metadata:
name: datadog
type: Opaque
data:
address: https://api.datadoghq.com
api-key: <datadog-api-key>
app-key: <datadog-app-key>
```
9 changes: 9 additions & 0 deletions manifests/crds/analysis-run-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ spec:
type: string
provider:
properties:
datadog:
properties:
interval:
type: string
query:
type: string
required:
- query
type: object
job:
properties:
metadata:
Expand Down
9 changes: 9 additions & 0 deletions manifests/crds/analysis-template-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ spec:
type: string
provider:
properties:
datadog:
properties:
interval:
type: string
query:
type: string
required:
- query
type: object
job:
properties:
metadata:
Expand Down
9 changes: 9 additions & 0 deletions manifests/crds/cluster-analysis-template-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ spec:
type: string
provider:
properties:
datadog:
properties:
interval:
type: string
query:
type: string
required:
- query
type: object
job:
properties:
metadata:
Expand Down
33 changes: 33 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ spec:
type: string
provider:
properties:
datadog:
properties:
address:
type: string
interval:
type: string
query:
type: string
required:
- query
type: object
job:
properties:
metadata:
Expand Down Expand Up @@ -2888,6 +2899,17 @@ spec:
type: string
provider:
properties:
datadog:
properties:
address:
type: string
interval:
type: string
query:
type: string
required:
- query
type: object
job:
properties:
metadata:
Expand Down Expand Up @@ -5623,6 +5645,17 @@ spec:
type: string
provider:
properties:
datadog:
properties:
address:
type: string
interval:
type: string
query:
type: string
required:
- query
type: object
job:
properties:
metadata:
Expand Down
33 changes: 33 additions & 0 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ spec:
type: string
provider:
properties:
datadog:
properties:
address:
type: string
interval:
type: string
query:
type: string
required:
- query
type: object
job:
properties:
metadata:
Expand Down Expand Up @@ -2888,6 +2899,17 @@ spec:
type: string
provider:
properties:
datadog:
properties:
address:
type: string
interval:
type: string
query:
type: string
required:
- query
type: object
job:
properties:
metadata:
Expand Down Expand Up @@ -5623,6 +5645,17 @@ spec:
type: string
provider:
properties:
datadog:
properties:
address:
type: string
interval:
type: string
query:
type: string
required:
- query
type: object
job:
properties:
metadata:
Expand Down
Loading

0 comments on commit 6c3fcfe

Please sign in to comment.