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

Documentation for custom KEDA scaler for Splunk Observability Cloud #1477

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
131 changes: 131 additions & 0 deletions content/docs/2.16/scalers/splunk_observability.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
+++
title = "Splunk Observability"
availability = "v2.15+"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be 2.16+ assuming the new scaler is merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sschimper-splunk looks like you put 2.6 instead of 2.16 by mistake

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the version isn't available yet, the build will fail. So you need to explicitly ignore the URL like this: https://github.com/kedacore/keda-docs/pull/1413/files#diff-9ad64044531d7d8c033064f11141586478b535147312374c24f8d2d997722889R7

maintainer = "Community"
category = "Data & Storage"
description = "Scale applications based on Splunk Observability Cloud metrics."
go_file = "splunk_observability_scaler"
+++

### Trigger Specification

This specification describes the `splunk-observability` trigger that scales based on the result of a metric series queried from the Splunk Observability Cloud platform with a [SignalFlow query](https://dev.splunk.com/observability/docs/signalflow/).

The trigger always requires the following information:

```yaml
triggers:
- type: splunk-observability
metricType: Value
metadata:
query: "data('demo.trans.latency').max().publish()"
duration: "10"
targetValue: "400.1"
activationTargetValue: "1.1"
queryAggregator: "avg"
```

**Parameter list:**

- `query` - SignalFlow query for querying the desired metrics.
- `duration` - Duration of the stream being created to query a Metric Time Series (MTS) from Splunk Observability Cloud. The specified duration is in seconds.
- `targetValue` - Threshold to reach to start scaling.
- `activationTargetValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).
- `queryAggregator` - When querying metrics from Splunk Observability Cloud, initially a Metric Time Series (MTS) is returned, a list consiting of several datapoints. The 'queryAggregator' speicifies how this series of metrics should be "rolled up". Valid values for this field are "avg", which returnes the average, "min", which returns the minimun of the metrics in the series, and "max", which returns the maximun value.

### Authentication Parameters

You can authenticate by using an access token and a realm for Splunk Observability Cloud. You will need to use `TriggerAuthentication` CRD to configure the authentication.

> **Note:**
>
> `TriggerAuthentication` is required to use this scaler due to the hard requirement of providing a `accessToken` and a `realm` for Splunk Observability Cloud.

**Parameter list:**

- `accessToken` - Splunk Observability Cloud Access Token.
- `realm` - Splunk Observability Cloud Realm.

### Example

The following example shows how to scale a simple NGINX employment with the help of KEDA and the Splunk Observability Cloud scaler:

#### Simple NGINX employment

```yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
```

#### Authentication

```yaml
---
apiVersion: v1
kind: Secret
metadata:
name: splunk-secrets
data:
accessToken: dGVzdF9hY2Nlc3NfdG9rZW4= # base64-encrypted example access token
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base64 encoded since base64 isn't encryption

realm: dGVzdF9yZWFsbQ== # base64-encrypted example realm
---
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-trigger-auth-splunk-secret
spec:
secretTargetRef:
- parameter: accessToken
name: splunk-secrets
key: accessToken
- parameter: realm
name: splunk-secrets
key: realm
```

#### Keda Scaler
```yaml
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: keda
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: nginx
pollingInterval: 30
cooldownPeriod: 30
minReplicaCount: 1
maxReplicaCount: 10
triggers:
- type: splunk-observability
metricType: Value
metadata:
query: "data('demo.trans.count', filter=filter('demo_host', 'server6'), rollup='rate').sum(by=['demo_host']).publish()"
duration: "10"
queryValue: "400.1"
activationQueryValue: "1.1"
queryAggregator: "max" # 'min', 'max', or 'avg'
authenticationRef:
name: keda-trigger-auth-splunk-secret
```
Loading