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
make fmt, make gen
  • Loading branch information
johnstcn committed May 17, 2023
commit 59ef44541b7234e46e8ae14b1f23573adc76019d
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ site/stats/
./scaletest/terraform/.terraform
./scaletest/terraform/.terraform.lock.hcl
terraform.tfstate.*
**/*.tfvars
# .prettierignore.include:
# Helm templates contain variables that are invalid YAML and can't be formatted
# by Prettier.
Expand Down
4 changes: 2 additions & 2 deletions cli/testdata/coder_scaletest_workspace-traffic_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Generate traffic to scaletest workspaces through coderd
Output format specs in the format "<format>[:<path>]". Not specifying
a path will default to stdout. Available formats: text, json.

--prometheus-address string, $CODER_SCALETEST_PROMETHEUS_ADDRESS (default: 0.0.0.0:2112)
Address on which to expose prometheus metrics.
--scaletest-prometheus-address string, $CODER_SCALETEST_PROMETHEUS_ADDRESS (default: 0.0.0.0:21112)
Address on which to expose scaletest prometheus metrics.

--tick-interval duration, $CODER_SCALETEST_WORKSPACE_TRAFFIC_TICK_INTERVAL (default: 100ms)
How often to send traffic.
Expand Down
10 changes: 10 additions & 0 deletions docs/cli/scaletest_workspace-traffic.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ Timeout per job. Jobs may take longer to complete under higher concurrency limit

Output format specs in the format "<format>[:<path>]". Not specifying a path will default to stdout. Available formats: text, json.

### --scaletest-prometheus-address

| | |
| ----------- | ------------------------------------------------ |
| Type | <code>string</code> |
| Environment | <code>$CODER_SCALETEST_PROMETHEUS_ADDRESS</code> |
| Default | <code>0.0.0.0:21112</code> |

Address on which to expose scaletest prometheus metrics.

### --tick-interval

| | |
Expand Down
7 changes: 5 additions & 2 deletions scaletest/terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ project_id = "some_google_project_id"
1. Run `coder_init.sh <coder_url>` to setup an initial user and a pre-configured Kubernetes
template. It will also download the Coder CLI from the Coder instance locally.

1. Do whatever you need to do with the Coder instance.
1. Do whatever you need to do with the Coder instance:

> To run Coder commands against the instance, you can use `coder_shim.sh <command>`.
> Note: To run Coder commands against the instance, you can use `coder_shim.sh <command>`.
> You don't need to run `coder login` yourself.

- To create workspaces, run `./coder_shim.sh scaletest create-workspaces --template="kubernetes" --count=N`
Copy link
Member

Choose a reason for hiding this comment

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

I believe that at some point you may want to include also rich parameters as they cause more DB calls in total (worst case scenario).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, that would be a good test for load related to concurrent workspace builds.
For the moment though, I'm going to keep it simple with zero parameters.

- To generate workspace traffic, run `./coder_trafficgen.sh <name of loadtest from your Terraform vars>`. This will keep running until you delete the pod `coder-scaletest-workspace-traffic`.

1. When you are finished, you can run `terraform destroy -var-file=override.tfvars`.
1 change: 1 addition & 0 deletions scaletest/terraform/coder_workspacetraffic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fi
LOADTEST_NAME="$1"
CODER_TOKEN=$(./coder_shim.sh tokens create)
CODER_URL="http://coder.coder-${LOADTEST_NAME}.svc.cluster.local"
export KUBECONFIG="${PWD}/.coderv2/${LOADTEST_NAME}-cluster.kubeconfig"

cat <<EOF | kubectl apply -f -
apiVersion: v1
Expand Down
1 change: 1 addition & 0 deletions site/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ stats/
.././scaletest/terraform/.terraform
.././scaletest/terraform/.terraform.lock.hcl
terraform.tfstate.*
**/*.tfvars
# .prettierignore.include:
# Helm templates contain variables that are invalid YAML and can't be formatted
# by Prettier.
Expand Down
1 change: 1 addition & 0 deletions site/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ stats/
.././scaletest/terraform/.terraform
.././scaletest/terraform/.terraform.lock.hcl
terraform.tfstate.*
**/*.tfvars
# .prettierignore.include:
# Helm templates contain variables that are invalid YAML and can't be formatted
# by Prettier.
Expand Down