diff --git a/Cargo.toml b/Cargo.toml index 72c411186..e88cec4c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ pyo3 = { version = "0.20.0", features = ["extension-module"] } pyo3-asyncio = { version = "0.20", features = ["tokio-runtime"] } pyo3-log = { version = "0.8.2" } pyo3-opentelemetry = { version = "0.3" } -pyo3-tracing-subscriber = { version = "0.1.4", default-features = true } +pyo3-tracing-subscriber = { version = "0.1.4", default-features = false, features = ["pyo3"] } pyo3-build-config = "0.20.0" rigetti-pyo3 = { version = "0.4.1", default-features = false, features = ["complex", "time"] } diff --git a/crates/python/qcs_sdk/_tracing_subscriber/__init__.pyi b/crates/python/qcs_sdk/_tracing_subscriber/__init__.pyi index bfacfbece..0ebc7009b 100644 --- a/crates/python/qcs_sdk/_tracing_subscriber/__init__.pyi +++ b/crates/python/qcs_sdk/_tracing_subscriber/__init__.pyi @@ -15,6 +15,7 @@ from __future__ import annotations from types import TracebackType from typing import TYPE_CHECKING, Optional, Type, final +from . import common as common from . import layers as layers from . import subscriber as subscriber diff --git a/crates/python/qcs_sdk/_tracing_subscriber/common/__init__.py b/crates/python/qcs_sdk/_tracing_subscriber/common/__init__.py new file mode 100644 index 000000000..16c779086 --- /dev/null +++ b/crates/python/qcs_sdk/_tracing_subscriber/common/__init__.py @@ -0,0 +1,18 @@ +# ***************************************************************************** +# * AUTO-GENERATED CODE * +# * * +# * This code was generated by the `pyo3-tracing-subscriber` crate. Any * +# * modifications to this file should be made to the script or the generation * +# * process that produced this code. Specifically, see: * +# * `pyo3_tracing_subscriber::stubs::write_stub_files` * +# * * +# * Do not manually edit this file, as your changes may be overwritten the * +# * next time the code is generated. * +# ***************************************************************************** + +from qcs_sdk._tracing_subscriber import common + + +__doc__ = common.__doc__ +__all__ = getattr(common, "__all__", []) + diff --git a/crates/python/qcs_sdk/_tracing_subscriber/common/__init__.pyi b/crates/python/qcs_sdk/_tracing_subscriber/common/__init__.pyi new file mode 100644 index 000000000..07127164f --- /dev/null +++ b/crates/python/qcs_sdk/_tracing_subscriber/common/__init__.pyi @@ -0,0 +1,45 @@ +# ***************************************************************************** +# * AUTO-GENERATED CODE * +# * * +# * This code was generated by the `pyo3-tracing-subscriber` crate. Any * +# * modifications to this file should be made to the script or the generation * +# * process that produced this code. Specifically, see: * +# * `pyo3_tracing_subscriber::stubs::write_stub_files` * +# * * +# * Do not manually edit this file, as your changes may be overwritten the * +# * next time the code is generated. * +# ***************************************************************************** + +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 `_ + spec for more information. + """ + + def __new__( + cls, + name: str, + version: Optional[str] = None, + schema_url: Optional[str] = None, + attributes: Optional[Dict[str, str]] = None, + ) -> "InstrumentationLibrary": + """ + Initializes a new instance of `InstrumentationLibrary`. + + :param name: The name of the instrumentation library. + :param version: The version of the instrumentation library. + :param schema_url: The `schema URL `_ of + the instrumentation library. + :param attributes: The attributes of the instrumentation library. + """ + ... + diff --git a/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.pyi b/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.pyi index 5dde69007..f5990ffc8 100644 --- a/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.pyi +++ b/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp/__init__.pyi @@ -12,6 +12,7 @@ from __future__ import annotations from typing import Dict, Optional, TYPE_CHECKING, final +from qcs_sdk._tracing_subscriber.common import InstrumentationLibrary @final class SpanLimits: @@ -70,6 +71,7 @@ class Config: timeout_millis: Optional[int] = None, pre_shutdown_timeout_millis: Optional[int] = 2000, filter: Optional[str] = None, + instrumentation_library: Optional[InstrumentationLibrary] = None, ) -> "Config": """ Initializes a new `Config`. @@ -94,6 +96,7 @@ class Config: If not specified, this will first check the `PYO3_TRACING_SUBSCRIBER_ENV_FILTER` environment variable and then `RUST_LOG` environment variable. If all of these values are empty, no spans will be exported. + :param instrumentation_library: Information about the library providing the tracing instrumentation. """ ... diff --git a/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi b/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi index 613126b30..0b55c2f8a 100644 --- a/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi +++ b/crates/python/qcs_sdk/_tracing_subscriber/layers/otel_otlp_file/__init__.pyi @@ -11,6 +11,8 @@ # ***************************************************************************** from typing import Optional, final +from qcs_sdk._tracing_subscriber.common import InstrumentationLibrary + @final class Config: @@ -19,7 +21,7 @@ class Config: layer. """ - def __new__(cls, *, file_path: Optional[str] = None, filter: Optional[str] = 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 @@ -30,6 +32,7 @@ class Config: If not specified, this will first check the `PYO3_TRACING_SUBSCRIBER_ENV_FILTER` environment variable and then `RUST_LOG` environment variable. If all of these values are empty, no spans will be exported. + :param instrumentation_library: Information about the library providing the tracing instrumentation. """ ...