Skip to content

Commit 9fbc959

Browse files
bugerclaude
andcommitted
fix: update OTel tracing test scenarios for Go 1.25 attribute names
Go 1.25 + otelhttp v0.60.0 uses new OpenTelemetry semantic convention attribute names (e.g., http.response.body.size instead of http.wrote_bytes, http.response.status_code instead of http.status_code, http.request.method instead of http.method, url.full instead of http.url, url.scheme instead of http.scheme, user_agent.original instead of http.user_agent, server.address instead of net.peer.name). Backport scenario updates from master. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c443ca8 commit 9fbc959

16 files changed

Lines changed: 58 additions & 58 deletions

ci/tests/tracing/scenarios/tyk_body_size_200.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
- key: Content-Type
1313
value: application/json
1414
specs:
15-
- selector: span[tracetest.span.type="http" name="GET /test/" http.method="GET"]
15+
- selector: span[tracetest.span.type="http" name="GET /test/" http.request.method="GET"]
1616
name: Checking request and response body sizes
1717
assertions:
1818
- attr:http.request.body.size = 15 # {"foo": "bar"} = 15 bytes

ci/tests/tracing/scenarios/tyk_grpcapi_200.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ spec:
3838
request: "{\n \"name\": \"tom\"\n}"
3939
auth: {}
4040
specs:
41-
- selector: span[tracetest.span.type="http" name="POST /helloworld.Greeter/SayHello" http.method="POST"]
41+
- selector: span[tracetest.span.type="http" name="POST /helloworld.Greeter/SayHello" http.request.method="POST"]
4242
name: Check http span attributes
4343
assertions:
44-
- attr:http.status_code = 200
45-
- attr:http.scheme = "http"
46-
- attr:http.method = "POST"
44+
- attr:http.response.status_code = 200
45+
- attr:url.scheme = "http"
46+
- attr:http.request.method = "POST"
4747
- attr:tracetest.span.type = "http"
4848
- selector: |-
4949
span[name = "POST /helloworld.Greeter/SayHello"]
5050
span[tracetest.span.type="general"]
5151
name: Check the middlewares executed
5252
assertions:
5353
- attr:tracetest.selected_spans.count = 4
54-
- selector: span[tracetest.span.type="http" name="HTTP POST" http.method="POST"]
54+
- selector: span[tracetest.span.type="http" name="HTTP POST" http.request.method="POST"]
5555
name: Checking the h2c proxying
5656
assertions:
57-
- attr:http.method = "POST"
58-
- attr:http.url = "http://grpcapi:50051/helloworld.Greeter/SayHello"
57+
- attr:http.request.method = "POST"
58+
- attr:url.full = "http://grpcapi:50051/helloworld.Greeter/SayHello"

ci/tests/tracing/scenarios/tyk_jwt_200.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ spec:
1414
value: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0ZXN0LXVzZXItYWxpYXMiLCJpYXQiOjE3MDAwMDAwMDAsImV4cCI6MzI1MDM2ODAwMDB9.E8aStwqiSQPAvQN80UboJBEWsSazDU_gEMqHNqeXPbc
1515
specs:
1616
- name: Test main span attributes
17-
selector: span[tracetest.span.type="http" name="GET /test-jwt/ip" http.method="GET"]
17+
selector: span[tracetest.span.type="http" name="GET /test-jwt/ip" http.request.method="GET"]
1818
assertions:
19-
- attr:http.method = "GET"
20-
- attr:http.status_code = 200
19+
- attr:http.request.method = "GET"
20+
- attr:http.response.status_code = 200
2121
- attr:tyk.api.id = "jwt-test-api"
2222
- attr:tyk.api.name = "JWTTestAPI"
2323
- attr:tyk.api.orgid = "default"

