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

Commit

Permalink
Merge pull request #177 from STCLab-Inc/176-structure-a-example-direc…
Browse files Browse the repository at this point in the history
…tory

chore: structure a example directory
  • Loading branch information
pueding authored Oct 18, 2023
2 parents aa58410 + 8b08b40 commit 7f7923a
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 0 deletions.
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**

0 comments on commit 7f7923a

Please sign in to comment.