diff --git a/charts/k6-operator/Chart.yaml b/charts/k6-operator/Chart.yaml index 83704e063..8db48acea 100644 --- a/charts/k6-operator/Chart.yaml +++ b/charts/k6-operator/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: k6-op description: k6 chart for k8s -version: 0.2.1 +version: 0.2.2 appVersion: "1.16.0" dependencies: - name: k6-operator diff --git a/charts/k6-operator/staging-values.yaml b/charts/k6-operator/staging-values.yaml index 2ca62c501..1a36203cd 100644 --- a/charts/k6-operator/staging-values.yaml +++ b/charts/k6-operator/staging-values.yaml @@ -10,4 +10,3 @@ k6-operator: limits: cpu: 1000m memory: 1Gi - diff --git a/charts/k6-operator/templates/k6-probe-configmap.yaml b/charts/k6-operator/templates/k6-probe-configmap.yaml index f91e8d8d2..a31fbd3ac 100644 --- a/charts/k6-operator/templates/k6-probe-configmap.yaml +++ b/charts/k6-operator/templates/k6-probe-configmap.yaml @@ -39,8 +39,18 @@ data: value: http://graph-proxy.graph-proxy.svc.cluster.local:80/graphql - name: GRAPH_WS_URL value: ws://graph-proxy.graph-proxy.svc.cluster.local:80/graphql/ws - - name: OTEL_ENDPOINT - value: https://otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4318 + - name: K6_OTEL_SERVICE_NAME + value: workflows-k6-synthetic-probe + - name: K6_OTEL_METRIC_PREFIX + value: k6_ + - name: K6_OTEL_EXPORTER_PROTOCOL + value: grpc + - name: K6_OTEL_GRPC_EXPORTER_ENDPOINT + value: otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4317 + - name: K6_OTEL_GRPC_EXPORTER_INSECURE + value: "true" + - name: K6_OTEL_EXPORT_INTERVAL + value: 5s resources: limits: cpu: 1000m diff --git a/charts/k6-operator/templates/k6-testrun.yaml b/charts/k6-operator/templates/k6-testrun.yaml index bb35c030c..d57262da9 100644 --- a/charts/k6-operator/templates/k6-testrun.yaml +++ b/charts/k6-operator/templates/k6-testrun.yaml @@ -7,6 +7,7 @@ metadata: namespace: {{ .Release.Namespace}} spec: parallelism: 4 + arguments: "--out opentelemetry --tag probe=ping-graph --tag synthetic=true" script: configMap: name: k6-configmap @@ -29,10 +30,22 @@ spec: {{- else if eq .Values.cluster "argus"}} value: https://identity.diamond.ac.uk/realms/dls/protocol/openid-connect/token {{- end}} - - name: OTEL_ENDPOINT - value: https://otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4318 - name: GRAPH_URL value: http://graph-proxy.graph-proxy.svc.cluster.local:80/graphql + - name: K6_OTEL_SERVICE_NAME + value: k6 + - name: K6_OTEL_METRIC_PREFIX + value: k6_ + - name: K6_OTEL_FLUSH_INTERVAL + value: 1s + - name: K6_OTEL_EXPORTER_PROTOCOL + value: grpc + - name: K6_OTEL_GRPC_EXPORTER_ENDPOINT + value: otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4317 + - name: K6_OTEL_GRPC_EXPORTER_INSECURE + value: "true" + - name: K6_OTEL_EXPORT_INTERVAL + value: 5s resources: limits: cpu: 1000m diff --git a/charts/k6-operator/templates/k6-ws-subscription-testrun.yaml b/charts/k6-operator/templates/k6-ws-subscription-testrun.yaml index 9c0e31db7..06e0a48e4 100644 --- a/charts/k6-operator/templates/k6-ws-subscription-testrun.yaml +++ b/charts/k6-operator/templates/k6-ws-subscription-testrun.yaml @@ -7,6 +7,7 @@ metadata: namespace: {{ .Release.Namespace}} spec: parallelism: 1 + arguments: "--out opentelemetry --tag probe=ws-subscription --tag synthetic=true" script: configMap: name: k6-configmap @@ -33,8 +34,20 @@ spec: value: http://graph-proxy.graph-proxy.svc.cluster.local:80/graphql - name: GRAPH_WS_URL value: ws://graph-proxy.graph-proxy.svc.cluster.local:80/graphql/ws - - name: OTEL_ENDPOINT - value: https://otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4318 + - name: K6_OTEL_SERVICE_NAME + value: k6 + - name: K6_OTEL_METRIC_PREFIX + value: k6_ + - name: K6_OTEL_FLUSH_INTERVAL + value: 1s + - name: K6_OTEL_EXPORTER_PROTOCOL + value: grpc + - name: K6_OTEL_GRPC_EXPORTER_ENDPOINT + value: otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4317 + - name: K6_OTEL_GRPC_EXPORTER_INSECURE + value: "true" + - name: K6_OTEL_EXPORT_INTERVAL + value: 5s resources: limits: cpu: 1000m diff --git a/charts/k6-operator/tests/spam-workflows.ts b/charts/k6-operator/tests/spam-workflows.ts new file mode 100644 index 000000000..42bf3a3e9 --- /dev/null +++ b/charts/k6-operator/tests/spam-workflows.ts @@ -0,0 +1,53 @@ +import http from 'k6/http'; +import { Options } from 'k6/options'; + +export { setup } from './common.ts'; + +const graphUrl = __ENV.GRAPH_URL + +interface VisitInput { + proposalCode: string; + proposalNumber: number; + number: number; +} + + +const submitMutation = `mutation K6WsSubmit($templateName: String!, $visit: VisitInput!, $parameters: JSON!) { submitWorkflowTemplate(name: $templateName, visit: $visit, parameters: $parameters) { name } }`; + +export const options: Options = { + vus: 1, + iterations: 10 +} + +export default function(data: { token: string }): void { + const visit: VisitInput = { + proposalCode: "ks", + proposalNumber: 10000, + number: 1 + } + const templateName = "example-template" + + console.log(`submitting workflow template=${templateName} visit=${JSON.stringify(visit)} graphUrl=${graphUrl}`); + http.post( + graphUrl, + JSON.stringify({ + query: submitMutation, + variables: { + templateName, + visit, + }, + }), + { + headers: { + Authorization: `Bearer ${data.token}`, + }, + tags: { + endpoint: "graphql", + operation: "submit_workflow_template", + scenario: "graphql_ws_subscription", + }, + }, + ); + + +} diff --git a/charts/k6-operator/tests/ws-subscription.ts b/charts/k6-operator/tests/ws-subscription.ts index 0d36a1883..ea6b0392f 100644 --- a/charts/k6-operator/tests/ws-subscription.ts +++ b/charts/k6-operator/tests/ws-subscription.ts @@ -3,11 +3,14 @@ import { check, fail } from 'k6'; import { Options } from 'k6/options'; import * as ws from 'k6/ws'; export { setup } from './common.ts'; +import { Rate } from 'k6/metrics'; const graphUrl = __ENV.GRAPH_URL; const graphWsUrl = __ENV.GRAPH_WS_URL; const timeoutSeconds = 1800; +const probeSuccess = new Rate('synthetic_probe_success') + interface VisitInput { proposalCode: string; proposalNumber: number; @@ -147,6 +150,7 @@ export default function(data: { token: string }): void { nextCount += 1; terminalStatus = frame.payload?.data?.workflow?.status?.__typename || null; console.log(`websocket next count=${nextCount} terminalStatus=${terminalStatus}`); + probeSuccess.add(terminalStatus === 'WorkflowSucceededStatus', {probe: ws-subscription}); if ( terminalStatus === 'WorkflowSucceededStatus' || terminalStatus === 'WorkflowFailedStatus' || diff --git a/charts/workflows-cluster/Chart.yaml b/charts/workflows-cluster/Chart.yaml index dfea9fffe..a1ef3768d 100644 --- a/charts/workflows-cluster/Chart.yaml +++ b/charts/workflows-cluster/Chart.yaml @@ -3,7 +3,7 @@ name: workflows-cluster description: A virtual cluster for Data Analysis workflows type: application -version: 0.13.4 +version: 0.13.5 dependencies: - name: common version: 2.23.0