otlp-test-data 0.11.2__tar.gz → 0.11.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/PKG-INFO +1 -1
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/otlp_test_data/__init__.py +68 -3
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/pyproject.toml +1 -1
- otlp_test_data-0.11.4/test/test_smoke.py +26 -0
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/uv.lock +25 -25
- otlp_test_data-0.11.2/test/test_smoke.py +0 -15
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/.github/workflows/ci.yaml +0 -0
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/.github/workflows/psr.yaml +0 -0
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/.gitignore +0 -0
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/.pre-commit-config.yaml +0 -0
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/changelog.md +0 -0
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/otlp_test_data/py.typed +0 -0
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/readme.md +0 -0
- {otlp_test_data-0.11.2 → otlp_test_data-0.11.4}/test/test_repeatable.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: otlp-test-data
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.4
|
|
4
4
|
Summary: Produces OTLP data using OTEL instrumentation
|
|
5
5
|
Project-URL: Repository, https://github.com/dimaqq/otlp-test-data
|
|
6
6
|
Project-URL: Issues, https://github.com/dimaqq/otlp-test-data/issues
|
|
@@ -3,6 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import base64
|
|
4
4
|
import dataclasses
|
|
5
5
|
import json
|
|
6
|
+
import logging
|
|
6
7
|
import random
|
|
7
8
|
from typing import Sequence, TYPE_CHECKING
|
|
8
9
|
from typing_extensions import reveal_type as reveal_type # temp
|
|
@@ -104,6 +105,12 @@ def _proto_to_json(data: Message) -> bytes:
|
|
|
104
105
|
"SPAN_KIND_PRODUCER": 4,
|
|
105
106
|
"SPAN_KIND_CONSUMER": 5,
|
|
106
107
|
}[sp["kind"]]
|
|
108
|
+
if status := sp["status"]:
|
|
109
|
+
status["code"] = {
|
|
110
|
+
"STATUS_CODE_UNSET": 0,
|
|
111
|
+
"STATUS_CODE_OK": 1,
|
|
112
|
+
"STATUS_CODE_ERROR": 2,
|
|
113
|
+
}[status["code"]]
|
|
107
114
|
|
|
108
115
|
return json.dumps(dic).encode("utf-8")
|
|
109
116
|
|
|
@@ -114,6 +121,14 @@ def workload():
|
|
|
114
121
|
attribute_types()
|
|
115
122
|
repeated_attributes()
|
|
116
123
|
events()
|
|
124
|
+
instrumentation_scopes()
|
|
125
|
+
with_exception()
|
|
126
|
+
with_logs()
|
|
127
|
+
# TODO: status that's not an OK status
|
|
128
|
+
# TODO: captured logs
|
|
129
|
+
# TODO: example exception traceback
|
|
130
|
+
# TODO: instrumentation scope with a version
|
|
131
|
+
# TODO: instrumentation scope with attributes
|
|
117
132
|
|
|
118
133
|
|
|
119
134
|
def series_of_spans():
|
|
@@ -138,26 +153,76 @@ def outer():
|
|
|
138
153
|
|
|
139
154
|
|
|
140
155
|
@tracer.start_as_current_span("inner")
|
|
141
|
-
def inner():
|
|
156
|
+
def inner() -> None:
|
|
142
157
|
opentelemetry.trace.get_current_span().set_attribute("an-attribute", 42)
|
|
143
158
|
time.tick()
|
|
144
159
|
|
|
145
160
|
|
|
161
|
+
@tracer.start_as_current_span("with-exc-outer")
|
|
162
|
+
def with_exception() -> None:
|
|
163
|
+
try:
|
|
164
|
+
with tracer.start_as_current_span("with-exc-inner"):
|
|
165
|
+
1 / 0 # type: ignore
|
|
166
|
+
except Exception:
|
|
167
|
+
pass
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
@tracer.start_as_current_span("with-logs")
|
|
171
|
+
def with_logs() -> None:
|
|
172
|
+
logging.warning("sss")
|
|
173
|
+
time.tick()
|
|
174
|
+
logging.warning("sss-sss")
|
|
175
|
+
time.tick()
|
|
176
|
+
logging.warning("sss-sss-sss")
|
|
177
|
+
|
|
178
|
+
|
|
146
179
|
def attribute_types():
|
|
147
180
|
with tracer.start_as_current_span("attribute-types") as span:
|
|
148
181
|
span.set_attributes(
|
|
149
|
-
{"int": 42, "bool": False, "float": 3.14, "str": "
|
|
182
|
+
{"int": 42, "bool": False, "float": 3.14, "str": "cheese", "bytes": b"bb"}
|
|
150
183
|
)
|
|
151
184
|
span.set_attributes(
|
|
152
185
|
{
|
|
153
186
|
"ints": [1, 42],
|
|
154
187
|
"bools": [True, False],
|
|
155
188
|
"floats": [2.72, 3.14],
|
|
156
|
-
"strs": ["
|
|
189
|
+
"strs": ["cheese", "mozzarella"],
|
|
190
|
+
"byteses": [b"aa", b"bb"], # type: ignore
|
|
157
191
|
}
|
|
158
192
|
)
|
|
159
193
|
|
|
160
194
|
|
|
195
|
+
def instrumentation_scopes():
|
|
196
|
+
tracer1 = opentelemetry.trace.get_tracer("one", "1.2.3")
|
|
197
|
+
tracer2 = opentelemetry.trace.get_tracer("one", "2.7.18")
|
|
198
|
+
tracer3 = opentelemetry.trace.get_tracer(
|
|
199
|
+
"one",
|
|
200
|
+
"3.14.0a5",
|
|
201
|
+
attributes={
|
|
202
|
+
"bool": True,
|
|
203
|
+
"int": 42,
|
|
204
|
+
"float": -12.34,
|
|
205
|
+
"string": "cheese",
|
|
206
|
+
"bytes": b"bb",
|
|
207
|
+
"empty-list": [],
|
|
208
|
+
# "empty-dict": {}, # not allowed for instrumentation scopes
|
|
209
|
+
},
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
with tracer1.start_as_current_span("1.1"):
|
|
213
|
+
time.tick()
|
|
214
|
+
with tracer2.start_as_current_span("2.1"):
|
|
215
|
+
time.tick()
|
|
216
|
+
with tracer1.start_as_current_span("1.2"):
|
|
217
|
+
time.tick()
|
|
218
|
+
with tracer1.start_as_current_span("1.3"):
|
|
219
|
+
time.tick()
|
|
220
|
+
with tracer3.start_as_current_span("3.1"):
|
|
221
|
+
time.tick()
|
|
222
|
+
with tracer1.start_as_current_span("1.4"):
|
|
223
|
+
time.tick()
|
|
224
|
+
|
|
225
|
+
|
|
161
226
|
def repeated_attributes():
|
|
162
227
|
with tracer.start_as_current_span("attribute-types") as span:
|
|
163
228
|
span.set_attribute("int", 42)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
from otlp_test_data import sample_proto, sample_spans, sample_json
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_spans():
|
|
7
|
+
assert sample_spans()
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def test_json():
|
|
11
|
+
data = sample_json()
|
|
12
|
+
assert json.loads(data)
|
|
13
|
+
# Ensure that all enum labels have been converted to ints
|
|
14
|
+
assert b"SPAN_KIND_" not in data
|
|
15
|
+
assert b"SPAN_FLAGS_" not in data
|
|
16
|
+
assert b"STATUS_CODE_" not in data
|
|
17
|
+
# Metrics
|
|
18
|
+
assert b"AGGREGATION_TEMPORALITY_" not in data
|
|
19
|
+
assert b"DATA_POINT_FLAGS_" not in data
|
|
20
|
+
# Logs
|
|
21
|
+
assert b"SEVERITY_NUMBER_" not in data
|
|
22
|
+
assert b"LOG_RECORD_FLAGS_" not in data
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def test_proto():
|
|
26
|
+
assert sample_proto()
|
|
@@ -374,7 +374,7 @@ wheels = [
|
|
|
374
374
|
|
|
375
375
|
[[package]]
|
|
376
376
|
name = "otlp-test-data"
|
|
377
|
-
version = "0.
|
|
377
|
+
version = "0.11.4"
|
|
378
378
|
source = { editable = "." }
|
|
379
379
|
dependencies = [
|
|
380
380
|
{ name = "freezegun" },
|
|
@@ -447,15 +447,15 @@ wheels = [
|
|
|
447
447
|
|
|
448
448
|
[[package]]
|
|
449
449
|
name = "pyright"
|
|
450
|
-
version = "1.1.
|
|
450
|
+
version = "1.1.395"
|
|
451
451
|
source = { registry = "https://pypi.org/simple" }
|
|
452
452
|
dependencies = [
|
|
453
453
|
{ name = "nodeenv" },
|
|
454
454
|
{ name = "typing-extensions" },
|
|
455
455
|
]
|
|
456
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
456
|
+
sdist = { url = "https://files.pythonhosted.org/packages/fb/47/a2e1dfd70f9f0db34f70d5b108c82be57bf24185af69c95acff57f9239fa/pyright-1.1.395.tar.gz", hash = "sha256:53703169068c160bfb41e1b44ba3e2512492869c26cfad927e1268cb3fbb1b1c", size = 3813566 }
|
|
457
457
|
wheels = [
|
|
458
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
458
|
+
{ url = "https://files.pythonhosted.org/packages/5f/a1/531897f8caa6c6cc99862cd1c908ddd8a366a51d968e83ab4523ded98b30/pyright-1.1.395-py3-none-any.whl", hash = "sha256:f9bc726870e740c6c77c94657734d90563a3e9765bb523b39f5860198ed75eef", size = 5688787 },
|
|
459
459
|
]
|
|
460
460
|
|
|
461
461
|
[[package]]
|
|
@@ -505,27 +505,27 @@ wheels = [
|
|
|
505
505
|
|
|
506
506
|
[[package]]
|
|
507
507
|
name = "ruff"
|
|
508
|
-
version = "0.9.
|
|
509
|
-
source = { registry = "https://pypi.org/simple" }
|
|
510
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
511
|
-
wheels = [
|
|
512
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
513
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
514
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
515
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
516
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
517
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
518
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
519
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
520
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
521
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
522
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
523
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
524
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
525
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
526
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
527
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
528
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
508
|
+
version = "0.9.9"
|
|
509
|
+
source = { registry = "https://pypi.org/simple" }
|
|
510
|
+
sdist = { url = "https://files.pythonhosted.org/packages/6f/c3/418441a8170e8d53d05c0b9dad69760dbc7b8a12c10dbe6db1e1205d2377/ruff-0.9.9.tar.gz", hash = "sha256:0062ed13f22173e85f8f7056f9a24016e692efeea8704d1a5e8011b8aa850933", size = 3717448 }
|
|
511
|
+
wheels = [
|
|
512
|
+
{ url = "https://files.pythonhosted.org/packages/bc/c3/2c4afa9ba467555d074b146d9aed0633a56ccdb900839fb008295d037b89/ruff-0.9.9-py3-none-linux_armv6l.whl", hash = "sha256:628abb5ea10345e53dff55b167595a159d3e174d6720bf19761f5e467e68d367", size = 10027252 },
|
|
513
|
+
{ url = "https://files.pythonhosted.org/packages/33/d1/439e58487cf9eac26378332e25e7d5ade4b800ce1eec7dc2cfc9b0d7ca96/ruff-0.9.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b6cd1428e834b35d7493354723543b28cc11dc14d1ce19b685f6e68e07c05ec7", size = 10840721 },
|
|
514
|
+
{ url = "https://files.pythonhosted.org/packages/50/44/fead822c38281ba0122f1b76b460488a175a9bd48b130650a6fb6dbcbcf9/ruff-0.9.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5ee162652869120ad260670706f3cd36cd3f32b0c651f02b6da142652c54941d", size = 10161439 },
|
|
515
|
+
{ url = "https://files.pythonhosted.org/packages/11/ae/d404a2ab8e61ddf6342e09cc6b7f7846cce6b243e45c2007dbe0ca928a5d/ruff-0.9.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3aa0f6b75082c9be1ec5a1db78c6d4b02e2375c3068438241dc19c7c306cc61a", size = 10336264 },
|
|
516
|
+
{ url = "https://files.pythonhosted.org/packages/6a/4e/7c268aa7d84cd709fb6f046b8972313142cffb40dfff1d2515c5e6288d54/ruff-0.9.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:584cc66e89fb5f80f84b05133dd677a17cdd86901d6479712c96597a3f28e7fe", size = 9908774 },
|
|
517
|
+
{ url = "https://files.pythonhosted.org/packages/cc/26/c618a878367ef1b76270fd027ca93692657d3f6122b84ba48911ef5f2edc/ruff-0.9.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abf3369325761a35aba75cd5c55ba1b5eb17d772f12ab168fbfac54be85cf18c", size = 11428127 },
|
|
518
|
+
{ url = "https://files.pythonhosted.org/packages/d7/9a/c5588a93d9bfed29f565baf193fe802fa676a0c837938137ea6cf0576d8c/ruff-0.9.9-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:3403a53a32a90ce929aa2f758542aca9234befa133e29f4933dcef28a24317be", size = 12133187 },
|
|
519
|
+
{ url = "https://files.pythonhosted.org/packages/3e/ff/e7980a7704a60905ed7e156a8d73f604c846d9bd87deda9cabfa6cba073a/ruff-0.9.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:18454e7fa4e4d72cffe28a37cf6a73cb2594f81ec9f4eca31a0aaa9ccdfb1590", size = 11602937 },
|
|
520
|
+
{ url = "https://files.pythonhosted.org/packages/24/78/3690444ad9e3cab5c11abe56554c35f005b51d1d118b429765249095269f/ruff-0.9.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fadfe2c88724c9617339f62319ed40dcdadadf2888d5afb88bf3adee7b35bfb", size = 13771698 },
|
|
521
|
+
{ url = "https://files.pythonhosted.org/packages/6e/bf/e477c2faf86abe3988e0b5fd22a7f3520e820b2ee335131aca2e16120038/ruff-0.9.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6df104d08c442a1aabcfd254279b8cc1e2cbf41a605aa3e26610ba1ec4acf0b0", size = 11249026 },
|
|
522
|
+
{ url = "https://files.pythonhosted.org/packages/f7/82/cdaffd59e5a8cb5b14c408c73d7a555a577cf6645faaf83e52fe99521715/ruff-0.9.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:d7c62939daf5b2a15af48abbd23bea1efdd38c312d6e7c4cedf5a24e03207e17", size = 10220432 },
|
|
523
|
+
{ url = "https://files.pythonhosted.org/packages/fe/a4/2507d0026225efa5d4412b6e294dfe54725a78652a5c7e29e6bd0fc492f3/ruff-0.9.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:9494ba82a37a4b81b6a798076e4a3251c13243fc37967e998efe4cce58c8a8d1", size = 9874602 },
|
|
524
|
+
{ url = "https://files.pythonhosted.org/packages/d5/be/f3aab1813846b476c4bcffe052d232244979c3cd99d751c17afb530ca8e4/ruff-0.9.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:4efd7a96ed6d36ef011ae798bf794c5501a514be369296c672dab7921087fa57", size = 10851212 },
|
|
525
|
+
{ url = "https://files.pythonhosted.org/packages/8b/45/8e5fd559bea0d2f57c4e12bf197a2fade2fac465aa518284f157dfbca92b/ruff-0.9.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:ab90a7944c5a1296f3ecb08d1cbf8c2da34c7e68114b1271a431a3ad30cb660e", size = 11327490 },
|
|
526
|
+
{ url = "https://files.pythonhosted.org/packages/42/55/e6c90f13880aeef327746052907e7e930681f26a164fe130ddac28b08269/ruff-0.9.9-py3-none-win32.whl", hash = "sha256:6b4c376d929c25ecd6d87e182a230fa4377b8e5125a4ff52d506ee8c087153c1", size = 10227912 },
|
|
527
|
+
{ url = "https://files.pythonhosted.org/packages/35/b2/da925693cb82a1208aa34966c0f36cb222baca94e729dd22a587bc22d0f3/ruff-0.9.9-py3-none-win_amd64.whl", hash = "sha256:837982ea24091d4c1700ddb2f63b7070e5baec508e43b01de013dc7eff974ff1", size = 11355632 },
|
|
528
|
+
{ url = "https://files.pythonhosted.org/packages/31/d8/de873d1c1b020d668d8ec9855d390764cb90cf8f6486c0983da52be8b7b7/ruff-0.9.9-py3-none-win_arm64.whl", hash = "sha256:3ac78f127517209fe6d96ab00f3ba97cafe38718b23b1db3e96d8b2d39e37ddf", size = 10435860 },
|
|
529
529
|
]
|
|
530
530
|
|
|
531
531
|
[[package]]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|