Skip to content

Commit

Permalink
fix: format tracing subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
erichulburd committed Nov 25, 2024
1 parent e22d9dd commit 05c6136
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@

__doc__ = common.__doc__
__all__ = getattr(common, "__all__", [])

6 changes: 2 additions & 4 deletions crates/python/qcs_sdk/_tracing_subscriber/common/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@

from typing import Dict, Optional, final


@final
class InstrumentationLibrary:
"""
Information about a library or crate providing instrumentation.
An instrumentation library should be named to follow any naming conventions
of the instrumented library (e.g. 'middleware' for a web framework).
See the `instrumentation libraries <https://github.com/open-telemetry/opentelemetry-specification/blob/v1.9.0/specification/overview.md#instrumentation-libraries>`_
spec for more information.
"""
Expand All @@ -42,4 +41,3 @@ class InstrumentationLibrary:
:param attributes: The attributes of the instrumentation library.
"""
...

Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@

__doc__ = layers.__doc__
__all__ = getattr(layers, "__all__", [])

16 changes: 8 additions & 8 deletions crates/python/qcs_sdk/_tracing_subscriber/layers/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
from __future__ import annotations
from typing import TYPE_CHECKING

from . import file as file
from . import file as file
from . import otel_otlp_file as otel_otlp_file
from . import otel_otlp as otel_otlp

if TYPE_CHECKING:
from typing import Union
from typing import Union

Config = Union[
file.Config,
otel_otlp_file.Config,
otel_otlp.Config,
]
"""
Config = Union[
file.Config,
otel_otlp_file.Config,
otel_otlp.Config,
]
"""
One of the supported layer configurations that may be set on the subscriber configuration.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@

__doc__ = file.__doc__
__all__ = getattr(file, "__all__", [])


Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ class Config:
:param json: Whether or not to format the output as JSON. Defaults to `True`.
"""
...

Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@

__doc__ = otel_otlp.__doc__
__all__ = getattr(otel_otlp, "__all__", [])

Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class Resource:
schema_url: Optional[str] = None,
) -> "Resource": ...



@final
class Config:
"""
Expand Down Expand Up @@ -101,14 +99,14 @@ class Config:
...

if TYPE_CHECKING:
from typing import List, Union
from typing import List, Union

ResourceValueArray = Union[List[bool], List[int], List[float], List[str]]
"""
An array of `ResourceValue`s. This array is homogenous, so all values must be of the same type.
"""

ResourceValue= Union[bool, int, float, str, ResourceValueArray]
ResourceValue = Union[bool, int, float, str, ResourceValueArray]
"""
A value that can be added to a `Resource`.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@

__doc__ = otel_otlp_file.__doc__
__all__ = getattr(otel_otlp_file, "__all__", [])

Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@
from typing import Optional, final
from qcs_sdk._tracing_subscriber.common import InstrumentationLibrary


@final
class Config:
"""
A configuration for `opentelemetry-stdout <https://docs.rs/opentelemetry-stdout/latest/opentelemetry_stdout/>`_
layer.
"""

def __new__(cls, *, file_path: Optional[str] = None, filter: Optional[str] = None, instrumentation_library: Optional[InstrumentationLibrary] = None) -> "Config":
def __new__(
cls,
*,
file_path: Optional[str] = None,
filter: Optional[str] = None,
instrumentation_library: Optional[InstrumentationLibrary] = None,
) -> "Config":
"""
:param file_path: The path to the file to write to. If not specified, defaults to stdout.
:param filter: A filter string to use for this layer. This uses the same format as the
Expand All @@ -35,4 +40,3 @@ class Config:
:param instrumentation_library: Information about the library providing the tracing instrumentation.
"""
...

Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@

__doc__ = subscriber.__doc__
__all__ = getattr(subscriber, "__all__", [])

Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ class Config:
"""

def __new__(cls, *, layer: layers.Config) -> "Config": ...

0 comments on commit 05c6136

Please sign in to comment.