{"id":21661,"library":"opentelemetry-python-contrib-external-valkey","title":"OpenTelemetry Valkey Instrumentation","description":"Auto-instrumentation for Valkey (a Redis-compatible key-value store) via OpenTelemetry. Currently at version 0.62b0, released as part of the opentelemetry-python-contrib-external repository. Follows OpenTelemetry semantic conventions; compatible with Python >=3.9.","status":"active","version":"0.62b0","language":"python","source_language":"en","source_url":"https://github.com/open-telemetry/opentelemetry-python-contrib-external","tags":["OpenTelemetry","instrumentation","valkey","tracing","observability"],"install":[{"cmd":"pip install opentelemetry-python-contrib-external-valkey","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install opentelemetry-distro opentelemetry-exporter-otlp","lang":"bash","label":"If also installing distro and exporter"}],"dependencies":[{"reason":"Core API dependency","package":"opentelemetry-api","optional":false},{"reason":"Base instrumentation package","package":"opentelemetry-instrumentation","optional":false},{"reason":"Instrumentation requires Valkey client library","package":"valkey","optional":false}],"imports":[{"note":"Old import path from contrib package","wrong":"from opentelemetry.contrib.valkey import ValkeyInstrumentor","symbol":"ValkeyInstrumentor","correct":"from opentelemetry.instrumentation.valkey import ValkeyInstrumentor"}],"quickstart":{"code":"from opentelemetry.instrumentation.valkey import ValkeyInstrumentor\nfrom valkey import Valkey\n\n# Instrument Valkey automatically\nValkeyInstrumentor().instrument()\n\n# Create a Valkey client\nclient = Valkey(host='localhost', port=6379, db=0)\nclient.set('key', 'value')\nprint(client.get('key'))","lang":"python","description":"Basic auto-instrumentation of Valkey client"},"warnings":[{"fix":"pip install valkey","message":"Ensure that the `valkey` Python client is installed separately; this package only provides instrumentation.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Call instrument() before instantiating client","message":"Instrumentation must be applied before creating any Valkey client instances to capture all spans.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use from opentelemetry.instrumentation.valkey import ValkeyInstrumentor","message":"The import path opentelemetry.contrib.valkey was deprecated in favor of opentelemetry.instrumentation.valkey.","severity":"deprecated","affected_versions":"<0.62b0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install with: pip install opentelemetry-python-contrib-external-valkey, then correct import to: from opentelemetry.instrumentation.valkey import ValkeyInstrumentor","cause":"Package not installed or wrong import path.","error":"No module named 'opentelemetry.instrumentation.valkey'"},{"fix":"Install valkey client: pip install valkey","cause":"Valkey client library not installed.","error":"ModuleNotFoundError: No module named 'valkey'"},{"fix":"Move ValkeyInstrumentor().instrument() before any Valkey client instantiation.","cause":"Instrumentation was applied after creating the client instance.","error":"ValkeyInstrumentor not instrumenting calls"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}