Skip to content

Commit

Permalink
chore: Fixed a typo in OtelInstrumentation abstraction class
Browse files Browse the repository at this point in the history
  • Loading branch information
tazarov committed Feb 1, 2024
1 parent 0b4d25e commit 03fece7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions chromadb/telemetry/opentelemetry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __lt__(self, other: Any) -> bool:
]


class OpelInstrumentation(ABC, EnforceOverrides):
class OtelInstrumentation(ABC, EnforceOverrides):
"""
An abstract class for OpenTelemetry instrumentation.
"""
Expand Down Expand Up @@ -143,7 +143,7 @@ def add_observable_gauge(
:param description: The description of the gauge.
Example:
>>> OpelInstrumentation.add_observable_gauge("my_gauge", lambda: return psutil.cpu_percent(), "percent", "CPU Usage")
>>> OtelInstrumentation.add_observable_gauge("my_gauge", lambda: return psutil.cpu_percent(), "percent", "CPU Usage")
"""
...

Expand All @@ -163,7 +163,7 @@ def add_observable_counter(
:param description: The description of the counter.
Example:
>>> OpelInstrumentation.add_observable_counter("my_counter", lambda: return psutil.net_io_counters().bytes_sent, "bytes", "Bytes out")
>>> OtelInstrumentation.add_observable_counter("my_counter", lambda: return psutil.net_io_counters().bytes_sent, "bytes", "Bytes out")
"""
...

Expand Down Expand Up @@ -203,10 +203,10 @@ def get_current_span_id(self) -> Optional[str]:
...


_otel_instance: Optional[OpelInstrumentation] = None
_otel_instance: Optional[OtelInstrumentation] = None


def get_otel_client() -> Optional[OpelInstrumentation]:
def get_otel_client() -> Optional[OtelInstrumentation]:
global _otel_instance
if (
not telemetry_settings.chroma_otel_collection_endpoint
Expand All @@ -216,7 +216,7 @@ def get_otel_client() -> Optional[OpelInstrumentation]:

if _otel_instance is None:
_otel_package = importlib.import_module("chromadb.telemetry.opentelemetry.otel")
_otel_instance = cast(OpelInstrumentation, _otel_package.otel_client)
_otel_instance = cast(OtelInstrumentation, _otel_package.otel_client)
return _otel_instance


Expand Down
4 changes: 2 additions & 2 deletions chromadb/telemetry/opentelemetry/otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
OpenTelemetryGranularity,
OtelAttributes,
telemetry_settings,
OpelInstrumentation,
OtelInstrumentation,
)


Expand All @@ -51,7 +51,7 @@
# logs_enabled = False


class OtelClient(OpelInstrumentation):
class OtelClient(OtelInstrumentation):
"""A client for OpenTelemetry."""

def __init__(self) -> None:
Expand Down

0 comments on commit 03fece7

Please sign in to comment.