Metadata-Version: 2.5
Name: weharness-tracing
Version: 0.1.1
Summary: Send your AI agent's traces to WeHarness (OpenTelemetry; metadata only unless you choose otherwise).
License-Expression: Apache-2.0
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: opentelemetry-api==1.45.1
Requires-Dist: opentelemetry-exporter-otlp-proto-http==1.45.1
Requires-Dist: opentelemetry-sdk==1.45.1
Description-Content-Type: text/markdown

# WeHarness tracing for Python

Send agent, model and tool spans to WeHarness using OpenTelemetry and OTLP/HTTP.
Requires Python 3.10 or newer and a project ingest key from the WeHarness Tracing page.

```python
import weharness_tracing as wh

# Set WEHARNESS_INGEST_KEY in your server environment, never in browser code.
wh.init(service="my-agent")
with wh.agent_run("support"):
    with wh.tool_call("lookup_order"):
        pass  # Call your tool here.
wh.shutdown()
```

The default endpoint is `https://api.weharness.io/otlp/v1/traces`.
Override it with `WEHARNESS_OTLP_ENDPOINT` if needed. Set `WEHARNESS_REVISION`
to correlate traces with a source revision.

Known prompt, output, tool-payload and stacktrace attributes are filtered by default.
This filter is not a general secret detector: do not put secrets or personal data in
span names, error messages or custom metadata. Content capture requires explicit
configuration and appropriate project settings. An ingest key sends traces; it does
not authorize reading them.

An existing OpenTelemetry tracer provider is reused. Background batches are bounded;
call `shutdown()` to flush pending spans before the process exits.
