Skip to content

Commit 29cd54a

Browse files
committed
Optimize nginx configuration.
1 parent be2d948 commit 29cd54a

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

tests/test_otel.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
listen 127.0.0.1:8080;
4747
server_name localhost;
4848
49-
location /trace-on {
49+
location / {
5050
otel_trace_context extract;
5151
otel_span_name default_location;
5252
otel_span_attr http.request.completion
@@ -58,7 +58,6 @@
5858
}
5959
6060
location /context-ignore {
61-
otel_trace_context ignore;
6261
otel_span_name context_ignore;
6362
proxy_pass http://127.0.0.1:8080/204;
6463
}
@@ -239,14 +238,14 @@ def teardown_class(cls):
239238
@pytest.mark.parametrize(
240239
("url", "text"),
241240
[
242-
("https://127.0.0.1:8443/trace-on", "TRACE-ON"),
241+
("https://127.0.0.1:8443/", "TRACE-ON"),
243242
("https://127.0.0.1:8443/context-ignore", ""),
244243
("https://127.0.0.1:8443/context-extract", ""),
245244
("https://127.0.0.1:8443/context-inject", ""),
246245
("https://127.0.0.1:8443/context-propagate", ""),
247246
("https://127.0.0.1:8443/204", ""),
248247
]
249-
+ [("https://127.0.0.1:8443/trace-on", "TRACE-ON")] * 10,
248+
+ [("https://127.0.0.1:8443/", "TRACE-ON")] * 10,
250249
ids=[
251250
"trace-on",
252251
"context-ignore",
@@ -304,22 +303,22 @@ def test_span_name(self, http_ver, span, value, idx, otel_mode):
304303
(
305304
"http.target",
306305
"string_value",
307-
["/trace-on"] * 2
306+
["/"] * 2
308307
+ ["/context-ignore"] * 2
309308
+ ["/context-extract"] * 2
310309
+ ["/context-inject"] * 2
311310
+ ["/context-propagate"] * 2
312-
+ ["/trace-on"] * 20,
311+
+ ["/"] * 20,
313312
),
314313
(
315314
"http.route",
316315
"string_value",
317-
["/trace-on"] * 2
316+
["/"] * 2
318317
+ ["/context-ignore"] * 2
319318
+ ["/context-extract"] * 2
320319
+ ["/context-inject"] * 2
321320
+ ["/context-propagate"] * 2
322-
+ ["/trace-on"] * 20,
321+
+ ["/"] * 20,
323322
),
324323
("http.scheme", "string_value", "https"),
325324
("http.flavor", "string_value", [None, "1.1", "2.0", "3.0"]),
@@ -383,12 +382,7 @@ def test_metrics(self, http_ver, span, idx, name, atype, value, otel_mode):
383382
(
384383
"http.request",
385384
"string_value",
386-
[
387-
"GET /trace-on",
388-
"GET /trace-on HTTP/1.1",
389-
"GET /trace-on HTTP/2.0",
390-
"GET /trace-on HTTP/3.0",
391-
],
385+
["GET /", "GET / HTTP/1.1", "GET / HTTP/2.0", "GET / HTTP/3.0"],
392386
),
393387
],
394388
ids=[

0 commit comments

Comments
 (0)