otlp-json 1.0.0__py3-none-any.whl → 1.0.1__py3-none-any.whl

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_json/__init__.py CHANGED
@@ -7,15 +7,15 @@ from typing import Any, TYPE_CHECKING
7
7
  if TYPE_CHECKING:
8
8
  from typing_extensions import TypeAlias
9
9
 
10
- from opentelemetry.trace import Link
11
- from opentelemetry._logs import LogRecord
12
10
  from opentelemetry.sdk.trace import ReadableSpan, Event
13
11
  from opentelemetry.sdk.resources import Resource
14
12
  from opentelemetry.sdk.util.instrumentation import InstrumentationScope
15
13
  from opentelemetry.trace.status import Status
16
14
 
17
15
  _LEAF_VALUE: TypeAlias = "str | int | float | bool" # TODO: confirm
18
- _VALUE: TypeAlias = "_LEAF_VALUE | Sequence[_LEAF_VALUE]"
16
+ _VALUE: TypeAlias = (
17
+ "_LEAF_VALUE | Sequence[_LEAF_VALUE] | Mapping[str, _LEAF_VALUE]"
18
+ )
19
19
 
20
20
 
21
21
  __all__ = [
@@ -79,7 +79,10 @@ def _resource(resource: Resource):
79
79
 
80
80
 
81
81
  def _attributes(
82
- thing: Resource | InstrumentationScope | ReadableSpan | Event | Link | LogRecord,
82
+ thing: Resource
83
+ | InstrumentationScope
84
+ | ReadableSpan
85
+ | Event, # TODO: | Link | LogRecord
83
86
  ) -> dict[str, Any]:
84
87
  rv = {"attributes": [], "dropped_attributes_count": 0}
85
88
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: otlp-json
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: 🐍Lightweight OTEL span to JSON converter, no dependencies, pure Python🐍
5
5
  Project-URL: Repository, https://github.com/dimaqq/otlp-json
6
6
  Project-URL: Issues, https://github.com/dimaqq/otlp-json/issues
@@ -65,13 +65,21 @@ class SomeExporter:
65
65
  - 4KB Python source
66
66
  - ?? metadata
67
67
 
68
- ### TODO(doc)
69
68
 
70
- - link to rust library
71
- - link to urllib sender
72
- - link to test vector generator
69
+ ### Testing
73
70
 
74
- ### TODO(features)
71
+ ```sh
72
+ uv sync
73
+ uv run pytest
74
+ ```
75
+
76
+ ### Links
77
+
78
+ - Test data generator: https://pypi.org/project/otlp-test-data/
79
+ - Python stdlib-only exporter: https://github.com/canonical/operator/blob/main/tracing/ops_tracing/_export.py#L141-L160
80
+ - Tiny (compiled) extension written in Rust: https://pypi.org/project/otlp-proto
81
+
82
+ ### Features
75
83
 
76
84
  - Events
77
85
  - Links
@@ -0,0 +1,5 @@
1
+ otlp_json/__init__.py,sha256=0vONvhOfzungBU149iBSppozUJcB-2VVC-ovitMyhWk,6294
2
+ otlp_json/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ otlp_json-1.0.1.dist-info/METADATA,sha256=35RWnXiYMOuOFWW4dSiQSvTDr5mYkZ8a7B2wqc1osWM,3075
4
+ otlp_json-1.0.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
5
+ otlp_json-1.0.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,5 +0,0 @@
1
- otlp_json/__init__.py,sha256=0XbSIDoWRqPvhDW9TeMiOoMn9ExLT5yKNz9a3ikARgY,6316
2
- otlp_json/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- otlp_json-1.0.0.dist-info/METADATA,sha256=LnTba1YWCWcR7lvMKdQWZ_OTmn5zQhCqDrFkbL9smYU,2852
4
- otlp_json-1.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
- otlp_json-1.0.0.dist-info/RECORD,,