Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
40cead9
Fix OATS workflow
martincostello May 9, 2025
530104c
Run go mod tidy
martincostello May 9, 2025
c1a64d2
Move go mod tidy
martincostello May 9, 2025
e302522
Run go mod tidy twice
martincostello May 9, 2025
878b1dc
Remove extra tidy
martincostello May 9, 2025
2d2c038
Refactor workflow
martincostello May 19, 2025
68ecfcc
Use oats from fix PR
martincostello Jun 2, 2025
ad4a001
Fix compose warnings
martincostello Jun 2, 2025
705d6cd
Fix dockerfile path
martincostello Jun 2, 2025
7f144e0
Fix port mappings
martincostello Jun 2, 2025
e777ecb
Update run-oats-tests.sh
martincostello Jun 2, 2025
33a5ae8
Add port mapping
martincostello Jun 2, 2025
1c21abb
Add PowerShell file to run OATS
martincostello Jun 2, 2025
8633dcd
Set executable bit
martincostello Jun 2, 2025
5800601
Remove non-existent file
martincostello Jun 2, 2025
da01f34
Avoid prereleases
martincostello Jun 2, 2025
142dc00
Fix Dockerfile
martincostello Jun 2, 2025
6cb76a8
Fix timeout
martincostello Jun 2, 2025
aed8b1a
Fix collector address
martincostello Jun 2, 2025
9684075
Fix trace queries
martincostello Jun 2, 2025
ae01dbf
Fix Dockerfile
martincostello Jun 2, 2025
48668df
Add logging
martincostello Jun 2, 2025
fafd10b
Reformat example
martincostello Jun 2, 2025
9e26c5b
Add log query
martincostello Jun 2, 2025
f313d70
Fix logging
martincostello Jun 2, 2025
85520e3
Fix metrics
martincostello Jun 2, 2025
b47eeac
Fix trace query
martincostello Jun 2, 2025
703779a
Use latest OATS
martincostello Jun 2, 2025
4b892d5
Expose MSSQL port
martincostello Jun 2, 2025
b207d58
Fix SQL queries
martincostello Jun 2, 2025
0f6af28
More trace fixes
martincostello Jun 2, 2025
3c4e206
Run for PRs
martincostello Jun 2, 2025
7dab385
Refactor example
martincostello Jun 2, 2025
e3f4e49
Fix Redis query
martincostello Jun 2, 2025
549ed02
Combine OATS cases
martincostello Jun 4, 2025
df4cc92
Resolve TODOs
martincostello Jun 4, 2025
68a89e3
Apply suggestions from code review
martincostello Jun 4, 2025
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
47 changes: 30 additions & 17 deletions .github/workflows/oats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,49 @@ name: OATS

on:
push:
branches: [ 'main*' ]
branches: [ main ]
paths-ignore:
- '**.md'
- '**/*.gitattributes'
- '**/*.gitignore'
- '**/*.md'
pull_request:
branches: [ main ]
workflow_dispatch:

permissions: {}

jobs:
acceptance-tests:
runs-on: ubuntu-latest
permissions: {}
timeout-minutes: 20

steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check out oats
uses: actions/checkout@v4

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: grafana/oats
path: oats
filter: 'tree:0'
persist-credentials: false
show-progress: false

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: '1.22'
cache-dependency-path: oats/go.sum
go-version: '1.24'

- name: Install OATS
env:
# renovate: datasource=github-releases depName=oats packageName=grafana/oats
OATS_VERSION: v0.3.2
run: go install "github.com/grafana/oats@${OATS_VERSION}"

- name: Run acceptance tests
run: ./scripts/run-oats-tests.sh
- name: upload log file
uses: actions/upload-artifact@v4
run: oats --timeout=5m ./docker/docker-compose-aspnetcore

- name: Upload log file
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: failure()
with:
name: docker-compose.log
path: oats/yaml/build/**/output.log
if-no-files-found: ignore
17 changes: 0 additions & 17 deletions docker/docker-compose-aspnetcore/attributes/oats-template.yml

This file was deleted.

This file was deleted.

10 changes: 5 additions & 5 deletions docker/docker-compose-aspnetcore/docker-compose.oats.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
version: '3.4'

services:
aspnetcore:
image: ${DOCKER_REGISTRY-}aspnetcore
build:
context: ../..
dockerfile: examples/net8.0/aspnetcore/Dockerfile
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317
- OTEL_EXPORTER_OTLP_ENDPOINT=http://lgtm:4317
ports:
- "5000:80"
- "8080:80" # for OATs
- "5000:8080"
- "8080:8080" # for OATs
depends_on:
- redis
- mssql
Expand All @@ -25,6 +23,8 @@ services:
retries: 5
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- "1433:1433"
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=Password12345%%
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: '3.4'

