Skip to content

Commit 71e5941

Browse files
authored
docs: Add transaction count example for newrelic scaler (#1510)
* Add transaction count using `rate()` example for newrelic scaler Signed-off-by: Younsung Lee <cysl@kakao.com>
1 parent ca96288 commit 71e5941

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

content/docs/2.17/scalers/new-relic.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ You can use `TriggerAuthentication` CRD to configure the authentication with a `
5858

5959
### Example
6060

61+
Autoscaling trigger based on transaction duration average metric:
62+
6163
```yaml
6264
apiVersion: v1
6365
kind: Secret
@@ -106,3 +108,53 @@ spec:
106108
authenticationRef:
107109
name: keda-trigger-auth-new-relic
108110
```
111+
112+
Autoscaling trigger based on transaction count [rate](https://docs.newrelic.com/docs/nrql/using-nrql/rate-function/) metric:
113+
114+
```yaml
115+
apiVersion: v1
116+
kind: Secret
117+
metadata:
118+
name: new-relic-secret
119+
namespace: my-project
120+
type: Opaque
121+
data:
122+
apiKey: TlJBSy0xMjM0NTY3ODkwMTIzNDU2Nwo= # base64 encoding of the new relic api key NRAK-12345678901234567
123+
account: MTIzNDU2 # base64 encoding of the new relic account number 123456
124+
region: VVM= # base64 encoding of the new relic region US
125+
---
126+
apiVersion: keda.sh/v1alpha1
127+
kind: TriggerAuthentication
128+
metadata:
129+
name: keda-trigger-auth-new-relic
130+
namespace: my-project
131+
spec:
132+
secretTargetRef:
133+
- parameter: queryKey
134+
name: new-relic-secret
135+
key: apiKey
136+
- parameter: account
137+
name: new-relic-secret
138+
key: account
139+
- parameter: region
140+
name: new-relic-secret
141+
key: region
142+
---
143+
apiVersion: keda.sh/v1alpha1
144+
kind: ScaledObject
145+
metadata:
146+
name: newrelic-scaledobject
147+
namespace: keda
148+
spec:
149+
maxReplicaCount: 12
150+
scaleTargetRef:
151+
name: dummy
152+
triggers:
153+
- type: new-relic
154+
metadata:
155+
nrql: "SELECT rate(count(*), 10 SECOND) FROM Transaction WHERE appName='SITE' SINCE 1 MINUTE AGO"
156+
noDataError: "true"
157+
threshold: '300'
158+
authenticationRef:
159+
name: keda-trigger-auth-new-relic
160+
```

0 commit comments

Comments
 (0)