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.1.tar.gz (14.8 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.1-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lognerve_py-0.1.1.tar.gz
  • Upload date:
  • Size: 14.8 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.1.tar.gz
Algorithm Hash digest
SHA256 e4d3c8e61f4bee65d8087dfeb2d66ea820a4433c34f4e4bd9d6a7d11c333a67c
MD5 a7b1450018f25ce551a084f88b5d8bcd
BLAKE2b-256 0c3299a103ec6eb1882215638620771a908c655d3c733c882dda0942f40cf643

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lognerve_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 616e75c0f3a9fe327d99e70c123b2e800d1f24aeb997ec2f3658aed92ab73e3d
MD5 a87ca3dbd4a85ad23addebcb6d017b0c
BLAKE2b-256 fb65bcb50f1a4cb5e8c1bbc5fdd5757d8e56fc696f96f28e2ac019d19f5fb734

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