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_p3zI8Nnk3VkD-P0rBfjSTeWd4XCA6l-IrEmI3rWyFTI",
    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.0.tar.gz (13.6 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.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lognerve_py-0.1.0.tar.gz
  • Upload date:
  • Size: 13.6 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.0.tar.gz
Algorithm Hash digest
SHA256 ab1c817acd2b49852552ff2dc4555d9e3d6201b9b510929b790dd07547242e80
MD5 0155d98b9fb9a32115bada51681895c0
BLAKE2b-256 ed04cb8016481704bfbab8cda530ce9dd9eb78c8cb0e3dd10f876314f38e24f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lognerve_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0a3c20e67d580417d82b69146914831a0ffbaf8290937a0b6ba37faef7967f2
MD5 4db15a650e2466e06afbaac1e8c2056f
BLAKE2b-256 bd2fe430dab30ca4c17363bb972af38fe517d664f1dc4aad1dae87e7b5ca934f

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