Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add datadog metric provider. Fixes #702 #705

Merged
merged 13 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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