forked from kedacore/keda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Provide New Relic scaler (kedacore#591)
Signed-off-by: Joshua Jackson <[email protected]>
- Loading branch information
1 parent
0d98d90
commit 02244a9
Showing
1 changed file
with
92 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
+++ | ||
title = "New Relic" | ||
availability = "2.6+" | ||
maintainer = "Community" | ||
description = "Scale applications based on New Relic NRQL" | ||
layout = "scaler" | ||
go_file = "newrelic_scaler" | ||
+++ | ||
|
||
### Trigger Specification | ||
|
||
This specification describes the `new-relic` trigger that scales based on a New Relic metric. | ||
|
||
```yaml | ||
triggers: | ||
- type: new-relic | ||
metadata: | ||
# Required: Account - Subaccount to run the query on | ||
account: 1234567 | ||
# Required: QueryKey - Api key to connect to New Relic | ||
queryKey: "NRAK-xxxxxxxxxxxxxxxxxxxxxxxxxxx" | ||
# Optional: nrRegion - Region to query data for. Default value is US. | ||
region: "US" | ||
# Optional: noDataError - If the query returns no data should this be treated as an error. Default value is false. | ||
noDataError: "true" | ||
# Required: nrql | ||
nrql: "SELECT average(duration) from Transaction where appName='SITE' TIMESERIES" | ||
# Required: threshold | ||
threshold: 100 | ||
``` | ||
**Parameter list:** | ||
- `account` - The account within New Relic that the request should be targeted against. | ||
- `queryKey` - The API key that will be leveraged to connect to New Relic and make requests. [official documentation](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/) | ||
- `region` - The region to connect to for the New Relic apis. (Values: `LOCAL`, `EU`, `STAGING`, `US`, Default: `US`, Optional) | ||
- `noDataError` - Should queries that return nodata be treated as an error (Values: `true`, `false`, Default: `false`, Optional) | ||
- `nrql` - The New Relic query that will be run to get the data requested. [official documentation](https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language/) | ||
- `threshold` - A threshold that is used as the `targetAverageValue` in the HPA configuration. | ||
|
||
### Authentication Parameters | ||
|
||
You can use `TriggerAuthentication` CRD to configure the authentication with a `queryKey`. | ||
|
||
**Authentication:** | ||
|
||
- `queryKey` - The API key that will be leveraged to connect to New Relic and make requests. [official documentation](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/) | ||
|
||
### Example | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: new-relic-secret | ||
namespace: my-project | ||
type: Opaque | ||
data: | ||
apiKey: TlJBSy0xMjM0NTY3ODkwMTIzNDU2Nwo= # base64 encoding of the new relic api key NRAK-12345678901234567 | ||
--- | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: TriggerAuthentication | ||
metadata: | ||
name: keda-trigger-auth-new-relic | ||
namespace: my-project | ||
spec: | ||
secretTargetRef: | ||
- parameter: queryKey | ||
name: new-relic-secret | ||
key: apiKey | ||
--- | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: ScaledObject | ||
metadata: | ||
name: newrelic-scaledobject | ||
namespace: keda | ||
spec: | ||
maxReplicaCount: 12 | ||
scaleTargetRef: | ||
name: dummy | ||
triggers: | ||
- type: new-relic | ||
metadata: | ||
account: 1234567 | ||
region: "US" | ||
nrql: "SELECT average(duration) from Transaction where appName='SITE' TIMESERIES" | ||
noDataError: "true" | ||
threshold: 1000 | ||
authenticationRef: | ||
name: keda-trigger-auth-new-relic | ||
``` |