Skip to content

Commit 1bbb75a

Browse files
committed
Add scheme support for otel endpoint.
1 parent 525570f commit 1bbb75a

File tree

1 file changed

+42
-10
lines changed

1 file changed

+42
-10
lines changed

tests/test_otel.py

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
ssl_certificate_key localhost.key;
2828
2929
otel_exporter {
30-
endpoint 127.0.0.1:{{ port }};
30+
endpoint {{ scheme }}127.0.0.1:{{ port }};
3131
interval 1s;
3232
batch_size 10;
3333
batch_count 2;
@@ -218,14 +218,46 @@ def response(logger, http_ver, otel_mode, url, headers):
218218
@pytest.mark.parametrize(
219219
("nginx_config", "http_ver", "otel_mode"),
220220
[
221-
({"port": 4317, "name": "test_http0", "mode": "ssl"}, 0, 0),
222-
({"port": 8317, "name": "test_http0", "mode": "ssl"}, 0, 1),
223-
({"port": 4317, "name": "test_http1", "mode": "ssl"}, 1, 0),
224-
({"port": 8317, "name": "test_http1", "mode": "ssl"}, 1, 1),
225-
({"port": 4317, "name": "test_http2", "mode": "ssl http2"}, 2, 0),
226-
({"port": 8317, "name": "test_http2", "mode": "ssl http2"}, 2, 1),
227-
({"port": 4317, "name": "test_http3", "mode": "quic"}, 3, 0),
228-
({"port": 8317, "name": "test_http3", "mode": "quic"}, 3, 1),
221+
(
222+
{"port": 4317, "scheme": "", "name": "http0", "mode": "ssl"},
223+
0,
224+
0,
225+
),
226+
(
227+
{"port": 8317, "scheme": "", "name": "http0", "mode": "ssl"},
228+
0,
229+
1,
230+
),
231+
(
232+
{"port": 4317, "scheme": "http://", "name": "http1", "mode": "ssl"},
233+
1,
234+
0,
235+
),
236+
(
237+
{"port": 8317, "scheme": "http://", "name": "http1", "mode": "ssl"},
238+
1,
239+
1,
240+
),
241+
(
242+
{"port": 4317, "scheme": "", "name": "http2", "mode": "ssl http2"},
243+
2,
244+
0,
245+
),
246+
(
247+
{"port": 8317, "scheme": "", "name": "http2", "mode": "ssl http2"},
248+
2,
249+
1,
250+
),
251+
(
252+
{"port": 4317, "scheme": "", "name": "http3", "mode": "quic"},
253+
3,
254+
0,
255+
),
256+
(
257+
{"port": 8317, "scheme": "", "name": "http3", "mode": "quic"},
258+
3,
259+
1,
260+
),
229261
],
230262
indirect=["nginx_config"],
231263
ids=["https 0.9-to mock", "https 0.9-to otelcol"]
@@ -283,7 +315,7 @@ def test_batch_size(self, http_ver, batches, idx, value, otel_mode):
283315
@pytest.mark.parametrize("idx", [0, 1, 2], ids=["batch"] * 3)
284316
@pytest.mark.parametrize(
285317
("name", "value"),
286-
[("service.name", "test_http"), ("my.name", "my test_http")],
318+
[("service.name", "http"), ("my.name", "my http")],
287319
ids=["service.name", "my.name"],
288320
)
289321
def test_resouce_attr(self, http_ver, batches, idx, otel_mode, name, value):

0 commit comments

Comments
 (0)