Skip to main content

S3-native OpenTelemetry compatible observability layer

Project description

Depths

Everything you need to build your observability stack — unified, OTel-compatible, S3-native telemetry. Built by Depths AI.

Depths collects traces, logs, and metrics over OTLP HTTP, writes them into Delta Lake tables by UTC day, and can ship sealed days to S3. You also get minute-wise stats snapshots, a real-time stream, a tiny query API, and a clean Python surface for ingest and reads.

Docs live at https://docs.depthsai.com.


Why Depths

  • OTel first – accept standard OTLP JSON today, add protobuf by installing an extra
  • Delta Lake by default – predictable schema across six OTel tables
  • S3 native – seal a past UTC day, upload, verify rowcounts, then clean local state
  • Polars inside – fast typed DataFrames and LazyFrames for compact reads
  • Real-time + rollups – in-memory tail (SSE) and minute-wise stats in a local Delta
  • Simple to startdepths init then depths start

Install

# core (JSON ingest)
pip install depths

# optional protobuf ingest (OTLP x-protobuf)
pip install "depths[proto]"

Quick start

1) Initialize an instance

depths init

This lays out ./depths_data/default with configs, index, day staging, and a local stats area (created on first use).

2) Start the OTLP HTTP server

# foreground
depths start -F

# or background
depths start

By default the service listens on 0.0.0.0:4318 and picks up the default instance.

You can customize:

depths start -F -I default -H 0.0.0.0 -P 4318

The server exposes:

  • OTLP ingest: POST /v1/traces, POST /v1/logs, POST /v1/metrics

  • Health: GET /healthz

  • Reads:

    • Raw: GET /api/spans, GET /api/logs, GET /api/metrics/points, GET /api/metrics/hist
    • Derived (minute rollups): GET /api/stats/minute
    • Real-time: GET /rt/{signal} where {signal} is traces | logs | metrics

3) Point your SDK or Collector

Most OTLP HTTP exporters default to port 4318. Example cURL for JSON:

curl -X POST http://localhost:4318/v1/logs \
  -H 'content-type: application/json' \
  -d '{"resourceLogs":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"demo"}}]},"scopeLogs":[{"scope":{},"logRecords":[{"timeUnixNano":"1710000000000000000","body":{"stringValue":"hello depths"}}]}]}]}'

If you installed the protobuf extra, you can send application/x-protobuf too.


Reading your data

Depths writes one Delta table per OTel family under a day root:

<instance_root>/staging/days/<YYYY-MM-DD>/otel/
  spans/
  span_events/
  span_links/
  logs/
  metrics_points/
  metrics_hist/

Minute-wise stats (derived store)

A background worker maintains per-minute snapshots and appends to:

<instance_root>/stats/otel_minute/
  └── _delta_log, data files partitioned by project_id / event_date

Query over HTTP:

# latest minute snapshots for a service
curl 'http://localhost:4318/api/stats/minute?project_id=demo&service_name=api&limit=200'

or read lazily in Python:

from depths.core.logger import DepthsLogger

lg = DepthsLogger(instance_id="default", instance_dir="./depths_data")
lf = lg.stats_minute_lazy(project_id="demo", latest_only=True)
print(lf.collect().head(5))

Real-time stream (SSE)

Peek at the newest telemetry as it arrives (before persistence). This is a best-effort tail; some items may never persist.

# logs stream
curl -N 'http://localhost:4318/rt/logs?n=100&heartbeat_s=10'

Quick reads over HTTP (raw tables)

Each endpoint accepts useful filters and returns JSON rows.

# last 100 logs with severity >= 9 that contain "error"
curl 'http://localhost:4318/api/logs?severity_ge=9&body_like=error&max_rows=100'
# metric points for a gauge/sum instrument
curl 'http://localhost:4318/api/metrics/points?project_id=demo&instrument_name=req_latency_ms&max_rows=100'

Programmatic reads in Python

from depths.core.logger import DepthsLogger

logger = DepthsLogger(instance_id="default", instance_dir="./depths_data")
rows = logger.read_logs(body_like="timeout", max_rows=50)
print(rows[:3])

You can also read spans, metric points, metric histograms, the minute rollups, and the real-time tail.


Identity context (opt-in)

Depths can enrich rows with session and user identity, following current OpenTelemetry attribute conventions. It’s off by default.

Enable via options (Python) or by editing the instance options JSON:

from depths.core.logger import DepthsLogger, DepthsLoggerOptions

opts = DepthsLoggerOptions(
    add_session_context=True,
    add_user_context=True,
)

lg = DepthsLogger(instance_id="default", instance_dir="./depths_data", options=opts)

When enabled, Depths reads these keys from event attributes first (then resource attributes):

  • session.idsession_id
  • session.previous_idsession_previous_id
  • user.iduser_id
  • user.nameuser_name
  • user.roles (list of strings) → user_roles_json (JSON-encoded)

No legacy fallbacks are supported; when disabled, the columns remain empty.


S3 shipping

Turn on shipping and the background worker will seal completed days and upload them to S3, then verify remote rowcounts and clean the local day on a match.

S3 is configured from environment variables. See the docs for the full list and examples. A typical flow is:

  1. Run with S3 configured in the environment
  2. Depths rolls over at UTC midnight and enqueues yesterday for shipping
  3. Shipper seals each Delta table, uploads, verifies, and cleans the local day

Configuration

  • Instance identity and data dir come from DEPTHS_INSTANCE_ID and DEPTHS_INSTANCE_DIR (the CLI sets these).
  • S3 configuration is read from environment variables.
  • Runtime knobs (queues, flush triggers, shipper timeouts, stats cadence, real-time caps) live in the options object (DepthsLoggerOptions). Identity context is opt-in via add_session_context / add_user_context.

See https://docs.depthsai.com for the complete reference and examples.


Development notes

  • Package import is depths and can be installed with the protobuf extra using depths[proto].
  • The service lives at depths.cli.app:app for uvicorn.
  • CLI commands are available as depths init, depths start, and depths stop.

Status

Version v0.1.2. Still early, now with minute rollups, a real-time stream to view telemetry signals immediately as they get ingested, and optional identity context. If you try it, tell us what worked and what didn’t. The docs are the best place to start: https://docs.depthsai.com.

Project details


Download files

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

Source Distribution

depths-0.1.2.tar.gz (94.2 kB view details)

Uploaded Source

Built Distribution

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

depths-0.1.2-py3-none-any.whl (104.0 kB view details)

Uploaded Python 3

File details

Details for the file depths-0.1.2.tar.gz.

File metadata

  • Download URL: depths-0.1.2.tar.gz
  • Upload date:
  • Size: 94.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for depths-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3bae9abda44a5aa5f5ced71ef87cc7a78bfa0288f4497b77b7803c6646e5c73c
MD5 04b8557e05343515f72bd39bf11d19ee
BLAKE2b-256 ed01184d643210438f41eaa97025ce0aab3d2885e4848fcf8e6b8cff904451ea

See more details on using hashes here.

File details

Details for the file depths-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: depths-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 104.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for depths-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a3747ce8e322db4f4ad88adf10003821ca63e90eed702e0eb0b3dd9f156de9c
MD5 e5fb259bfe2ef3f35a2b3e7ccd63dc50
BLAKE2b-256 0ee6150f42dfa672380a59044e915f99fed2d83a4573dbec038292f5272d1431

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page