services:
aspnetcore:
environment:
- ASPNETCORE_ENVIRONMENT=Development
ports:
- "80"
- "8080"
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
version: '3.4'

services:
aspnetcore:
image: ${DOCKER_REGISTRY-}aspnetcore
build:
context: ../..
dockerfile: examples/net6.0/aspnetcore/Dockerfile
dockerfile: examples/net8.0/aspnetcore/Dockerfile
args:
DOTNET_PUBLISH_ARGS: "--self-contained true /p:PublishSingleFile=true"
entrypoint: ./aspnetcore
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317
- OTEL_EXPORTER_OTLP_ENDPOINT=http://lgtm:4317
ports:
- "5000:80"
- "8080:80" # for OATs
- "5000:8080"
- "8080:8080" # for OATs
depends_on:
- redis
- mssql
Expand All @@ -28,6 +26,8 @@ services:
retries: 5
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- "1433:1433"
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=Password12345%%
6 changes: 4 additions & 2 deletions docker/docker-compose-aspnetcore/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.4'

services:
aspnetcore:
image: ${DOCKER_REGISTRY-}aspnetcore
Expand All @@ -9,12 +7,16 @@ services:
depends_on:
- redis
- mssql
ports:
- "8080:8080" # for OATs
redis:
image: redis:7.2
ports:
- "6379:6379"
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
ports:
- "1433:1433"
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=Password12345%%
17 changes: 0 additions & 17 deletions docker/docker-compose-aspnetcore/http/oats-template.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions docker/docker-compose-aspnetcore/http/oats.http-get.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions docker/docker-compose-aspnetcore/http/oats.http-geterror.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions docker/docker-compose-aspnetcore/oats-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@ matrix:
generator: docker-lgtm
files:
- ./docker-compose.self-contained.oats.yml
- name: net8
docker-compose:
generator: docker-lgtm
files:
- ./docker-compose.net8.oats.yml
interval: 500ms
13 changes: 0 additions & 13 deletions docker/docker-compose-aspnetcore/oats.mssql-query.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions docker/docker-compose-aspnetcore/oats.mssql-sproc.yaml

This file was deleted.

73 changes: 73 additions & 0 deletions docker/docker-compose-aspnetcore/oats.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
include:
- ./oats-template.yml
input:
- path: /api/HttpClient/Get
- path: /api/HttpClient/GetError
- path: /api/MsSql/ServerInfo
- path: /api/MsSql/Tables
- path: /api/Redis/LeftPush
expected:
logs:
- logql: '{service_name="aspnetcore"} |~ `Application started.`'
contains:
- 'Application started'
metrics:
- promql: http_client_request_duration_seconds_count{}
value: '>= 0'
- promql: http_client_request_duration_seconds_count{http_request_method="GET", http_response_status_code="200"}
value: '>= 0'
traces:
- traceql: '{ resource.process.pid > 0 }'
spans:
- name: 'GET'
- traceql: '{ span.http.route =~ "api/HttpClient/Get" }'
spans:
- name: 'GET api/HttpClient/Get'
attributes:
http.request.method: GET
- name: 'GET api/HttpClient/Get'
attributes:
service.name: aspnetcore
service.version: 1.0.0.0
telemetry.distro.name: grafana-opentelemetry-dotnet
telemetry.distro.version: regex:.+
deployment.environment: production
process.runtime.description: regex:.NET.+
process.runtime.name: .NET
process.runtime.version: regex:.+
host.name: regex:.+
telemetry.sdk.name: opentelemetry
telemetry.sdk.language: dotnet
telemetry.sdk.version: regex:.+
- traceql: '{ span.http.route =~ "api/HttpClient/GetError" }'
spans:
- name: 'GET api/HttpClient/GetError'
attributes:
http.request.method: GET
- name: 'GET'
attributes:
error.type: '500'
http.request.method: GET
http.response.status_code: '500'
- traceql: '{ span.http.route =~ "api/MsSql/ServerInfo"}'
spans:
- name: 'master'
attributes:
db.system: mssql
db.name: master
db.statement: sp_server_info
otel.library.name: OpenTelemetry.Instrumentation.SqlClient
- traceql: '{ span.http.route =~ "api/MsSql/Tables"}'
spans:
- name: 'master'
attributes:
db.system: mssql
db.name: master
otel.library.name: OpenTelemetry.Instrumentation.SqlClient
- traceql: '{ span.http.route =~ "api/Redis/LeftPush" }'
spans:
- name: 'LPUSH'
attributes:
db.statement: LPUSH
db.system: redis
net.peer.name: redis
17 changes: 0 additions & 17 deletions docker/docker-compose-aspnetcore/redis/oats-template.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions docker/docker-compose-aspnetcore/redis/oats.redis-lpush.yaml

This file was deleted.

Loading
Loading