Trace export destinations
The calling key's environment's recorded requests sent, as OpenTelemetry spans over OTLP/HTTP (JSON), to your own observability tools (Langfuse, Datadog, Honeycomb, Grafana, an OpenTelemetry Collector).
Metadata only: model, tokens, cost, timing, outcome and who; never a prompt or a response.
| Operation | Method | SDK |
|---|---|---|
| List trace export destinations | GET | hixel.traceExportDestinations.list |
| Create a trace export destination | POST | hixel.traceExportDestinations.create |
| Get a trace export destination | GET | hixel.traceExportDestinations.get |
| Update a trace export destination | PATCH | hixel.traceExportDestinations.update |
| Delete a trace export destination | DELETE | hixel.traceExportDestinations.delete |
| Send a test span | POST | hixel.traceExportDestinations.test |
List trace export destinations#
A page of the environment's trace export destinations (at most 3 in all), oldest first.
Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
cursor | query | string | The next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it. |
limit | query | integer | How many items the page holds: an integer from 1 to 100; 50 when left out. |
Response 200: TraceExportDestinationList
| Field | Type | Description |
|---|---|---|
data required | array of TraceExportDestination | |
data[].id required | string | The id of a trace export destination (tex_…). |
data[].organization_id required | string | The id of your organization (org_…). |
data[].project_id required | string | The id of a project (proj_…). |
data[].environment_id required | string | The id of an environment (env_…). |
data[].url required | string | The OTLP/HTTP traces endpoint, in full (https://…/v1/traces); nothing is appended. |
data[].label required | string | null | A name of yours; null for none. |
data[].headers required | array of object | |
data[].headers[].name required | string | The header's name, lowercase. |
data[].headers[].value_last_four required | string | null | The value's last four characters, for a value of 16 characters or more; else null. |
data[].enabled required | boolean | Whether spans are sent to it. |
data[].disabled_reason required | "manual" | "failing" | null | failing when the platform disabled it after failing continuously; null while enabled. |
data[].disabled_at required | string | null | When it was disabled; null while enabled. |
data[].failing_since required | string | null | The first failed export since the last success; null while it succeeds. |
data[].consecutive_failures required | integer | Exports failed in a row since the last success. |
data[].retry_at required | string | null | When the next export is due after a failure; null when none waits. |
data[].last_succeeded_at required | string | null | |
data[].last_failed_at required | string | null | |
data[].last_error required | "timeout" | "network" | "redirect" | "http_status" | "internal" | string | null | Why the last failed export failed: timeout, network, redirect, http_status, or internal (a fault on the platform's side, not counted against the destination). |
data[].last_response_status required | integer | null | The HTTP status of the last failed export's answer; null when none came. |
data[].last_response_body required | string | null | The start of the last failed (or partly rejected) export's answer: at most 512 characters. |
data[].pending_spans required | string | Spans waiting to be sent. |
data[].exported_spans required | string | Spans the destination accepted. |
data[].rejected_spans required | string | Spans the destination answered as rejected in a partial success. |
data[].failed_spans required | string | Spans in a batch the destination refused for good (a 4xx that is not retried). |
data[].dropped_spans required | string | Spans dropped unsent after the retention (72 hours). |
data[].created_at required | string (date-time) | |
data[].updated_at required | string (date-time) | |
next_cursor required | string | null | Pass back as cursor for the next page; null on the last page. |
Errors
- 400
invalid_request: The request is malformed or fails validation;paramnames the field.invalid_cursor: The cursor is not one this list gave.environment_required: a project key was sent withoutx-hixel-environment.invalid_query: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the key was revoked or expired while the request ran, or an environment's key lost themanagementscope.management_scope_required: the environment's key does not have themanagementscope.
- 404
environment_not_found:x-hixel-environmentnames an environment outside the project key's project, an archived one, or another than the environment key's own. - 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/trace_export_destinations" \
-H "Authorization: Bearer $HIXEL_API_KEY"for await (const item of hixel.traceExportDestinations.list()) {
console.log(item);
}Create a trace export destination#
Adds a destination the environment's recorded requests are exported to, at most 3. Header values are secrets: stored encrypted, never shown again.
Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.
Request body: CreateTraceExportDestinationBody
| Field | Type | Description |
|---|---|---|
url required | string | The full OTLP/HTTP traces URL, such as https://…/v1/traces: https:// on a public host name; nothing is appended. |
label | string | |
headers | array of object | At most 8, each name once; values are secrets, never shown again. |
headers[].name required | string | |
headers[].value required | string |
Response 200: TraceExportDestination
| Field | Type | Description |
|---|---|---|
id required | string | The id of a trace export destination (tex_…). |
organization_id required | string | The id of your organization (org_…). |
project_id required | string | The id of a project (proj_…). |
environment_id required | string | The id of an environment (env_…). |
url required | string | The OTLP/HTTP traces endpoint, in full (https://…/v1/traces); nothing is appended. |
label required | string | null | A name of yours; null for none. |
headers required | array of object | |
headers[].name required | string | The header's name, lowercase. |
headers[].value_last_four required | string | null | The value's last four characters, for a value of 16 characters or more; else null. |
enabled required | boolean | Whether spans are sent to it. |
disabled_reason required | "manual" | "failing" | null | failing when the platform disabled it after failing continuously; null while enabled. |
disabled_at required | string | null | When it was disabled; null while enabled. |
failing_since required | string | null | The first failed export since the last success; null while it succeeds. |
consecutive_failures required | integer | Exports failed in a row since the last success. |
retry_at required | string | null | When the next export is due after a failure; null when none waits. |
last_succeeded_at required | string | null | |
last_failed_at required | string | null | |
last_error required | "timeout" | "network" | "redirect" | "http_status" | "internal" | string | null | Why the last failed export failed: timeout, network, redirect, http_status, or internal (a fault on the platform's side, not counted against the destination). |
last_response_status required | integer | null | The HTTP status of the last failed export's answer; null when none came. |
last_response_body required | string | null | The start of the last failed (or partly rejected) export's answer: at most 512 characters. |
pending_spans required | string | Spans waiting to be sent. |
exported_spans required | string | Spans the destination accepted. |
rejected_spans required | string | Spans the destination answered as rejected in a partial success. |
failed_spans required | string | Spans in a batch the destination refused for good (a 4xx that is not retried). |
dropped_spans required | string | Spans dropped unsent after the retention (72 hours). |
created_at required | string (date-time) | |
updated_at required | string (date-time) |
Errors
- 400
invalid_parameter,invalid_url,invalid_header: The request is malformed or fails validation;paramnames the field.invalid_idempotency_key: anIdempotency-Keyis 1 to 255 characters of visible ASCII.environment_required: a project key was sent withoutx-hixel-environment.invalid_payload,malformed_body,body_too_large: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the key was revoked or expired while the request ran, or an environment's key lost themanagementscope.management_scope_required: the environment's key does not have themanagementscope.role_not_allowed: the project key'smemberrole does not allow this; it takesadmin.
- 404
environment_not_found:x-hixel-environmentnames an environment outside the project key's project, an archived one, or another than the environment key's own. - 409
project_archived: This project is archived.environment_archived: This environment is archived.trace_export_destination_limit_reached: This environment has the most trace export destinations it may have (3). Delete one first.idempotency_key_reused,idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
- 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X POST "https://api.hixel.dev/v1/trace_export_destinations" \
-H "Authorization: Bearer $HIXEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://app.example.com/webhooks/gateway"
}'const traceExportDestination = await hixel.traceExportDestinations.create({
url: "https://app.example.com/webhooks/gateway",
});Get a trace export destination#
The destination, with its headers' names but never their values.
Takes an environment key with the management scope, or a project key with the member role or higher, naming the environment in x-hixel-environment.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The destination's id (tex_…). |
Response 200: TraceExportDestination
| Field | Type | Description |
|---|---|---|
id required | string | The id of a trace export destination (tex_…). |
organization_id required | string | The id of your organization (org_…). |
project_id required | string | The id of a project (proj_…). |
environment_id required | string | The id of an environment (env_…). |
url required | string | The OTLP/HTTP traces endpoint, in full (https://…/v1/traces); nothing is appended. |
label required | string | null | A name of yours; null for none. |
headers required | array of object | |
headers[].name required | string | The header's name, lowercase. |
headers[].value_last_four required | string | null | The value's last four characters, for a value of 16 characters or more; else null. |
enabled required | boolean | Whether spans are sent to it. |
disabled_reason required | "manual" | "failing" | null | failing when the platform disabled it after failing continuously; null while enabled. |
disabled_at required | string | null | When it was disabled; null while enabled. |
failing_since required | string | null | The first failed export since the last success; null while it succeeds. |
consecutive_failures required | integer | Exports failed in a row since the last success. |
retry_at required | string | null | When the next export is due after a failure; null when none waits. |
last_succeeded_at required | string | null | |
last_failed_at required | string | null | |
last_error required | "timeout" | "network" | "redirect" | "http_status" | "internal" | string | null | Why the last failed export failed: timeout, network, redirect, http_status, or internal (a fault on the platform's side, not counted against the destination). |
last_response_status required | integer | null | The HTTP status of the last failed export's answer; null when none came. |
last_response_body required | string | null | The start of the last failed (or partly rejected) export's answer: at most 512 characters. |
pending_spans required | string | Spans waiting to be sent. |
exported_spans required | string | Spans the destination accepted. |
rejected_spans required | string | Spans the destination answered as rejected in a partial success. |
failed_spans required | string | Spans in a batch the destination refused for good (a 4xx that is not retried). |
dropped_spans required | string | Spans dropped unsent after the retention (72 hours). |
created_at required | string (date-time) | |
updated_at required | string (date-time) |
Errors
- 400
invalid_request: The request is malformed or fails validation;paramnames the field.environment_required: a project key was sent withoutx-hixel-environment.invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the key was revoked or expired while the request ran, or an environment's key lost themanagementscope.management_scope_required: the environment's key does not have themanagementscope.
- 404
trace_export_destination_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.environment_not_found:x-hixel-environmentnames an environment outside the project key's project, an archived one, or another than the environment key's own.
- 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.
curl "https://api.hixel.dev/v1/trace_export_destinations/tex_123" \
-H "Authorization: Bearer $HIXEL_API_KEY"const traceExportDestination = await hixel.traceExportDestinations.get("tex_123");Update a trace export destination#
Changes the fields given; headers replaces them all. A header's value is never sent to a URL it was not given for, so changing the URL of a destination with headers needs them again.
Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The destination's id (tex_…). |
Request body: UpdateTraceExportDestinationBody
| Field | Type | Description |
|---|---|---|
url | string | |
label | string | null | |
headers | array of object | |
headers[].name required | string | |
headers[].value required | string | |
enabled | boolean | false disables it; true enables it again and clears its failures. |
Response 200: TraceExportDestination
| Field | Type | Description |
|---|---|---|
id required | string | The id of a trace export destination (tex_…). |
organization_id required | string | The id of your organization (org_…). |
project_id required | string | The id of a project (proj_…). |
environment_id required | string | The id of an environment (env_…). |
url required | string | The OTLP/HTTP traces endpoint, in full (https://…/v1/traces); nothing is appended. |
label required | string | null | A name of yours; null for none. |
headers required | array of object | |
headers[].name required | string | The header's name, lowercase. |
headers[].value_last_four required | string | null | The value's last four characters, for a value of 16 characters or more; else null. |
enabled required | boolean | Whether spans are sent to it. |
disabled_reason required | "manual" | "failing" | null | failing when the platform disabled it after failing continuously; null while enabled. |
disabled_at required | string | null | When it was disabled; null while enabled. |
failing_since required | string | null | The first failed export since the last success; null while it succeeds. |
consecutive_failures required | integer | Exports failed in a row since the last success. |
retry_at required | string | null | When the next export is due after a failure; null when none waits. |
last_succeeded_at required | string | null | |
last_failed_at required | string | null | |
last_error required | "timeout" | "network" | "redirect" | "http_status" | "internal" | string | null | Why the last failed export failed: timeout, network, redirect, http_status, or internal (a fault on the platform's side, not counted against the destination). |
last_response_status required | integer | null | The HTTP status of the last failed export's answer; null when none came. |
last_response_body required | string | null | The start of the last failed (or partly rejected) export's answer: at most 512 characters. |
pending_spans required | string | Spans waiting to be sent. |
exported_spans required | string | Spans the destination accepted. |
rejected_spans required | string | Spans the destination answered as rejected in a partial success. |
failed_spans required | string | Spans in a batch the destination refused for good (a 4xx that is not retried). |
dropped_spans required | string | Spans dropped unsent after the retention (72 hours). |
created_at required | string (date-time) | |
updated_at required | string (date-time) |
Errors
- 400
invalid_parameter,invalid_url,invalid_header: The request is malformed or fails validation;paramnames the field.trace_export_headers_required: The URL changes: give the headers again (an empty list removes them), so no header is sent to a URL it was not given for.invalid_idempotency_key: anIdempotency-Keyis 1 to 255 characters of visible ASCII.environment_required: a project key was sent withoutx-hixel-environment.invalid_params,invalid_payload,malformed_body,body_too_large: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the key was revoked or expired while the request ran, or an environment's key lost themanagementscope.management_scope_required: the environment's key does not have themanagementscope.role_not_allowed: the project key'smemberrole does not allow this; it takesadmin.
- 404
trace_export_destination_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.environment_not_found:x-hixel-environmentnames an environment outside the project key's project, an archived one, or another than the environment key's own.
- 409
project_archived: This project is archived.environment_archived: This environment is archived.idempotency_key_reused,idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
- 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X PATCH "https://api.hixel.dev/v1/trace_export_destinations/tex_123" \
-H "Authorization: Bearer $HIXEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://app.example.com/webhooks/gateway"
}'const traceExportDestination = await hixel.traceExportDestinations.update("tex_123", {
url: "https://app.example.com/webhooks/gateway",
});Delete a trace export destination#
Deletes the destination; nothing more is exported to it. Answers 204 with no body.
Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The destination's id (tex_…). |
Response 204
No body.
Errors
- 400
invalid_request: The request is malformed or fails validation;paramnames the field.invalid_idempotency_key: anIdempotency-Keyis 1 to 255 characters of visible ASCII.environment_required: a project key was sent withoutx-hixel-environment.invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the key was revoked or expired while the request ran, or an environment's key lost themanagementscope.management_scope_required: the environment's key does not have themanagementscope.role_not_allowed: the project key'smemberrole does not allow this; it takesadmin.
- 404
trace_export_destination_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.environment_not_found:x-hixel-environmentnames an environment outside the project key's project, an archived one, or another than the environment key's own.
- 409
project_archived: This project is archived.environment_archived: This environment is archived.idempotency_key_reused,idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
- 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X DELETE "https://api.hixel.dev/v1/trace_export_destinations/tex_123" \
-H "Authorization: Bearer $HIXEL_API_KEY"await hixel.traceExportDestinations.delete("tex_123");Send a test span#
Sends one test span now and answers how the destination answered.
Takes an environment key with the management scope, or a project key with the admin role, naming the environment in x-hixel-environment. Accepts an Idempotency-Key header: a retry with the same key runs once.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The destination's id (tex_…). |
Response 200: TraceExportTestResult
| Field | Type | Description |
|---|---|---|
delivered required | boolean | Whether the destination answered 2xx. |
status required | integer | null | Its HTTP status; null when no answer came (error says why). |
error required | "timeout" | "network" | "redirect" | "http_status" | "internal" | string | null | timeout, network, redirect, http_status or internal; null when delivered. |
response_body required | string | null | The start of its answer: at most 512 characters, header values removed. |
rejected_spans required | string | null | Spans a partial success rejected; null when the answer named none. |
Errors
- 400
invalid_request: The request is malformed or fails validation;paramnames the field.invalid_idempotency_key: anIdempotency-Keyis 1 to 255 characters of visible ASCII.environment_required: a project key was sent withoutx-hixel-environment.invalid_params: the request's path, query or body does not match its schema, or the body is not JSON or is over 1 MiB.
- 401
api_key_required,invalid_api_key,expired_api_key: no key was sent; the key is unknown or revoked, or its project or environment is archived; or it has expired. - 403
key_inactive: the key was revoked or expired while the request ran, or an environment's key lost themanagementscope.management_scope_required: the environment's key does not have themanagementscope.role_not_allowed: the project key'smemberrole does not allow this; it takesadmin.
- 404
trace_export_destination_not_found: The resource does not exist in the key's environment; a resource outside it reads the same.environment_not_found:x-hixel-environmentnames an environment outside the project key's project, an archived one, or another than the environment key's own.
- 409
project_archived: This project is archived.environment_archived: This environment is archived.idempotency_key_reused,idempotency_key_in_use: the key was used for another request (method, path or body), or the first request with it is still running.
- 500
internal: an unexpected failure on the platform's side (internal_error); the details are logged, never returned. - 503
database_unavailable: A dependency, such as the database or Stripe, cannot be reached; retry later.database_unavailable: the stored response to the key could not be read or written; retry later.
curl -X POST "https://api.hixel.dev/v1/trace_export_destinations/tex_123/test" \
-H "Authorization: Bearer $HIXEL_API_KEY"const traceExportTestResult = await hixel.traceExportDestinations.test("tex_123");