Skip to content

Commit 0522e4e

Browse files
committed
fix: resolve precommit issues (unused imports, RST title underline)
1 parent fbdf10b commit 0522e4e

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

  • instrumentation
    • opentelemetry-instrumentation-redis-valkey-base/src/opentelemetry/instrumentation/_redis_valkey
    • opentelemetry-instrumentation-valkey

instrumentation/opentelemetry-instrumentation-redis-valkey-base/src/opentelemetry/instrumentation/_redis_valkey/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from __future__ import annotations
2424

2525
from dataclasses import dataclass
26-
from typing import Any, Callable
26+
from typing import Callable
2727

2828
from opentelemetry import trace
2929
from opentelemetry.instrumentation._redis_valkey.util import (
@@ -57,7 +57,9 @@ class KVStoreConfig:
5757
db_system_attr: str # DB_SYSTEM semconv key
5858
db_index_attr: str # DB_REDIS_DATABASE_INDEX or "db.valkey.database_index"
5959
args_length_attr: str # "db.redis.args_length" or "db.valkey.args_length"
60-
pipeline_length_attr: str # "db.redis.pipeline_length" or "db.valkey.pipeline_length"
60+
pipeline_length_attr: (
61+
str # "db.redis.pipeline_length" or "db.valkey.pipeline_length"
62+
)
6163

6264
# WatchError class from the backend library
6365
watch_error_class: type
@@ -91,9 +93,7 @@ def _traced_execute_command(func, instance, args, kwargs):
9193
)
9294
span.set_attribute(config.args_length_attr, len(args))
9395
if span.name == f"{config.backend_name}.create_index":
94-
_add_create_attributes(
95-
span, args, config.backend_name
96-
)
96+
_add_create_attributes(span, args, config.backend_name)
9797
if callable(request_hook):
9898
request_hook(span, instance, args, kwargs)
9999
response = func(*args, **kwargs)

instrumentation/opentelemetry-instrumentation-valkey/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
OpenTelemetry Valkey Instrumentation
2-
===================================
2+
====================================
33

44
|pypi|
55

instrumentation/opentelemetry-instrumentation-valkey/src/opentelemetry/instrumentation/valkey/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ def response_hook(span, instance, response):
152152
import valkey.asyncio
153153
from wrapt import wrap_function_wrapper
154154

155-
from opentelemetry import trace
156155
from opentelemetry.instrumentation._redis_valkey import (
157156
KVStoreConfig,
158157
_async_traced_execute_factory,
@@ -165,7 +164,7 @@ def response_hook(span, instance, response):
165164
from opentelemetry.instrumentation.valkey.package import _instruments
166165
from opentelemetry.instrumentation.valkey.version import __version__
167166
from opentelemetry.semconv.trace import SpanAttributes
168-
from opentelemetry.trace import Span, TracerProvider, get_tracer
167+
from opentelemetry.trace import TracerProvider, get_tracer
169168

170169
if TYPE_CHECKING:
171170
import valkey.asyncio.client
@@ -436,7 +435,9 @@ def instrument_client(
436435
if not getattr(client, _INSTRUMENTATION_ATTR):
437436
_instrument_client(
438437
client,
439-
ValkeyInstrumentor._get_tracer(tracer_provider=tracer_provider),
438+
ValkeyInstrumentor._get_tracer(
439+
tracer_provider=tracer_provider
440+
),
440441
request_hook=request_hook,
441442
response_hook=response_hook,
442443
)

0 commit comments

Comments
 (0)