ci/tests/tracing/scenarios/tyk_multiauth_jwt_200.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ spec:
1414
value: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0ZXN0LXVzZXItYWxpYXMiLCJpYXQiOjE3MDAwMDAwMDAsImV4cCI6MzI1MDM2ODAwMDB9.E8aStwqiSQPAvQN80UboJBEWsSazDU_gEMqHNqeXPbc
1515
specs:
1616
- name: Test main span attributes
17-
selector: span[tracetest.span.type="http" name="GET /test-multiauth/ip" http.method="GET"]
17+
selector: span[tracetest.span.type="http" name="GET /test-multiauth/ip" http.request.method="GET"]
1818
assertions:
19-
- attr:http.method = "GET"
20-
- attr:http.status_code = 200
19+
- attr:http.request.method = "GET"
20+
- attr:http.response.status_code = 200
2121
- attr:tyk.api.id = "multiauth-test-api"
2222
- attr:tyk.api.name = "MultiAuthTestAPI"
2323
- name: Verify AuthORWrapper span has alias attribute from JWT

ci/tests/tracing/scenarios/tyk_test-graphql-detailed-tracing-disabled_200.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ spec:
1313
- key: Content-Type
1414
value: application/json
1515
specs:
16-
- selector: span[tracetest.span.type = "general" name="GraphqlEngine"] span[tracetest.span.type="http" name="HTTP POST" http.method="POST"]
16+
- selector: span[tracetest.span.type = "general" name="GraphqlEngine"] span[tracetest.span.type="http" name="HTTP POST" http.request.method="POST"]
1717
name: Upstream Request is valid
1818
assertions:
19-
- attr:http.status_code = 200
20-
- attr:http.url = "https://countries.trevorblades.com/"
21-
- attr:http.method = "POST"
19+
- attr:http.response.status_code = 200
20+
- attr:url.full = "https://countries.trevorblades.com/"
21+
- attr:http.request.method = "POST"
2222
- selector: span[tracetest.span.type="general" name="GraphqlEngine"] span[tracetest.span.type="general"]
2323
name: Make sure there is no subspan for graphql engine
2424
assertions:

ci/tests/tracing/scenarios/tyk_test-graphql-tracing-invalid_404.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ spec:
1313
- key: Content-Type
1414
value: application/json
1515
specs:
16-
- selector: span[tracetest.span.type = "general" name = "ResolvePlan"] span[tracetest.span.type="http" name="HTTP POST" http.method="POST"]
16+
- selector: span[tracetest.span.type = "general" name = "ResolvePlan"] span[tracetest.span.type="http" name="HTTP POST" http.request.method="POST"]
1717
name: Should return 404 for upstream
1818
assertions:
19-
- attr:http.status_code = 404
20-
- attr:http.url = "http://httpbin:80/status/404"
19+
- attr:http.response.status_code = 404
20+
- attr:url.full = "http://httpbin:80/status/404"
2121
- selector: span[tracetest.span.type = "general" name = "GraphqlMiddleware Validation"] span[tracetest.span.type="general" name="GraphqlEngine"]
2222
name: Make sure Graphql Engine is a child of GraphqlMiddleware Validation
2323
assertions:

ci/tests/tracing/scenarios/tyk_test-graphql-tracing_200.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ spec:
1313
- key: Content-Type
1414
value: application/json
1515
specs:
16-
- selector: span[tracetest.span.type = "general" name="ResolvePlan"] span[tracetest.span.type="http" name="HTTP POST" http.method="POST"]
16+
- selector: span[tracetest.span.type = "general" name="ResolvePlan"] span[tracetest.span.type="http" name="HTTP POST" http.request.method="POST"]
1717
name: Upstream Request is valid
1818
assertions:
19-
- attr:http.status_code = 200
20-
- attr:http.url = "https://countries.trevorblades.com/"
21-
- attr:http.method = "POST"
19+
- attr:http.response.status_code = 200
20+
- attr:url.full = "https://countries.trevorblades.com/"
21+
- attr:http.request.method = "POST"
2222
- selector: span[tracetest.span.type="general" name="GraphqlEngine"] span[tracetest.span.type="general"]
2323
name: Make sure there are 3 subspans for graphql engine
2424
assertions:

