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

# 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

varicon_observability-1.8.1.tar.gz (161.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

varicon_observability-1.8.1-py3-none-any.whl (103.6 kB view details)

Uploaded Python 3

File details

Details for the file varicon_observability-1.8.1.tar.gz.

File metadata

  • Download URL: varicon_observability-1.8.1.tar.gz
  • Upload date:
  • Size: 161.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for varicon_observability-1.8.1.tar.gz
Algorithm Hash digest
SHA256 33a928315d2f2e464157eb5020a17770b731c7acac2b2d1762c1771f9d3765e4
MD5 93607af8f262ee7d24d9ec14abf04058
BLAKE2b-256 3928b820e424935232c2a9da83278d471ef2e74ff1ae87be89d6b8c2d357f642

See more details on using hashes here.

File details

Details for the file varicon_observability-1.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for varicon_observability-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 10c72f205aec8e498d98598f4162bb9f45e94529d0283fbdf370bf1ed6eb10cf
MD5 c0350b2b818caba45d67284d0a2fc9a1
BLAKE2b-256 57414be2cbd2d5e7e69cb07b4b6d11900d2b2c46187c55ee11d01bb2640922dd

See more details on using hashes here.

Release history Release notifications | RSS feed

1.9.0

2 files

This release

1.8.1 This release

2 files

1.7.0

2 files

1.6.2

2 files

1.5.0

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 files

1.2.23

2 files

1.2.22

2 files

1.2.21

2 files

1.2.20

2 files

1.2.19

2 files

1.2.18

2 files

1.2.17

2 files

1.2.16

2 files

1.2.15

2 files

1.2.14

2 files

1.2.13

2 files

1.2.12

2 files

1.2.11

2 files

1.2.10

2 files

1.2.9

2 files

1.2.8

2 files

1.2.7

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.42

2 files

1.0.41

2 files

1.0.40

2 files

1.0.39

2 files

1.0.38

2 files

1.0.37

2 files

1.0.36

2 files

1.0.35

2 files

1.0.34

2 files

1.0.33

2 files

1.0.32

2 files

1.0.31

2 files

1.0.30

2 files

1.0.29

2 files

1.0.28

2 files

1.0.27

2 files

1.0.26

2 files

1.0.25

2 files

1.0.24

2 files

1.0.23

2 files

1.0.22

2 files

1.0.21

2 files

1.0.20

2 files

1.0.19

2 files

1.0.18

2 files

1.0.17

2 files

1.0.16

2 files

1.0.15

2 files

1.0.14

2 files

1.0.13

2 files

1.0.12

2 files

1.0.11

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

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