Skip to main content

Python SDK for tracing LLM and agent applications with LogNerve

Project description

LogNerve Python SDK

Small Python SDK for tracing agentic and LLM applications with LogNerve.

pip install lognerve-py
import lognerve

lognerve.initialize(
    api_key="lnv_sk_example",
    domain="api.lognerve.ai",
    project_name="agent-examples",
    service_name="vanilla-tool-loop",
    exporter="otlp-http",
    redact_pii=True,
)

@lognerve.observe(name="workflow", type="agent")
def run_workflow(goal: str) -> str:
    return "done"

run_workflow("test tracing")

The root package intentionally exposes only lognerve.initialize, lognerve.observe, and lognerve.usingAttributes.

When neither otlp_endpoint nor domain is set, the SDK defaults to https://lognerve.ai/api/v1/traces. Use domain to customize (e.g. https://eu.lognerve.ai/api/v1/traces). Explicit otlp_endpoint always takes precedence.

Set LOGNERVE_REDACT_PII=true or pass redact_pii=True to redact common PII locally before span export. Default local redaction covers emails, phone numbers, credit cards, SSNs, IPv4 addresses, API keys, and bearer tokens. You can customize it with redact_pii={"entities": ["email", "api_key"], "patterns": [{"pattern": "customer-[0-9]+"}]}.

SOC 2, encryption at rest, server-side intelligent PII detection, and on-prem alerting are backend/product controls. The SDK control implemented here is local regex redaction before export.

When api_key or LOGNERVE_API_KEY is set, OTLP requests include Authorization: Bearer <api_key>. Explicit otlp_headers={"Authorization": ...} or LOGNERVE_OTLP_HEADERS overrides the generated header.

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

lognerve_py-0.1.2.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

lognerve_py-0.1.2-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lognerve_py-0.1.2.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for lognerve_py-0.1.2.tar.gz
Algorithm Hash digest
SHA256 febad41492756aeb571b3122f3cf5cd7a722e9a889742af86784a70bbad49603
MD5 d1bd5481582a8ed821f2b9a635785d70
BLAKE2b-256 ff749b4bbc581bbfe799fe1e9a4f1449333550af11c7d4db5c36179b6880189e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lognerve_py-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for lognerve_py-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 27f24c379a65e7cda1b9cddf99ea3f0e3ad360509c4186f43d2ad04b620f3410
MD5 788f10508a0dbd8e11992a5ca28c439d
BLAKE2b-256 f97dde21ba14089f58c2cf10d4ab172c26909ee35f7c9dba6f08099e65e6af61

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