ci/tests/tracing/scenarios/tyk_test_200.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ spec:
1313
- key: User-Agent
1414
value: Go-http-client/1.1
1515
specs:
16-
- selector: span[tracetest.span.type="http" name="GET /test/ip" http.method="GET"]
16+
- selector: span[tracetest.span.type="http" name="GET /test/ip" http.request.method="GET"]
1717
name: Test main span attributes
1818
assertions:
19-
- attr:http.method = "GET"
20-
- attr:http.status_code = 200
21-
- attr:http.user_agent = "Go-http-client/1.1"
22-
- attr:http.wrote_bytes != 0
19+
- attr:http.request.method = "GET"
20+
- attr:http.response.status_code = 200
21+
- attr:user_agent.original = "Go-http-client/1.1"
22+
- attr:http.response.body.size != 0
2323
- attr:tracetest.span.type = "http"
2424
- attr:tyk.api.id = "3"
2525
- attr:tyk.api.name = "TestAPI"

ci/tests/tracing/scenarios/tyk_test_500.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ spec:
1313
value: application/json
1414
specs:
1515
- name: Check main span http attributes
16-
selector: span[tracetest.span.type="http" name="GET /test/status/500" http.method="GET"]
16+
selector: span[tracetest.span.type="http" name="GET /test/status/500" http.request.method="GET"]
1717
assertions:
18-
- attr:http.method = "GET"
19-
- attr:http.scheme = "http"
20-
- attr:http.status_code = 500
18+
- attr:http.request.method = "GET"
19+
- attr:url.scheme = "http"
20+
- attr:http.response.status_code = 500
2121
- attr:tyk.api.id = "3"
2222
- attr:tyk.api.name = "TestAPI"
2323
- attr:tyk.api.orgid = "default"
@@ -29,8 +29,8 @@ spec:
2929
assertions:
3030
- attr:tracetest.selected_spans.count = 4
3131
- name: Check the proxying request span
32-
selector: span[tracetest.span.type="http" name="HTTP GET" http.method="GET"]
32+
selector: span[tracetest.span.type="http" name="HTTP GET" http.request.method="GET"]
3333
assertions:
34-
- attr:http.status_code = 500
35-
- attr:http.url = "http://httpbin:80/status/500"
34+
- attr:http.response.status_code = 500
35+
- attr:url.full = "http://httpbin:80/status/500"
3636
- attr:tracetest.span.parent_id != ""

ci/tests/tracing/scenarios/tyk_testauth_401.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
value: application/json
1313
specs:
1414
- name: Check if the main span executed 3 middleware
15-
selector: "span[tracetest.span.type=\"http\" name=\"GET /test-auth/ip\" http.method=\"GET\"]
15+
selector: "span[tracetest.span.type=\"http\" name=\"GET /test-auth/ip\" http.request.method=\"GET\"]
1616
\nspan[tracetest.span.type = \"general\"]"
1717
assertions:
1818
- attr:tracetest.selected_spans.count = 3
@@ -22,10 +22,10 @@ spec:
2222
assertions:
2323
- attr:tracetest.selected_spans.count = 0
2424
- name: Check if the main attributes
25-
selector: span[tracetest.span.type="http" name="GET /test-auth/ip" http.method="GET"]
25+
selector: span[tracetest.span.type="http" name="GET /test-auth/ip" http.request.method="GET"]
2626
assertions:
27-
- attr:http.method = "GET"
28-
- attr:http.status_code = 401
27+
- attr:http.request.method = "GET"
28+
- attr:http.response.status_code = 401
2929
- attr:tyk.api.id = "1"
3030
- attr:tyk.api.name = "AuthAPI"
3131
- attr:tyk.api.orgid = "default"

0 commit comments

Comments
 (0)