Tracing

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

POST
GET
POST
GET
POST
POST
POST
GET

Create tracing spans aggregate

Required API key scopes

tracing:read

Request parameters

  • query

Example request

POST /api/environments/:project_id/tracing/spans/aggregate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/aggregate/\
-d query=undefined

Example response

Status 200 No response body

Create tracing spans aggregate

Required API key scopes

tracing:read

Request parameters

  • query

Example request

POST /api/environments/:project_id/tracing/spans/aggregate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/aggregate/\
-d query=undefined

Example response

Status 200 No response body

Retrieve tracing spans attributes

Required API key scopes

tracing:read

Query parameters

  • attribute_type
    string
    One of: "span_attribute""span_resource_attribute"
  • limit
    integer
  • offset
    integer
  • search
    string

Example request

GET /api/environments/:project_id/tracing/spans/attributes
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/attributes/

Example response

Status 200 No response body

Retrieve tracing spans attributes

Required API key scopes

tracing:read

Query parameters

  • attribute_type
    string
    One of: "span_attribute""span_resource_attribute"
  • limit
    integer
  • offset
    integer
  • search
    string

Example request

GET /api/environments/:project_id/tracing/spans/attributes
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/attributes/

Example response

Status 200 No response body

Create tracing spans query

Required API key scopes

tracing:read

Request parameters

  • query

Example request

POST /api/environments/:project_id/tracing/spans/query
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/query/\
-d query=undefined

Example response

Status 200 No response body

Create tracing spans query

Required API key scopes

tracing:read

Request parameters

  • query

Example request

POST /api/environments/:project_id/tracing/spans/query
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/query/\
-d query=undefined

Example response

Status 200 No response body

Retrieve tracing spans service names

Required API key scopes

tracing:read

Query parameters

  • dateRange
    string
  • search
    string

Example request

GET /api/environments/:project_id/tracing/spans/service-names
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/service-names/

Example response

Status 200 No response body

Retrieve tracing spans service names

Required API key scopes

tracing:read

Query parameters

  • dateRange
    string
  • search
    string

Example request

GET /api/environments/:project_id/tracing/spans/service-names
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/service-names/

Example response

Status 200 No response body

Create tracing spans sparkline

Required API key scopes

tracing:read

Request parameters

  • query

Example request

POST /api/environments/:project_id/tracing/spans/sparkline
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/sparkline/\
-d query=undefined

Example response

Status 200 No response body

Create tracing spans sparkline

Required API key scopes

tracing:read

Request parameters

  • query

Example request

POST /api/environments/:project_id/tracing/spans/sparkline
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/sparkline/\
-d query=undefined

Example response

Status 200 No response body

Create tracing spans trace

Required API key scopes

tracing:read

Path parameters

  • trace_id
    string

Request parameters

  • dateRange

Example request

POST /api/environments/:project_id/tracing/spans/trace/:trace_id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/trace/:trace_id/\
-d dateRange=undefined

Example response

Status 200 No response body

Create tracing spans trace

Required API key scopes

tracing:read

Path parameters

  • trace_id
    string

Request parameters

  • dateRange

Example request

POST /api/environments/:project_id/tracing/spans/trace/:trace_id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/trace/:trace_id/\
-d dateRange=undefined

Example response

Status 200 No response body

Create tracing spans tree

Required API key scopes

tracing:read

Request parameters

  • query

Example request

POST /api/environments/:project_id/tracing/spans/tree
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/tree/\
-d query=undefined

Example response

Status 200 No response body

Create tracing spans tree

Required API key scopes

tracing:read

Request parameters

  • query

Example request

POST /api/environments/:project_id/tracing/spans/tree
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/tree/\
-d query=undefined

Example response

Status 200 No response body

Retrieve tracing spans values

Required API key scopes

tracing:read

Query parameters

  • attribute_type
    string
    One of: "span""span_attribute""span_resource_attribute"
  • key
    string
  • limit
    integer
  • offset
    integer
  • value
    string

Example request

GET /api/environments/:project_id/tracing/spans/values
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/values/

Example response

Status 200 No response body

Retrieve tracing spans values

Required API key scopes

tracing:read

Query parameters

  • attribute_type
    string
    One of: "span""span_attribute""span_resource_attribute"
  • key
    string
  • limit
    integer
  • offset
    integer
  • value
    string

Example request

GET /api/environments/:project_id/tracing/spans/values
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/tracing/spans/values/

Example response

Status 200 No response body

Community questions

Questions about this page? or post a community question.