{"id":23890,"library":"instana","title":"Instana Python Sensor","description":"Automatic distributed tracing and metrics collection for Python applications, designed to work with the Instana observability platform. Version 3.14.0 requires Python >=3.9. Active development with frequent releases every few weeks.","status":"active","version":"3.14.0","language":"python","source_language":"en","source_url":"https://github.com/instana/python-sensor","tags":["observability","tracing","monitoring","instana"],"install":[{"cmd":"pip install instana","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"No common mistake; the package auto-instruments supported frameworks upon import.","wrong":"","symbol":"instana","correct":"import instana"}],"quickstart":{"code":"import instana\nimport os\n# Agent host can be set via env var INSTANA_AGENT_HOST\nos.environ.get('INSTANA_AGENT_HOST', '')\n# The sensor starts automatically when imported\nprint('Instana sensor initialized')","lang":"python","description":"Importing the module auto-starts the sensor. Set INSTANA_AGENT_HOST environment variable to point to your Instana agent."},"warnings":[{"fix":"Set INSTANA_DISABLE_<FRAMEWORK>=true to disable auto-instrumentation for that framework.","message":"The Instana sensor auto-instruments many frameworks (Django, Flask, etc.). If you see unexpected spans or performance overhead, check the list of supported frameworks. You can disable instrumentation for specific frameworks via environment variables.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure INSTANA_AGENT_HOST is set correctly and network connectivity exists. For Kubernetes, use the agent's DNS or IP.","message":"The agent host must be reachable; otherwise the sensor will buffer spans locally until timeout. Spans may be lost if agent is unreachable for too long.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to Python >=3.9.","message":"Older Python versions (3.7, 3.8) are no longer supported as of v3.0.0+.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install with 'pip install instana' and 'import instana' in your code.","cause":"Package not installed or imported incorrectly.","error":"ModuleNotFoundError: No module named 'instana'"},{"fix":"Start the Instana agent, or set INSTANA_AGENT_HOST environment variable to the correct agent endpoint.","cause":"Instana agent is not running or unreachable on the default host/port.","error":"instana.collector.Collector: Failed to report spans to agent at http://localhost:42699/com.instana.plugin.python.spans"},{"fix":"Use 'instana.current_span()' to get the active span, or read the documentation for custom spans.","cause":"Incorrect use of the API; the library does not expose a public 'span' attribute. Use instana.current_span() or instana.span_context.","error":"AttributeError: module 'instana' has no attribute 'span'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}