Skip to content

Commit

Permalink
SRE-610 - Adding prometheus new ingest url and prometheus dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jsclifford committed Jun 24, 2024
1 parent ba7b565 commit 74ec423
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
17 changes: 12 additions & 5 deletions workflow-templates/im-test-k6-manual.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow Code: ZestyFlamingo_v23 DO NOT REMOVE
# Workflow Code: ZestyFlamingo_v24 DO NOT REMOVE
# Purpose:
# Uses a container to run a K6 stress test against the environment and
# with the test file the user specifies when they kick it off manually.
Expand Down Expand Up @@ -48,15 +48,22 @@ on:
required: false
type: boolean
default: false # TODO: Set true if you require npm build to run for your k6 bundle to be created
output-to-prometheus:
description: 'Output to Prometheus: Enable output to Prometheus.'
required: false
type: boolean
default: true

env:
WORKING_DIRECTORY: './tests/k6' # TODO: Update k6 test folder path
NODE_VERSION: '16.x' # TODO: Set correct node version or delete if not use npm to build tests
NODE_VERSION: '20.x' # TODO: Set correct node version or delete if not use npm to build tests
# InfluxDB addresses -
# DNS: https://influxdb-v1.mktp.io/loadtesting
GRAFANA_DASHBOARD_URI: 'https://grafana.mktp.io/d/SizO_pC4k/k6-load-testing-results-with-env?orgId=1&from=now-1h&to=now&var-ProductTag=<your-product-tag>&var-env=${{ inputs.env }}' # TODO: Update product tag
K6_DEFAULT_PARAMETERS: '--out influxdb=\"https://influxdb-v1.mktp.io/loadtesting\" --insecure-skip-tls-verify --tag NAME=${{ inputs.run-name }},product=<your-product-tag>,family=pf,env=${{ inputs.env }} -e RUN_ENV=${{ inputs.env }}' # TODO: Set default k6 parameters specifically replace product and family tags.
K6_VERSION: 'v0.45.0'
GRAFANA_PROMETHEUS_DASHBOARD_URI: 'https://grafana.mktp.io/d/a3b2aaa8-bb66-4008-a1d8-16c49afedbf0/k6-prometheus?orgId=1&refresh=10s&var-quantile=0.99'
K6_DEFAULT_PARAMETERS: "${{ inputs.output-to-prometheus && '--out experimental-prometheus-rw' || '--out influxdb=\"https://influxdb-v1.mktp.io/loadtesting\"' }} --insecure-skip-tls-verify --tag NAME=${{ inputs.run-name }},product=<your-product-tag>,family=pf,env=${{ inputs.env }} -e RUN_ENV=${{ inputs.env }}" # TODO: Set default k6 parameters specifically replace product and family tags.
K6_PROMETHEUS_PARAMATERS: "-e K6_PROMETHEUS_RW_PUSH_INTERVAL=10s -e K6_PROMETHEUS_RW_TREND_STATS=p(95),p(99),min,max -e K6_PROMETHEUS_RW_SERVER_URL=${{vars.K6_PROMETHEUS_RW_SERVER_URL_AKS}}"
K6_VERSION: 'v0.51.0' # TODO: Update to the latest k6 version

# TODO: Uncomment if you are using custom k6 binary with k6 extensions installed
# Update to desired version of releases found in https://github.com/im-practices/performance-testing/releases?q=k6&expanded=true
Expand Down Expand Up @@ -227,6 +234,6 @@ jobs:
[
{
"name": "View Grafana Dashboard",
"uri": "${{ env.GRAFANA_DASHBOARD_URI }}"
"uri": "${{ inputs.output-to-prometheus && env.GRAFANA_PROMETHEUS_DASHBOARD_URI || env.GRAFANA_DASHBOARD_URI }}"
}
]
6 changes: 3 additions & 3 deletions workflow-templates/im-test-k6-operator-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ permissions:
env:
TIMEZONE: 'america/denver' # TODO: Verify timezone
WORKING_DIRECTORY: './tests/k6' # TODO: Update k6 test folder path
GRAFANA_INFLUXDB_DASHBOARD_URI: 'https://grafana.mktp.io/d/SizO_pC4k/k6-load-testing-results-with-env?orgId=1?&from=now-1h&to=now&var-ProductTag=SHOP&var-env=${{ inputs.env }}'
GRAFANA_PROMETHEUS_DASHBOARD_URI: 'https://grafana.mktp.io/d/a3b2aaa8-bb66-4008-a1d8-16c49afedbf0/k6-prometheus-native-histograms?orgId=1&refresh=10s&var-quantile=0.99'
GRAFANA_INFLUXDB_DASHBOARD_URI: 'https://grafana.mktp.io/d/SizO_pC4k/k6-load-testing-results-with-env?orgId=1?&from=now-1h&to=now&var-ProductTag=SHOP&var-env=${{ inputs.env }}' # TODO: Update product tag
GRAFANA_PROMETHEUS_DASHBOARD_URI: 'https://grafana.mktp.io/d/a3b2aaa8-bb66-4008-a1d8-16c49afedbf0/k6-prometheus?orgId=1&refresh=10s&var-quantile=0.99'
NODE_VERSION: '20.x' # TODO: Set correct node version

