Skip to main content

Production observability via OTLP export to Plain Cloud.

Project description

plain.cloud

Production observability via OTLP export to Plain Cloud.

Overview

You can use plain.cloud to export traces and metrics from your Plain app to Plain Cloud. The framework already instruments itself with OpenTelemetry spans and histograms — plain.cloud activates them by providing the OTLP exporters.

Set one environment variable and your app starts pushing telemetry:

PLAIN_CLOUD_EXPORT_TOKEN=your-token

If CLOUD_EXPORT_TOKEN is not set, the package is a no-op — safe to install without configuration.

Settings

Setting Default Description
CLOUD_EXPORT_URL "https://ingest.plainframework.com" OTLP ingest endpoint (override to use a custom endpoint)
CLOUD_EXPORT_TOKEN "" Auth token for the export endpoint
CLOUD_TRACE_SAMPLE_RATE 1.0 Probability of exporting a trace (0.0–1.0)

All settings can be set via PLAIN_-prefixed environment variables or in app/settings.py.

Sampling

By default, all traces are exported. To reduce volume, set a sample rate:

CLOUD_TRACE_SAMPLE_RATE = 0.1  # Export 10% of traces

Metrics are not affected by sampling — histograms aggregate in-process and export periodically regardless of the trace sample rate.

What gets exported

Traces — HTTP request spans and database query spans instrumented by the framework.

Metrics — OTel histograms like db.client.query.duration, aggregated and pushed every 60 seconds.

Observer coexistence

If plain.observer is also installed, both work simultaneously. plain.cloud handles production export while observer provides the local dev toolbar and admin trace viewer. Observer detects the existing TracerProvider and layers its sampler and span processor on top.

FAQs

Do I need plain.observer to use plain.cloud?

No. plain.cloud works independently. Observer is for local dev tooling; plain.cloud is for production export.

What happens if the export endpoint is unreachable?

The OTLP exporters batch and retry automatically. If the endpoint is down, telemetry is dropped after retries — it does not block your application.

Does this add latency to requests?

No. Trace spans are exported in a background thread via BatchSpanProcessor. Metrics are flushed periodically by a background thread. Neither blocks request handling.

Installation

# app/settings.py
INSTALLED_PACKAGES = [
    "plain.cloud",
    # ...
]

Place plain.cloud before plain.observer in INSTALLED_PACKAGES so it sets up the TracerProvider first.

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

plain_cloud-0.2.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

plain_cloud-0.2.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file plain_cloud-0.2.0.tar.gz.

File metadata

  • Download URL: plain_cloud-0.2.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for plain_cloud-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3754e5de3bdf257a16571fab1b8f844da9c8ed672c530bd63378ac5d01f48647
MD5 42d75e2af25f8b2cf4c9d49bd2a9ed2f
BLAKE2b-256 3989b0d7b7d7b0aa550badba8ef0432c723b314bba2d307cd8599a838d8d6808

See more details on using hashes here.

File details

Details for the file plain_cloud-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: plain_cloud-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for plain_cloud-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52e95d7c91dade2b5f299d30602f3f958e6b81270ae25c4541eb148ca0510f1d
MD5 6e51ed6c11a9736d918a92b1783d4d00
BLAKE2b-256 f4d9f6c0c583e95e17e0d3d28976918f894d10ea65918bc89bd147ce8fb498f2

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