otlp-json 0.9.7__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,14 +1,15 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: otlp-json
3
- Version: 0.9.7
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
7
+ License: Apache License (2.0)
7
8
  Classifier: Development Status :: 3 - Alpha
8
9
  Classifier: Framework :: OpenTelemetry
9
10
  Classifier: Framework :: OpenTelemetry :: Exporters
10
11
  Classifier: Intended Audience :: Developers
11
- Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: License :: OSI Approved :: Apache Software License
12
13
  Classifier: Natural Language :: English
13
14
  Classifier: Operating System :: OS Independent
14
15
  Classifier: Programming Language :: Python
@@ -64,13 +65,21 @@ class SomeExporter:
64
65
  - 4KB Python source
65
66
  - ?? metadata
66
67
 
67
- ### TODO(doc)
68
68
 
69
- - link to rust library
70
- - link to urllib sender
71
- - link to test vector generator
69
+ ### Testing
72
70
 
73
- ### 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
74
83
 
75
84
  - Events
76
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-0.9.7.dist-info/METADATA,sha256=7KhcPK3Rg0nto4wBiVvp6eQ1NaWmhslOzzA-9EtTNfs,2810
4
- otlp_json-0.9.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
- otlp_json-0.9.7.dist-info/RECORD,,