From 94d3e41ef167841cfc23b041088d52773f3661e8 Mon Sep 17 00:00:00 2001 From: Sebastian Schimper Date: Thu, 26 Sep 2024 09:45:02 +0200 Subject: [PATCH 1/2] initial signed commit on feature/splunk-observability-docs Signed-off-by: Sebastian Schimper --- .../docs/2.16/scalers/splunk_observability.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 content/docs/2.16/scalers/splunk_observability.md diff --git a/content/docs/2.16/scalers/splunk_observability.md b/content/docs/2.16/scalers/splunk_observability.md new file mode 100644 index 000000000..16cd64ccc --- /dev/null +++ b/content/docs/2.16/scalers/splunk_observability.md @@ -0,0 +1,131 @@ ++++ +title = "Splunk Observability" +availability = "v2.15+" +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 + 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 +``` \ No newline at end of file From 9c0502dff46bcba56b267dac0e898ed873e14aef Mon Sep 17 00:00:00 2001 From: Sebastian Schimper Date: Fri, 27 Sep 2024 07:53:44 +0200 Subject: [PATCH 2/2] worked feedback on version and base64 into the docs Signed-off-by: Sebastian Schimper --- content/docs/2.16/scalers/splunk_observability.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/2.16/scalers/splunk_observability.md b/content/docs/2.16/scalers/splunk_observability.md index 16cd64ccc..87c131380 100644 --- a/content/docs/2.16/scalers/splunk_observability.md +++ b/content/docs/2.16/scalers/splunk_observability.md @@ -1,6 +1,6 @@ +++ title = "Splunk Observability" -availability = "v2.15+" +availability = "v2.6+" maintainer = "Community" category = "Data & Storage" description = "Scale applications based on Splunk Observability Cloud metrics." @@ -84,8 +84,8 @@ kind: Secret metadata: name: splunk-secrets data: - accessToken: dGVzdF9hY2Nlc3NfdG9rZW4= # base64-encrypted example access token - realm: dGVzdF9yZWFsbQ== # base64-encrypted example realm + accessToken: dGVzdF9hY2Nlc3NfdG9rZW4= # base64-encoded example access token + realm: dGVzdF9yZWFsbQ== # base64-encoded example realm --- apiVersion: keda.sh/v1alpha1 kind: TriggerAuthentication