Skip to main content

Varicon Observability

Unified observability package for logs, traces, and metrics across all Varicon services.

Features

  • Universal Log Capture: Captures all logs regardless of how they're created
  • Distributed Tracing: Automatic trace correlation across services
  • Metrics: System telemetry and performance metrics
  • Zero Code Changes: Works with existing logging code
  • Framework Support: Auto-detects and instruments Django, FastAPI, Celery
  • Async DB spans: instrument_sqlalchemy() traces SQLAlchemy + asyncpg engines (psycopg2 auto-instrumentation doesn't cover async)
  • Content redaction: strips LLM prompt/response content (ADK / GenAI-semconv / OpenInference / Traceloop) from spans before export — on by default, fails closed
  • Local span inspection: dump spans to an NDJSON file (OTEL_SPAN_FILE_EXPORT) and run in file-only mode with no backend

Installation

From Local Source (Development)

cd varicon_observability
pip install -e .

# Or with optional dependencies
pip install -e ".[full]"

From Git Repository

pip install git+https://github.com/your-org/varicon-observability.git

# With optional dependencies
pip install "git+https://github.com/your-org/varicon-observability.git#egg=varicon-observability[full]"

Build and Install from Source

cd varicon_observability
python -m build
pip install dist/varicon_observability-*.whl

Installation Options

  • Basic: pip install varicon-observability
  • Django: pip install varicon-observability[django]
  • FastAPI: pip install varicon-observability[fastapi]
  • Celery: pip install varicon-observability[celery]
  • AWS platform attributes: pip install varicon-observability[aws] — adds cloud.platform, aws.ecs.* and friends to the Resource. Not included by [django]/[fastapi]/[celery]; already in [full]. Without it, platform detection is a silent no-op rather than an error.
  • Full: pip install varicon-observability[full]

Quick Start

Django (varicon)

# varicon/varicon/asgi.py or settings.py
from varicon_observability import setup_observability

setup_observability(service_name="varicon-django")

FastAPI (integrations_service)

# integrations_service/main.py
from varicon_observability import setup_observability

setup_observability(service_name="integration-service")

Configuration

Set environment variables:

OTEL_ENABLED=true
OTEL_SERVICE_NAME=my-service
OTEL_SERVICE_VERSION=v1.2.3-4-gabc1234  # build id; defaults to "unset" (see below)
OTEL_EXPORTER_OTLP_ENDPOINT=http://signoz-otel-collector:4318
OTEL_EXPORTER_OTLP_PROTOCOL=grpc  # or http
OTEL_EXPORTER_OTLP_HEADERS=signoz-ingestion-key=your-key
OTEL_METRIC_EXPORT_INTERVAL=60000  # Export metrics every 60 seconds (ms)

# Span filtering (independent)
OTEL_FILTER_DATABASE_SPANS=true       # set false to KEEP DB spans (asyncpg DB observability)
OTEL_FILTER_HEALTH_CHECK_SPANS=true   # drop health-check spans, independent of DB filtering
OTEL_FILTER_EMPTY_QUEUE_POLLS=true    # drop SQS ReceiveMessage spans that succeeded and returned nothing
                                      # (failed polls and polls that returned work are always kept)
OTEL_FILTER_UNATTRIBUTED_ROOT_PROBE=true  # drop the `HEAD /` probe (17% of prod server spans).
                                      # NOT a health check - separate flag on purpose

# LLM/agent content redaction (on by default, fails closed)
OTEL_REDACT_SPAN_CONTENT=true
OTEL_REDACT_SPAN_ATTRIBUTES=          # extra content attribute keys, comma-separated

# Local inspection: dump spans to NDJSON; enables file-only mode with no OTLP endpoint
OTEL_SPAN_FILE_EXPORT=                # e.g. /tmp/spans.ndjson

service.version

Prefer the parameter over the env var when the value comes from application code:

setup_observability(service_name="my-service", version=settings.APP_VERSION)

ObservabilityConfig reads OTEL_SERVICE_VERSION from the environment once, at import time. So os.environ["OTEL_SERVICE_VERSION"] = ... in your startup path is silently ignored whenever this package was imported earlier in the process — which, in a Django app, it usually was. The parameter assigns the class attribute that resource_attributes() reads at provider-build time, exactly as service_name= already does.

The default is "unset", not a version-shaped placeholder. A default like 1.0.0 is indistinguishable from a genuinely versioned service, so service.version looks populated while telling you nothing — which is how the Varicon monolith ran unversioned across every tier unnoticed (VDP-1656). If you see unset in Honeycomb, that service is not passing a build id.

An empty or whitespace-only OTEL_SERVICE_VERSION also falls back to "unset" rather than shipping blank, since --build-arg FOO=""-style plumbing sets the variable without giving it a value.

See EXAMPLES.md for instrument_sqlalchemy(), content redaction, and local span inspection.

What Gets Captured

  • All Python logging (logging.getLogger(), IntegrationLogger(), etc.)
  • Framework logs (Django, FastAPI, Uvicorn, Celery)
  • HTTP requests (requests, httpx)
  • Database queries (PostgreSQL via psycopg2; SQLAlchemy + asyncpg via instrument_sqlalchemy())
  • Redis operations
  • Custom traces and metrics

Custom Metrics

Create custom metrics for Signoz using get_meter() or the built-in helpers:

from varicon_observability import setup_observability, get_meter, get_request_counter

setup_observability(service_name="my-service")

# Option 1: Use get_meter() for full control
meter = get_meter()
my_counter = meter.create_counter("custom.events", unit="1", description="Custom events")
my_counter.add(1, {"event_type": "signup"})

# Option 2: Use built-in helpers
request_counter = get_request_counter()
request_counter.add(1, {"endpoint": "/api/users"})

Note: SQLAlchemy logs are disabled by default (set ENABLE_SQLALCHEMY_LOGS=true to enable)

Architecture

Application Code
    ↓
Python Logging (any pattern)
    ↓
Root Logger Handler
    ↓
OpenTelemetry LoggingHandler
    ↓
OTLP Exporter
    ↓
SigNoz

All logs automatically include trace context for correlation.

Metadata

Release files for varicon-observability 1.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for varicon-observability 1.9.1
File Size Uploaded Provenance Actions
varicon_observability-1.9.1.tar.gz 204.4 kB Without provenance Details for varicon_observability-1.9.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for varicon-observability 1.9.1
File Interpreter ABI Platform Actions
varicon_observability-1.9.1-py3-none-any.whl Python 3 none any Details for varicon_observability-1.9.1-py3-none-any.whl

Total release size: 326.8 kB

Release files / varicon_observability-1.9.1.tar.gz

Download URL varicon_observability-1.9.1.tar.gz
Size 204.4 kB
Tags Source
SHA-256 checksum
How to use checksums
16f62069cc6e6280805894d034cbf0cf482275e78bd92ff25220db0df85948e9
BLAKE2b-256 checksum
How to use checksums
56c0c0bd510ce6a2a03286445be31dfc01f3c1f9e85f70b46eaadd910a85eccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / varicon_observability-1.9.1-py3-none-any.whl

Download URL varicon_observability-1.9.1-py3-none-any.whl
Size 122.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6829c67c8174f5f2a908cb2250503fa5cd33de2e08d2f541e2d67217f1ba85d2
BLAKE2b-256 checksum
How to use checksums
2b223fe74b362bc6e6e79d2f2f5fb127cc31a827a57ae1a153e6b963fc487567
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for varicon-observability 1.9.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.9.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page