Environment variables
The WeHarness SDKs
Section titled “The WeHarness SDKs”Both SDKs read the same variables. A value passed to init() wins over the variable.
| Variable | What it is | Default |
|---|---|---|
WEHARNESS_INGEST_KEY |
The ingest key (whk_…). Required unless you pass key. |
— |
OTEL_SERVICE_NAME |
The service name, when service is not passed |
unknown_service |
WEHARNESS_OTLP_ENDPOINT |
Where spans are sent | https://api.weharness.io/otlp/v1/traces |
WEHARNESS_REVISION |
The commit your application runs | See below |
The code version
Section titled “The code version”When revision is not passed, the SDKs take the first of these that is set:
WEHARNESS_REVISIONGITHUB_SHA(GitHub Actions)CI_COMMIT_SHA(GitLab CI)VERCEL_GIT_COMMIT_SHA(Vercel)RENDER_GIT_COMMIT(Render)SOURCE_VERSION(Heroku and others)GIT_COMMIT(Jenkins and others)
It becomes the resource attribute vcs.ref.head.revision. Without any of them, the code version is unknown.
Plain OpenTelemetry
Section titled “Plain OpenTelemetry”| Variable | Value |
|---|---|
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT |
https://api.weharness.io/otlp/v1/traces |
OTEL_EXPORTER_OTLP_TRACES_HEADERS |
Authorization=Bearer%20whk_… (the space is written %20) |
OTEL_SERVICE_NAME |
Your service’s name |
OTEL_RESOURCE_ATTRIBUTES |
Optional, for example vcs.ref.head.revision=<commit sha>,service.version=1.4.0 |
Inside a WeHarness sandbox
Section titled “Inside a WeHarness sandbox”When WeHarness runs your code in a session’s sandbox, an evaluation run or a preview, it sets variables for it:
| Variable | Set for | What it is |
|---|---|---|
WEHARNESS_EVAL_INPUT |
Evaluation runs | The path of the file holding the case’s input. See Evaluations. |
| The OTLP endpoint and a key | Evaluation runs | Your agent’s traces from the case go to a key that exists only for the run, so tool and error checks can read them |
| Model provider variables | Every sandbox | The variables the providers’ official SDKs read, pointing at models.weharness.io with a token that works only for that sandbox. See Cloud work. |
The sandbox never receives a WeHarness key or your own model key.