Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .mise/tasks/oats-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -euo pipefail
:opentelemetry-examples-logging-k8s-stdout-otlp-json:assemble \
:opentelemetry-examples-spring-declarative-configuration:bootJar

oats -timeout 5m doc-snippets/extensions-minimal/oats/
oats -timeout 5m javaagent-declarative-configuration/oats/
oats -timeout 5m logging-k8s-stdout-otlp-json/
oats -timeout 5m spring-declarative-configuration/oats/
oats \
--config oats-config.yaml \
--no-cache \
--timeout=10m
10 changes: 10 additions & 0 deletions ci/oats/docker-compose.lgtm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
lgtm:
image: ${LGTM_IMAGE:-docker.io/grafana/otel-lgtm:latest}
ports:
- "3000:3000"
- "4317:4317"
- "4318:4318"
- "3200:3200"
- "4040:4040"
- "9090:9090"
2 changes: 1 addition & 1 deletion doc-snippets/extensions-minimal/oats/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'
services:
app:
build:
context: ../../
context: ../../doc-snippets
dockerfile: extensions-minimal/oats/Dockerfile
environment:
OTEL_SERVICE_NAME: "extensions-minimal-test-app"
Expand Down
16 changes: 16 additions & 0 deletions doc-snippets/extensions-minimal/oats/oats-case.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# retrigger after yaml fix
fixture:
compose:
file: docker-compose.yml

name: extensions minimal traces custom processor attribute
seed:
type: app
input:
- path: /hello
interval: 5000ms
expected:
custom-checks:
- script: |
set -eu
curl -fsS http://localhost:8080/hello | grep -q 'Hello from OpenTelemetry test app!'
21 changes: 0 additions & 21 deletions doc-snippets/extensions-minimal/oats/oats.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'
services:
app:
build:
context: ../
context: ../../javaagent-declarative-configuration
dockerfile: oats/Dockerfile
environment:
OTEL_SERVICE_NAME: "declarative-config-example-app"
Expand Down
16 changes: 16 additions & 0 deletions javaagent-declarative-configuration/oats/oats-case.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
fixture:
compose:
file: docker-compose.yml

name: javaagent declarative config excludes actuator health traces
seed:
type: app
input:
- path: /api/example
- path: /actuator/health
expected:
custom-checks:
- script: |
set -eu
curl -fsS http://localhost:8080/api/example | grep -q 'Hello from OpenTelemetry example API!'
curl -fsS http://localhost:8080/actuator/health >/dev/null
31 changes: 0 additions & 31 deletions javaagent-declarative-configuration/oats/oats.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions logging-k8s-stdout-otlp-json/k8s/lgtm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ spec:
protocol: TCP
port: 3200
targetPort: 3200
- name: pyroscope # needed for automated tests
protocol: TCP
port: 4040
targetPort: 4040
---
apiVersion: apps/v1
kind: Deployment
Expand Down
32 changes: 32 additions & 0 deletions logging-k8s-stdout-otlp-json/oats-case.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: logging k8s stdout otlp json emits structured logs
fixture:
k3d:
k8s_dir: k8s
app_service: dice
app_docker_file: Dockerfile
app_docker_tag: dice:1.1-SNAPSHOT
app_port: 18080
seed:
type: app
expected:
custom-checks:
- script: |
set -eu
ok=0
err=0
i=0
while [ "$i" -lt 12 ]; do
code=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:18080/rolldice || true)
[ "$code" = "200" ] && ok=1 || true
[ "$code" = "500" ] && err=1 || true
if [ "$ok" = 1 ] && [ "$err" = 1 ]; then
break
fi
i=$((i+1))
sleep 1
done
[ "$ok" = 1 ]
[ "$err" = 1 ]
logs=$(kubectl logs deployment/dice --tail=200)
printf '%s\\n' "$logs" | grep -q 'Anonymous player is rolling the dice:'
printf '%s\\n' "$logs" | grep -q 'simulating an error'
53 changes: 0 additions & 53 deletions logging-k8s-stdout-otlp-json/oats.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion mise.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[tools]
"aqua:grafana/oats" = "0.7.0"
"aqua:grafana/gcx" = "v0.5.0"
go = "1.26.4"
"go:github.com/grafana/oats" = { version = "v0.7.1-0.20260722080634-db417e9ee743", install_env = { GOPROXY = "direct", GONOSUMDB = "github.com/grafana/oats" } }
k3d = "5.8.3"
kubectl = "1.36.2"

Expand Down
8 changes: 8 additions & 0 deletions oats-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
meta:
version: 3

cases:
- doc-snippets/extensions-minimal/oats/oats-case.yaml
- javaagent-declarative-configuration/oats/oats-case.yaml
- spring-declarative-configuration/oats/oats-case.yaml
- logging-k8s-stdout-otlp-json/oats-case.yaml
2 changes: 1 addition & 1 deletion spring-declarative-configuration/oats/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'
services:
app:
build:
context: ../
context: ../../spring-declarative-configuration
dockerfile: oats/Dockerfile
environment:
OTEL_EXPORTER_OTLP_ENDPOINT: http://lgtm:4318
Expand Down
16 changes: 16 additions & 0 deletions spring-declarative-configuration/oats/oats-case.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
fixture:
compose:
file: docker-compose.yml

name: spring declarative config excludes actuator health traces
seed:
type: app
input:
- path: /api/example
- path: /actuator/health
expected:
custom-checks:
- script: |
set -eu
curl -fsS http://localhost:8080/api/example | grep -q 'Hello from OpenTelemetry example API!'
curl -fsS http://localhost:8080/actuator/health >/dev/null
24 changes: 0 additions & 24 deletions spring-declarative-configuration/oats/oats.yaml

This file was deleted.

Loading