From 44242c3e25540624978ddcc1dd700ad8f7ce0de1 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Fri, 28 Nov 2025 16:23:39 +0100 Subject: [PATCH 1/4] add more mise commands --- mise.toml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mise.toml b/mise.toml index ee8be3b5..9f14756f 100644 --- a/mise.toml +++ b/mise.toml @@ -35,8 +35,25 @@ description = "Run locally built LGTM image" run = './run-lgtm.sh latest true' [tasks.example] +alias = "example-java" run = "./run-example.sh" +[tasks.example-nodejs] +dir = "examples/nodejs" +run = "./run.sh" + +[tasks.example-python] +dir = "examples/python" +run = "./run.sh" + +[tasks.example-go] +dir = "examples/go" +run = "./run.sh" + +[tasks.example-dotnet] +dir = "examples/dotnet" +run = "./run.sh" + [tasks.generate-traffic] run = "./generate-traffic.sh" From 676886d2bde503442d4b51cd5bda043a7b4bf664 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Fri, 28 Nov 2025 16:38:09 +0100 Subject: [PATCH 2/4] cleanup --- .github/workflows/acceptance-tests.yml | 2 +- .mise/tasks/acceptance-tests.sh | 12 ++++++++++++ {scripts => .mise/tasks}/super-linter.sh | 1 + mise.toml | 4 ---- scripts/lint.sh | 15 --------------- scripts/run-acceptance-tests.sh | 10 ---------- 6 files changed, 14 insertions(+), 30 deletions(-) create mode 100755 .mise/tasks/acceptance-tests.sh rename {scripts => .mise/tasks}/super-linter.sh (94%) delete mode 100755 scripts/lint.sh delete mode 100755 scripts/run-acceptance-tests.sh diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index ae1c5e3b..ba345db4 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -19,4 +19,4 @@ jobs: version: v2025.11.10 sha256: 6231d2fb730d60fcf2806019d19ab09f0a4051b3b486bae91f77b0c68583b5c7 - name: Run acceptance tests - run: ./scripts/run-acceptance-tests.sh ${{ github.event.pull_request.head.sha }} + run: mise run acceptance-tests ${{ github.event.pull_request.head.sha }} diff --git a/.mise/tasks/acceptance-tests.sh b/.mise/tasks/acceptance-tests.sh new file mode 100755 index 00000000..9acd7682 --- /dev/null +++ b/.mise/tasks/acceptance-tests.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +#MISE description="Run OATs acceptance tests against LGTM builds" +#USAGE arg "" help="The version tag for docker" default="" + +set -euo pipefail + +version=${usage_version:-$(date +%Y%m%d%H%M%S)} + +echo "using version $version" + +mise run build-lgtm "$version" +oats -timeout 5m -lgtm-version "$version" examples/ diff --git a/scripts/super-linter.sh b/.mise/tasks/super-linter.sh similarity index 94% rename from scripts/super-linter.sh rename to .mise/tasks/super-linter.sh index e109694a..38a7f792 100755 --- a/scripts/super-linter.sh +++ b/.mise/tasks/super-linter.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +#MISE description="Run Super-Linter on the repository" set -euo pipefail diff --git a/mise.toml b/mise.toml index 9f14756f..cfedc345 100644 --- a/mise.toml +++ b/mise.toml @@ -23,10 +23,6 @@ depends = ["lint", "lint-links"] description = "All lints not covered by super linter" depends = ["lint-links"] -[tasks.test] -description = "Run integration tests" -run = './scripts/run-acceptance-tests.sh {{arg(name="tag", default="latest")}}' - [tasks.lgtm] run = './run-lgtm.sh {{arg(name="tag", default="latest")}}' diff --git a/scripts/lint.sh b/scripts/lint.sh deleted file mode 100755 index f44714e8..00000000 --- a/scripts/lint.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -dir="$(dirname "$0")" - -pushd "$dir/.." - -echo "Check links" -lychee --cache --include-fragments . - -popd - -echo "Run Super-Linter" -"$dir"/super-linter.sh diff --git a/scripts/run-acceptance-tests.sh b/scripts/run-acceptance-tests.sh deleted file mode 100755 index 7a86bc4e..00000000 --- a/scripts/run-acceptance-tests.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -version=${1:-$(date +%Y%m%d%H%M%S)} - -echo "using version $version" - -./build-lgtm.sh "$version" -oats -timeout 5m -lgtm-version "$version" examples/ From 04ceb294389438eab92ccf2f52c8488f69f88090 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 1 Dec 2025 19:40:49 +0100 Subject: [PATCH 3/4] update oats --- examples/dotnet/oats.yaml | 11 +++++------ examples/ebpf-profiler/oats.yaml | 3 ++- examples/go/oats.yaml | 8 ++++---- examples/nodejs/oats.yaml | 11 +++++------ examples/python/oats.yaml | 11 +++++------ mise.toml | 2 +- 6 files changed, 22 insertions(+), 24 deletions(-) diff --git a/examples/dotnet/oats.yaml b/examples/dotnet/oats.yaml index 0f1293c5..effd99f8 100644 --- a/examples/dotnet/oats.yaml +++ b/examples/dotnet/oats.yaml @@ -1,5 +1,6 @@ # OATS is an acceptance testing framework for OpenTelemetry # https://github.com/grafana/oats/tree/main/yaml +oats-schema-version: 2 docker-compose: files: - ./docker-compose.oats.yml @@ -8,15 +9,13 @@ input: expected: traces: - traceql: '{ span.http.route = "/rolldice/{player?}" }' - spans: - - name: "GET /rolldice/{player?}" # should be "GET /rolldice" - attributes: - otel.library.name: Microsoft.AspNetCore + equals: "GET /rolldice/{player?}" # should be "GET /rolldice" + attributes: + otel.library.name: Microsoft.AspNetCore # https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientactive_requests metrics: - promql: 'http_server_active_requests{http_request_method="GET"}' value: ">= 0" logs: - logql: '{service_name="rolldice"} |~ `Anonymous player is rolling the dice.*`' - contains: - - "Anonymous player is rolling the dice" + regexp: "Anonymous player is rolling the dice.*" diff --git a/examples/ebpf-profiler/oats.yaml b/examples/ebpf-profiler/oats.yaml index 1e2ade84..21e3df32 100644 --- a/examples/ebpf-profiler/oats.yaml +++ b/examples/ebpf-profiler/oats.yaml @@ -1,5 +1,6 @@ # OATS is an acceptance testing framework for OpenTelemetry # https://github.com/grafana/oats/tree/main/yaml +oats-schema-version: 2 docker-compose: files: - ./docker-compose.oats.yml @@ -10,7 +11,7 @@ expected: # go - query: 'process_cpu:cpu:nanoseconds:cpu:nanoseconds{process_executable_name=~"rolldice"}' flamebearers: - contains: "main.rolldice" + equals: "main.rolldice" # python and java are flaky # - query: 'process_cpu:cpu:nanoseconds:cpu:nanoseconds{process_executable_name=~"python.*"}' # flamebearers: diff --git a/examples/go/oats.yaml b/examples/go/oats.yaml index d931a7b3..e9c15b9f 100644 --- a/examples/go/oats.yaml +++ b/examples/go/oats.yaml @@ -1,6 +1,7 @@ --- # OATS is an acceptance testing framework for OpenTelemetry # https://github.com/grafana/oats/tree/main/yaml +oats-schema-version: 2 docker-compose: files: - ./docker-compose.oats.yml @@ -9,10 +10,9 @@ input: expected: traces: - traceql: '{ span.http.route = "/rolldice" }' - spans: - - name: "/" # should be "GET /rolldice" - attributes: - otel.library.name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp + equals: "/" # should be "GET /rolldice" + attributes: + otel.library.name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp metrics: - promql: "go_goroutine_count{}" value: "> 0" diff --git a/examples/nodejs/oats.yaml b/examples/nodejs/oats.yaml index 67ed8859..57728ae7 100644 --- a/examples/nodejs/oats.yaml +++ b/examples/nodejs/oats.yaml @@ -1,5 +1,6 @@ # OATS is an acceptance testing framework for OpenTelemetry # https://github.com/grafana/oats/tree/main/yaml +oats-schema-version: 2 docker-compose: files: - ./docker-compose.oats.yml @@ -8,14 +9,12 @@ input: expected: traces: - traceql: '{ span.http.route = "/rolldice" }' - spans: - - name: 'GET /rolldice' - attributes: - otel.library.name: '@opentelemetry/instrumentation-http' + equals: 'GET /rolldice' + attributes: + otel.library.name: '@opentelemetry/instrumentation-http' metrics: - promql: 'dice_lib_rolls_counter_total{service_name="dice-server"}' value: '>= 0' logs: - logql: '{service_name="dice-server"} |~ `Received request to roll dice`' - contains: - - 'Received request to roll dice' + equals: 'Received request to roll dice' diff --git a/examples/python/oats.yaml b/examples/python/oats.yaml index dba744de..8c75dc88 100644 --- a/examples/python/oats.yaml +++ b/examples/python/oats.yaml @@ -1,5 +1,6 @@ # OATS is an acceptance testing framework for OpenTelemetry # https://github.com/grafana/oats/tree/main/yaml +oats-schema-version: 2 docker-compose: files: - ./docker-compose.oats.yml @@ -14,14 +15,12 @@ expected: - "The OpenTelemetry collector and the Grafana LGTM stack are up and running. (created /tmp/ready)" traces: - traceql: '{ span.http.route = "/rolldice" }' - spans: - - name: "GET /rolldice" - attributes: - otel.library.name: opentelemetry.instrumentation.flask + equals: "GET /rolldice" + attributes: + otel.library.name: opentelemetry.instrumentation.flask metrics: - promql: 'http_server_active_requests{http_method="GET"}' value: ">= 0" logs: - logql: '{service_name="rolldice"} |~ `Anonymous player is rolling the dice.*`' - contains: - - "Anonymous player is rolling the dice" + regexp: "Anonymous player is rolling the dice" diff --git a/mise.toml b/mise.toml index cfedc345..e2c9eef1 100644 --- a/mise.toml +++ b/mise.toml @@ -1,7 +1,7 @@ # pin all versions to avoid GitHub rate litit [tools] go = "1.25.4" -"go:github.com/grafana/oats" = "0.4.1" +"go:github.com/grafana/oats" = "0.6.0" java = "temurin-25.0.1+8.0.LTS" lychee = "0.20.1" markdownlint-cli2 = "0.19.1" From d5c57e0ccc447b7a443d9e679222bd051601d711 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Mon, 1 Dec 2025 19:57:44 +0100 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Gregor Zeitlinger --- examples/dotnet/oats.yaml | 2 +- mise.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dotnet/oats.yaml b/examples/dotnet/oats.yaml index effd99f8..34be5cdc 100644 --- a/examples/dotnet/oats.yaml +++ b/examples/dotnet/oats.yaml @@ -18,4 +18,4 @@ expected: value: ">= 0" logs: - logql: '{service_name="rolldice"} |~ `Anonymous player is rolling the dice.*`' - regexp: "Anonymous player is rolling the dice.*" + regexp: "Anonymous player is rolling the dice" diff --git a/mise.toml b/mise.toml index e2c9eef1..574eb038 100644 --- a/mise.toml +++ b/mise.toml @@ -1,4 +1,4 @@ -# pin all versions to avoid GitHub rate litit +# pin all versions to avoid GitHub rate limit [tools] go = "1.25.4" "go:github.com/grafana/oats" = "0.6.0"