K6_DEFAULT_PARAMETERS: "${{ inputs.output-to-prometheus && '--out experimental-prometheus-rw' || '--out influxdb=https://influxdb-v1.mktp.io/loadtesting' }} --insecure-skip-tls-verify --tag product=SHOP,family=EN,env=${{ inputs.env }} -e RUN_ENV=${{ inputs.env }}" # TODO: Set default k6 parameters specifically replace product and family tags.
# TODO: Optional add K6_PROMETHEUS_RW_STALE_MARKERS=true when running long load tests. This variable will make short tests not show up in grafana
K6_DEFAULT_ENVIRONMNET_VARIABLES: "K6_PROMETHEUS_RW_TREND_STATS=p(95),p(99),min,max;K6_PROMETHEUS_RW_SERVER_URL=http://prm-srv-prometheus-server.prometheus:80/api/v1/write;K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true"
K6_DEFAULT_ENVIRONMNET_VARIABLES: "K6_PROMETHEUS_RW_PUSH_INTERVAL=10s;K6_PROMETHEUS_RW_TREND_STATS=p(95),p(99),min,max;K6_PROMETHEUS_RW_SERVER_URL=${{vars.K6_PROMETHEUS_RW_SERVER_URL_AKS}}"
RETENTION_IN_DAYS: 1
K6_CONTAINER_IMAGE: 'perftest/k6:latest' # TODO: Update to k6 image version if using custom binary. Uncomment reference in Run K6-Operator Test step to use.

Expand Down
4 changes: 2 additions & 2 deletions workflow-templates/im-test-k6-operator.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow Code: ZestyAligator_v31 DO NOT REMOVE
# Workflow Code: ZestyAligator_v32 DO NOT REMOVE
# Purpose:
# Runs K6 tests at scale in Azure Kubernetes.
# With the workflow the user specifies when they kick it off manually.
Expand Down Expand Up @@ -83,7 +83,7 @@ env:

K6_DEFAULT_PARAMETERS: "${{ inputs.output-to-prometheus && '--out experimental-prometheus-rw' || '--out influxdb=https://influxdb-v1.mktp.io/loadtesting' }} --insecure-skip-tls-verify --tag product=SHOP,family=EN,env=${{ inputs.env }} -e RUN_ENV=${{ inputs.env }}"
# TODO: Optional add K6_PROMETHEUS_RW_STALE_MARKERS=true when running long load tests. This variable will make short tests not show up in grafana
K6_DEFAULT_ENVIRONMNET_VARIABLES: "K6_PROMETHEUS_RW_TREND_STATS=p(95),p(99),min,max;K6_PROMETHEUS_RW_SERVER_URL=http://prm-srv-prometheus-server.prometheus:80/api/v1/write;K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true"
K6_DEFAULT_ENVIRONMNET_VARIABLES: "K6_PROMETHEUS_RW_PUSH_INTERVAL=10s;K6_PROMETHEUS_RW_TREND_STATS=p(95),p(99),min,max;K6_PROMETHEUS_RW_SERVER_URL=${{vars.K6_PROMETHEUS_RW_SERVER_URL_AKS}}"
LOOP_DURATION: '1m' # TODO: Update duration of loop to your specification. The action im-practices/run-k6-operator-test documenation has more details on setting this parameter.
RETENTION_IN_DAYS: 1 # TODO: Set retention in days for uploaded artifacts
K6_CONTAINER_IMAGE: 'perftest/k6:latest' # TODO: Update to k6 image version if using custom binary. Uncomment reference in Run K6-Operator Test step to use.
Expand Down

0 comments on commit 74ec423

Please sign in to comment.