diff --git a/smoke-tests/docker-compose.yml b/smoke-tests/docker-compose.yml index 35b547b..cbc9ab5 100644 --- a/smoke-tests/docker-compose.yml +++ b/smoke-tests/docker-compose.yml @@ -37,5 +37,13 @@ services: <<: *env_base HONEYCOMB_API_ENDPOINT: http://collector:4318/v1/traces OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf + ports: + - "127.0.0.1:5001:5001" + + app-sdk-grpc: + <<: *app_base + environment: + <<: *env_base + OTEL_EXPORTER_OTLP_PROTOCOL: grpc ports: - "127.0.0.1:5001:5001" \ No newline at end of file diff --git a/smoke-tests/smoke-sdk-grpc.bats b/smoke-tests/smoke-sdk-grpc.bats new file mode 100644 index 0000000..248507d --- /dev/null +++ b/smoke-tests/smoke-sdk-grpc.bats @@ -0,0 +1,33 @@ +#!/usr/bin/env bats + +load test_helpers/utilities + +CONTAINER_NAME="app-sdk-grpc" +OTEL_SERVICE_NAME="aspnetcore-example" + +setup_file() { + echo "# 🚧" >&3 + docker-compose up --detach collector ${CONTAINER_NAME} + wait_for_ready_app ${CONTAINER_NAME} + curl --silent "http://localhost:5001/weatherforecast" + wait_for_traces +} + +teardown_file() { + cp collector/data.json collector/data-results/data-${CONTAINER_NAME}.json + docker-compose stop ${CONTAINER_NAME} + docker-compose restart collector + wait_for_flush +} + +# TESTS + +@test "Manual instrumentation produces span with name of span" { + result=$(span_names_for ${OTEL_SERVICE_NAME}) + assert_equal "$result" '"sleep"' +} + +@test "Manual instrumentation adds custom attribute" { + result=$(span_attributes_for ${OTEL_SERVICE_NAME} | jq "select(.key == \"delay_ms\").value.intValue") + assert_equal "$result" '"100"' +} \ No newline at end of file