Documentation menu

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.

OperationMethodSDK
List trace export destinationsGEThixel.traceExportDestinations.list
Create a trace export destinationPOSThixel.traceExportDestinations.create
Get a trace export destinationGEThixel.traceExportDestinations.get
Update a trace export destinationPATCHhixel.traceExportDestinations.update
Delete a trace export destinationDELETEhixel.traceExportDestinations.delete
Send a test spanPOSThixel.traceExportDestinations.test

List trace export destinations#

GET/v1/trace_export_destinationshixel.traceExportDestinations.list

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

NameInTypeDescription
cursorquerystringThe next_cursor of the previous page, to read the next one; left out for the first page. Pass the same filters with it.
limitqueryintegerHow many items the page holds: an integer from 1 to 100; 50 when left out.

Response 200: TraceExportDestinationList

FieldTypeDescription
data requiredarray of TraceExportDestination
data[].id requiredstringThe id of a trace export destination (tex_…).
data[].organization_id requiredstringThe id of your organization (org_…).
data[].project_id requiredstringThe id of a project (proj_…).
data[].environment_id requiredstringThe id of an environment (env_…).
data[].url requiredstringThe OTLP/HTTP traces endpoint, in full (https://…/v1/traces); nothing is appended.
data[].label requiredstring | nullA name of yours; null for none.
data[].headers requiredarray of object
data[].headers[].name requiredstringThe header's name, lowercase.
data[].headers[].value_last_four requiredstring | nullThe value's last four characters, for a value of 16 characters or more; else null.
data[].enabled requiredbooleanWhether spans are sent to it.
data[].disabled_reason required"manual" | "failing" | nullfailing when the platform disabled it after failing continuously; null while enabled.
data[].disabled_at requiredstring | nullWhen it was disabled; null while enabled.
data[].failing_since requiredstring | nullThe first failed export since the last success; null while it succeeds.
data[].consecutive_failures requiredintegerExports failed in a row since the last success.
data[].retry_at requiredstring | nullWhen the next export is due after a failure; null when none waits.
data[].last_succeeded_at requiredstring | null
data[].last_failed_at requiredstring | null
data[].last_error required"timeout" | "network" | "redirect" | "http_status" | "internal" | string | nullWhy 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 requiredinteger | nullThe HTTP status of the last failed export's answer; null when none came.
data[].last_response_body requiredstring | nullThe start of the last failed (or partly rejected) export's answer: at most 512 characters.
data[].pending_spans requiredstringSpans waiting to be sent.
data[].exported_spans requiredstringSpans the destination accepted.
data[].rejected_spans requiredstringSpans the destination answered as rejected in a partial success.
data[].failed_spans requiredstringSpans in a batch the destination refused for good (a 4xx that is not retried).
data[].dropped_spans requiredstringSpans dropped unsent after the retention (72 hours).
data[].created_at requiredstring (date-time)
data[].updated_at requiredstring (date-time)
next_cursor requiredstring | nullPass back as cursor for the next page; null on the last page.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_cursor: The cursor is not one this list gave.
    • environment_required: a project key was sent without x-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 the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 404 environment_not_found: x-hixel-environment names 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"

Create a trace export destination#

POST/v1/trace_export_destinationshixel.traceExportDestinations.create

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

FieldTypeDescription
url requiredstringThe full OTLP/HTTP traces URL, such as https://…/v1/traces: https:// on a public host name; nothing is appended.
labelstring
headersarray of objectAt most 8, each name once; values are secrets, never shown again.
headers[].name requiredstring
headers[].value requiredstring

Response 200: TraceExportDestination

FieldTypeDescription
id requiredstringThe id of a trace export destination (tex_…).
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
url requiredstringThe OTLP/HTTP traces endpoint, in full (https://…/v1/traces); nothing is appended.
label requiredstring | nullA name of yours; null for none.
headers requiredarray of object
headers[].name requiredstringThe header's name, lowercase.
headers[].value_last_four requiredstring | nullThe value's last four characters, for a value of 16 characters or more; else null.
enabled requiredbooleanWhether spans are sent to it.
disabled_reason required"manual" | "failing" | nullfailing when the platform disabled it after failing continuously; null while enabled.
disabled_at requiredstring | nullWhen it was disabled; null while enabled.
failing_since requiredstring | nullThe first failed export since the last success; null while it succeeds.
consecutive_failures requiredintegerExports failed in a row since the last success.
retry_at requiredstring | nullWhen the next export is due after a failure; null when none waits.
last_succeeded_at requiredstring | null
last_failed_at requiredstring | null
last_error required"timeout" | "network" | "redirect" | "http_status" | "internal" | string | nullWhy 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 requiredinteger | nullThe HTTP status of the last failed export's answer; null when none came.
last_response_body requiredstring | nullThe start of the last failed (or partly rejected) export's answer: at most 512 characters.
pending_spans requiredstringSpans waiting to be sent.
exported_spans requiredstringSpans the destination accepted.
rejected_spans requiredstringSpans the destination answered as rejected in a partial success.
failed_spans requiredstringSpans in a batch the destination refused for good (a 4xx that is not retried).
dropped_spans requiredstringSpans dropped unsent after the retention (72 hours).
created_at requiredstring (date-time)
updated_at requiredstring (date-time)

Errors

  • 400
    • invalid_parameter, invalid_url, invalid_header: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-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 the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 404 environment_not_found: x-hixel-environment names 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"
  }'

Get a trace export destination#

GET/v1/trace_export_destinations/{id}hixel.traceExportDestinations.get

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

NameInTypeDescription
id requiredpathstringThe destination's id (tex_…).

Response 200: TraceExportDestination

FieldTypeDescription
id requiredstringThe id of a trace export destination (tex_…).
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
url requiredstringThe OTLP/HTTP traces endpoint, in full (https://…/v1/traces); nothing is appended.
label requiredstring | nullA name of yours; null for none.
headers requiredarray of object
headers[].name requiredstringThe header's name, lowercase.
headers[].value_last_four requiredstring | nullThe value's last four characters, for a value of 16 characters or more; else null.
enabled requiredbooleanWhether spans are sent to it.
disabled_reason required"manual" | "failing" | nullfailing when the platform disabled it after failing continuously; null while enabled.
disabled_at requiredstring | nullWhen it was disabled; null while enabled.
failing_since requiredstring | nullThe first failed export since the last success; null while it succeeds.
consecutive_failures requiredintegerExports failed in a row since the last success.
retry_at requiredstring | nullWhen the next export is due after a failure; null when none waits.
last_succeeded_at requiredstring | null
last_failed_at requiredstring | null
last_error required"timeout" | "network" | "redirect" | "http_status" | "internal" | string | nullWhy 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 requiredinteger | nullThe HTTP status of the last failed export's answer; null when none came.
last_response_body requiredstring | nullThe start of the last failed (or partly rejected) export's answer: at most 512 characters.
pending_spans requiredstringSpans waiting to be sent.
exported_spans requiredstringSpans the destination accepted.
rejected_spans requiredstringSpans the destination answered as rejected in a partial success.
failed_spans requiredstringSpans in a batch the destination refused for good (a 4xx that is not retried).
dropped_spans requiredstringSpans dropped unsent after the retention (72 hours).
created_at requiredstring (date-time)
updated_at requiredstring (date-time)

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • environment_required: a project key was sent without x-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 the management scope.
    • management_scope_required: the environment's key does not have the management scope.
  • 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-environment names 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"

Update a trace export destination#

PATCH/v1/trace_export_destinations/{id}hixel.traceExportDestinations.update

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

NameInTypeDescription
id requiredpathstringThe destination's id (tex_…).

Request body: UpdateTraceExportDestinationBody

FieldTypeDescription
urlstring
labelstring | null
headersarray of object
headers[].name requiredstring
headers[].value requiredstring
enabledbooleanfalse disables it; true enables it again and clears its failures.

Response 200: TraceExportDestination

FieldTypeDescription
id requiredstringThe id of a trace export destination (tex_…).
organization_id requiredstringThe id of your organization (org_…).
project_id requiredstringThe id of a project (proj_…).
environment_id requiredstringThe id of an environment (env_…).
url requiredstringThe OTLP/HTTP traces endpoint, in full (https://…/v1/traces); nothing is appended.
label requiredstring | nullA name of yours; null for none.
headers requiredarray of object
headers[].name requiredstringThe header's name, lowercase.
headers[].value_last_four requiredstring | nullThe value's last four characters, for a value of 16 characters or more; else null.
enabled requiredbooleanWhether spans are sent to it.
disabled_reason required"manual" | "failing" | nullfailing when the platform disabled it after failing continuously; null while enabled.
disabled_at requiredstring | nullWhen it was disabled; null while enabled.
failing_since requiredstring | nullThe first failed export since the last success; null while it succeeds.
consecutive_failures requiredintegerExports failed in a row since the last success.
retry_at requiredstring | nullWhen the next export is due after a failure; null when none waits.
last_succeeded_at requiredstring | null
last_failed_at requiredstring | null
last_error required"timeout" | "network" | "redirect" | "http_status" | "internal" | string | nullWhy 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 requiredinteger | nullThe HTTP status of the last failed export's answer; null when none came.
last_response_body requiredstring | nullThe start of the last failed (or partly rejected) export's answer: at most 512 characters.
pending_spans requiredstringSpans waiting to be sent.
exported_spans requiredstringSpans the destination accepted.
rejected_spans requiredstringSpans the destination answered as rejected in a partial success.
failed_spans requiredstringSpans in a batch the destination refused for good (a 4xx that is not retried).
dropped_spans requiredstringSpans dropped unsent after the retention (72 hours).
created_at requiredstring (date-time)
updated_at requiredstring (date-time)

Errors

  • 400
    • invalid_parameter, invalid_url, invalid_header: The request is malformed or fails validation; param names 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: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-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 the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 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-environment names 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"
  }'

Delete a trace export destination#

DELETE/v1/trace_export_destinations/{id}hixel.traceExportDestinations.delete

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

NameInTypeDescription
id requiredpathstringThe destination's id (tex_…).

Response 204

No body.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-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 the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 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-environment names 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"

Send a test span#

POST/v1/trace_export_destinations/{id}/testhixel.traceExportDestinations.test

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

NameInTypeDescription
id requiredpathstringThe destination's id (tex_…).

Response 200: TraceExportTestResult

FieldTypeDescription
delivered requiredbooleanWhether the destination answered 2xx.
status requiredinteger | nullIts HTTP status; null when no answer came (error says why).
error required"timeout" | "network" | "redirect" | "http_status" | "internal" | string | nulltimeout, network, redirect, http_status or internal; null when delivered.
response_body requiredstring | nullThe start of its answer: at most 512 characters, header values removed.
rejected_spans requiredstring | nullSpans a partial success rejected; null when the answer named none.

Errors

  • 400
    • invalid_request: The request is malformed or fails validation; param names the field.
    • invalid_idempotency_key: an Idempotency-Key is 1 to 255 characters of visible ASCII.
    • environment_required: a project key was sent without x-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 the management scope.
    • management_scope_required: the environment's key does not have the management scope.
    • role_not_allowed: the project key's member role does not allow this; it takes admin.
  • 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-environment names 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"