Skip to content

chore: add prometheus monitoring of workspace traffic generation #7583

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

Merged
merged 21 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
fixup! add convenience script to create traffic inside cluster
  • Loading branch information
johnstcn committed May 17, 2023
commit fb96c4d109c655cd5ffa32177ffdd080ad317164
11 changes: 9 additions & 2 deletions scaletest/terraform/coder_workspacetraffic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,20 @@ spec:
- command:
- sh
- -c
- "curl -fsSL $CODER_URL/bin/coder-linux-amd64 -o /tmp/coder && chmod +x /tmp/coder && /tmp/coder --url=$CODER_URL --token=$CODER_TOKEN scaletest workspace-traffic --concurrency 0 --job-timeout=30m --scaletest-prometheus-address 0.0.0.0:21112"
- "curl -fsSL $CODER_URL/bin/coder-linux-amd64 -o /tmp/coder && chmod +x /tmp/coder && /tmp/coder --url=$CODER_URL --token=$CODER_TOKEN scaletest workspace-traffic"
env:
- name: CODER_URL
value: $CODER_URL
- name: CODER_TOKEN
value: $CODER_TOKEN
- name: CODER_SCALETEST_PROMETHEUS_ADDRESS
value: "0.0.0.0:21112"
- name: CODER_SCALETEST_JOB_TIMEOUT
value: "30m"
- name: CODER_SCALETEST_CONCURRENCY
value: "0"
- name: CODER_SCALETEST_WORKSPACE_TRAFFIC_BYTES_PER_TICK
value: "2048"
ports:
- containerPort: 21112
name: prometheus-http
Expand All @@ -62,4 +70,3 @@ spec:
- port: prometheus-http
interval: 15s
EOF

8 changes: 4 additions & 4 deletions scaletest/terraform/prometheus.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ prometheus:
# after creating a cluster, and we want this to be brought up
# with a single command.
resource "local_file" "coder-monitoring-manifest" {
filename = "${path.module}/.coderv2/coder-monitoring.yaml"
depends_on = [ helm_release.prometheus-chart ]
content = <<EOF
filename = "${path.module}/.coderv2/coder-monitoring.yaml"
depends_on = [helm_release.prometheus-chart]
content = <<EOF
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
Expand Down Expand Up @@ -141,5 +141,5 @@ KUBECONFIG=${var.name}-cluster.kubeconfig gcloud container clusters get-credenti
KUBECONFIG=${var.name}-cluster.kubeconfig kubectl apply -f ${abspath(local_file.coder-monitoring-manifest.filename)}
EOF
}
depends_on = [ helm_release.prometheus-chart ]
depends_on = [helm_release.prometheus-chart]
}