Add a destination
- Open Project Settings → Drains, choose Add drain → Logs.
- Use Custom endpoint, enter a name, and enter a public HTTPS destination URL.
- Choose JSON or NDJSON encoding. A signing secret is generated for the new drain; copy it to your receiver. You can replace it with a secret of 16–256 characters, regenerate it, or clear it for unsigned delivery.
- Optionally enable Custom headers and add names and values.
- Choose Add drain to save.
Sample forwarded records
Open Trace sampling to add up to 20 rules. Each rule sets a percentage from 0 to 100 and optionally matches a log type, event kind, or supported identifier and value. Rules run in their displayed order; the first matching rule applies. Records without a matching rule are forwarded at 100%. Sampling groups records by request ID or event ID when one exists. Repeated records with the same identity receive the same deterministic sampling decision for a given rate. A webhook’s delivery updates share its event identity. This control samples operational records sent to drains; it does not change stored logs, Settings audit history, or message retention.Receive deliveries
With JSON, your endpoint receives an HTTPS POST withContent-Type: application/json.
The envelope contains a stable delivery ID and one operational record:
application/x-ndjson. Each line contains
one envelope with version, deliveryId and a single record object. A delivery
contains one line and ends with a newline; line breaks inside strings remain
escaped. Logs and analytics both support this encoding.
requestId and traceId. traceId is the request’s W3C trace ID; when the request sent a
valid traceparent header, it is the caller’s trace ID. Use it to join forwarded logs to your own traces.
Use the Idempotency-Key header, which matches deliveryId, to deduplicate
retries. A 2xx response completes a delivery. Other responses and connection
failures retry after one minute, five minutes, 15 minutes, one hour, and six
hours, for at most six attempts and no later than 24 hours after the record
was queued. Delivery is at least once: acknowledge only after your endpoint
has durably accepted the record. Retained delivery diagnostics expire after
seven days.
Verify signatures
Every request includesX-Polymorfa-Timestamp in Unix seconds. With a signing
secret configured, X-Polymorfa-Signature contains sha256= followed by an HMAC-SHA256
hex digest. For NDJSON, include the trailing newline. Compute the HMAC using your signing secret over these exact bytes: