Skip to content

Commit

Permalink
document Graphite metrics provider (#9)
Browse files Browse the repository at this point in the history
This adds documentation of the Graphite metrics
provider in support of addressing issue #911.

Co-authored-by: Mike Ball <mike.ball@warnermedia.com>
Co-authored-by: Nathan Mische <Nathan.Mische@warnermedia.com>
Signed-off-by: Mike Ball <mike.ball@warnermedia.com>
Signed-off-by: Nathan Mische <Nathan.Mische@warnermedia.com>
  • Loading branch information
mdb and nmische committed May 24, 2021
1 parent 4654f2c commit 6a66113
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions docs/gitbook/usage/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,3 +401,78 @@ Reference the template in the canary analysis:
max: 5
interval: 1m
```

## Graphite

You can create custom metric checks using the Graphite provider.

Graphite template example:

```yaml
apiVersion: flagger.app/v1beta1
kind: MetricTemplate
metadata:
name: graphite-request-success-rate
spec:
provider:
type: graphite
address: http://graphite.monitoring
query: |
target=summarize(
asPercent(
sumSeries(
stats.timers.httpServerRequests.exception.*.method.*.outcome.{CLIENT_ERROR,INFORMATIONAL,REDIRECTION,SUCCESS}.status.*.uri.*.count
),
sumSeries(
stats.timers.httpServerRequests.exception.*.method.*.outcome.*.status.*.uri.*.count
)
),
{{interval}},
'avg'
)
```

Reference the template in the canary analysis:

```yaml
analysis:
metrics:
- name: "success rate"
templateRef:
name: graphite-request-success-rate
thresholdRange:
min: 90
interval: 1min
```

## Graphite authentication

If your Graphite API requires basic authentication, you can create a secret in the same namespace
as the `MetricTemplate` with the basic-auth credentials:

```yaml
apiVersion: v1
kind: Secret
metadata:
name: graphite-basic-auth
namespace: flagger
data:
username: your-user
password: your-password
```

Then, reference the secret in the `MetricTemplate`:

```yaml
apiVersion: flagger.app/v1beta1
kind: MetricTemplate
metadata:
name: my-metric
namespace: flagger
spec:
provider:
type: graphite
address: http://graphite.monitoring
secretRef:
name: graphite-basic-auth
```

0 comments on commit 6a66113

Please sign in to comment.