mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-08-02 11:31:52 +08:00
Run pyright on Vertex AI instrumentation (#3184)
This commit is contained in:
@ -39,7 +39,7 @@ API
|
||||
---
|
||||
"""
|
||||
|
||||
from typing import Collection
|
||||
from typing import Any, Collection
|
||||
|
||||
from opentelemetry._events import get_event_logger
|
||||
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
||||
@ -52,7 +52,7 @@ class VertexAIInstrumentor(BaseInstrumentor):
|
||||
def instrumentation_dependencies(self) -> Collection[str]:
|
||||
return _instruments
|
||||
|
||||
def _instrument(self, **kwargs):
|
||||
def _instrument(self, **kwargs: Any):
|
||||
"""Enable VertexAI instrumentation."""
|
||||
tracer_provider = kwargs.get("tracer_provider")
|
||||
_tracer = get_tracer(
|
||||
@ -70,5 +70,5 @@ class VertexAIInstrumentor(BaseInstrumentor):
|
||||
)
|
||||
# TODO: implemented in later PR
|
||||
|
||||
def _uninstrument(self, **kwargs) -> None:
|
||||
def _uninstrument(self, **kwargs: Any) -> None:
|
||||
"""TODO: implemented in later PR"""
|
||||
|
@ -48,10 +48,13 @@ pythonVersion = "3.8"
|
||||
reportPrivateUsage = false # Ignore private attributes added by instrumentation packages.
|
||||
# Add progressively instrumentation packages here.
|
||||
include = [
|
||||
"instrumentation/opentelemetry-instrumentation-threading/**/*.py"
|
||||
"instrumentation/opentelemetry-instrumentation-threading/**/*.py",
|
||||
"instrumentation-genai/opentelemetry-instrumentation-vertexai/**/*.py",
|
||||
]
|
||||
# We should also add type hints to the test suite - It helps on finding bugs.
|
||||
# We are excluding for now because it's easier, and more important to add to the instrumentation packages.
|
||||
exclude = [
|
||||
"instrumentation/opentelemetry-instrumentation-threading/tests/**",
|
||||
"instrumentation-genai/opentelemetry-instrumentation-vertexai/tests/**/*.py",
|
||||
"instrumentation-genai/opentelemetry-instrumentation-vertexai/examples/**/*.py",
|
||||
]
|
||||
|
Reference in New Issue
Block a user