Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

chore: structure a example directory #177

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ wave.db
:memory:
telegraf*/
vector*/
!examples/metrics/telegraf/
!examples/metrics/vector/

# VSCode
.vscode/
Expand Down
5 changes: 5 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**Examples for Wave Autoscale**

- Metrics
- Scaling Components
- Plan Triggers
1 change: 1 addition & 0 deletions examples/metrics/telegraf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Metrics Collected By Telegraf**
1 change: 1 addition & 0 deletions examples/metrics/vector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Metrics Collected By Vector**
19 changes: 19 additions & 0 deletions examples/metrics/vector/prometheus_client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# https://vector.dev/docs/reference/configuration/sources/prometheus_scrape/#query
---
kind: Metric
id: vector_prometheus_metrics
collector: vector
metadata:
sources:
my_source_id_1:
type: prometheus_scrape
endpoints: ["http://localhost:9090/metrics"]
scrape_interval_secs: 15
query:
"match[]":
- '{job="somejob"}'
- '{__name__=~"job:.*"}'
sinks:
my_sinks_id:
type: wave-autoscale
inputs: ["my_source_id_1"] # last transform id or source id
33 changes: 33 additions & 0 deletions examples/metrics/vector/prometheus_server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# source: https://vector.dev/docs/reference/configuration/sources/http_client/
# transform: https://vector.dev/docs/reference/configuration/transforms/remap/
---
kind: Metric
id: vector_prometheus_metrics
collector: vector
metadata:
sources:
my_source_id_1:
type: http_client
endpoint: "http://34.64.190.189:9090/api/v1/query"
scrape_interval_secs: 30
query:
"query":
[
'rate(istio_request_duration_milliseconds_sum{destination_workload="node-server-dp",response_code="200",reporter="destination"}[1m])',
]
transforms:
my_transforms_id_1:
inputs: ["my_source_id_1"]
type: remap
source: |-
. = parse_json!(.message)
tally = []
for_each(array!(.data.result)) -> |_index, value| {
tally = push(tally, {\"name\": \"name_1\", \"tags\": value.metric, \"timestamp\": value.value[0], \"gauge\": {\"value\" : value.value[1]}})
}
tally
. = tally
sinks:
my_sinks_id:
type: wave-autoscale
inputs: ["my_transforms_id_1"] # last transform id or source id
1 change: 1 addition & 0 deletions examples/scaling-components/aws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**AWS Scaling Components**
1 change: 1 addition & 0 deletions examples/scaling-components/azure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Azure Scaling Components**
1 change: 1 addition & 0 deletions examples/scaling-components/google-cloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Google Cloud Scaling Components**
1 change: 1 addition & 0 deletions examples/scaling-components/kubernetes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Kubernetes Scaling Components**
1 change: 1 addition & 0 deletions examples/triggers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Triggers**
1 change: 1 addition & 0 deletions examples/triggers/cron-expression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Kubernetes Scaling Components**
1 change: 1 addition & 0 deletions examples/triggers/javascript-expression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Kubernetes Scaling Components**
Loading