Apm

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

Endpoints

GET
GET
GET
GET
GET
GET
GET

List all apm dependencies

Caller to callee edges over the whole window, including inferred dependencies. Same gate and window as services.

Required API key scopes

tracing:read

Query parameters

  • date_from
    string
  • date_to
    string
  • environment
    string
  • service
    string

Response


Example request

GET /api/projects/:project_id/apm/dependencies
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/apm/dependencies/

Example response

Status 200
RESPONSE
{
"edges": [
{
"caller": "string",
"callee": "string",
"inferred": true,
"kind": "service",
"requests": 0,
"error_count": 0,
"p95_ms": 0
}
],
"truncated": true,
"sampled": true,
"trace_count": 0,
"environment": "string",
"service": "string",
"date_from": "2019-08-24T14:15:22Z",
"date_to": "2019-08-24T14:15:22Z"
}

List all apm deployments

One service's versions in an environment and window, each compared with the one before. Same gate and window as services.

Required API key scopes

tracing:read

Query parameters

  • date_from
    string
  • date_to
    string
  • environment
    string
  • service
    string

Response


Example request

GET /api/projects/:project_id/apm/deployments
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/apm/deployments/

Example response

Status 200
RESPONSE
{
"results": [
{
"version": "string",
"first_seen": "2019-08-24T14:15:22Z",
"last_seen": "2019-08-24T14:15:22Z",
"requests": 0,
"error_count": 0,
"error_rate": 0,
"p95_ms": 0,
"previous_version": "string",
"error_rate_change": 0,
"p95_change_pct": 0,
"active": true
}
],
"version_source": "service.version",
"service": "string",
"environment": "string",
"date_from": "2019-08-24T14:15:22Z",
"date_to": "2019-08-24T14:15:22Z"
}

List all apm endpoint time spent

Where one endpoint's request time goes, by service and inferred dependency. Same gate and window as services.

Required API key scopes

tracing:read

Query parameters

  • date_from
    string
  • date_to
    string
  • endpoint
    string
  • environment
    string
  • service
    string

Response


Example request

GET /api/projects/:project_id/apm/endpoint_time_spent
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/apm/endpoint_time_spent/

Example response

Status 200
RESPONSE
{
"components": [
{
"name": "string",
"kind": "service",
"total_ms": 0.1,
"avg_ms_per_request": 0.1,
"share": 0.1
}
],
"request_count": 0,
"avg_duration_ms": 0,
"service": "string",
"endpoint": "string",
"environment": "string",
"date_from": "2019-08-24T14:15:22Z",
"date_to": "2019-08-24T14:15:22Z"
}

List all apm endpoints

One health row per service and entry span name, worst first. Same gate and window as services.

Required API key scopes

tracing:read

Query parameters

  • date_from
    string
  • date_to
    string
  • environment
    string
  • service
    string

Response


Example request

GET /api/projects/:project_id/apm/endpoints
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/apm/endpoints/

Example response

Status 200
RESPONSE
{
"results": [
{
"service_name": "string",
"endpoint": "string",
"span_name": "string",
"route_attribute": "string",
"route": "string",
"environment": "string",
"status": "good",
"health": {
"request_rate": 0,
"error_rate": 0,
"p95_ms": 0,
"span_count": 0,
"error_count": 0,
"apdex": 0
}
}
],
"environment": "string",
"service": "string",
"date_from": "2019-08-24T14:15:22Z",
"date_to": "2019-08-24T14:15:22Z"
}

List all apm service map

Service-to-service call edges in an environment and window. Same gate and window as services.

Required API key scopes

tracing:read

Query parameters

  • date_from
    string
  • date_to
    string
  • environment
    string

Response


Example request

GET /api/projects/:project_id/apm/service_map
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/apm/service_map/

Example response

Status 200
RESPONSE
{
"edges": [
{
"caller": "string",
"callee": "string",
"calls": 0,
"error_count": 0,
"p95_ms": 0
}
],
"trace_count": 0,
"environment": "string",
"date_from": "2019-08-24T14:15:22Z",
"date_to": "2019-08-24T14:15:22Z"
}

List all apm services

One health row per service in an environment and window, worst first.

Read-only, and dark for every team without the product flag: the flag gates the scene, the nav entry, and this endpoint together.

Required API key scopes

tracing:read

Query parameters

  • date_from
    string
  • date_to
    string
  • environment
    string

Response


Example request

GET /api/projects/:project_id/apm/services
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/apm/services/

Example response

Status 200
RESPONSE
{
"results": [
{
"service_name": "string",
"environment": "string",
"status": "good",
"health": {
"request_rate": 0,
"error_rate": 0,
"p95_ms": 0,
"span_count": 0,
"error_count": 0,
"apdex": 0
},
"sparkline": [
0
]
}
],
"environments": [
"string"
],
"environment": "string",
"date_from": "2019-08-24T14:15:22Z",
"date_to": "2019-08-24T14:15:22Z"
}

List all apm usage

How much each service sends across logs, traces, and metrics in a window. Same gate and window as services.

Usage covers every environment: logs and metrics often carry no environment attribute, so a filter would hide the services that send the most.

Required API key scopes

tracing:readlogs:readmetrics:read

Query parameters

  • date_from
    string
  • date_to
    string

Response


Example request

GET /api/projects/:project_id/apm/usage
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/apm/usage/

Example response

Status 200
RESPONSE
{
"results": [
{
"log_records": 0,
"log_bytes": 0,
"spans": 0,
"metric_points": 0,
"metric_series": 0,
"service_name": "string"
}
],
"totals": {
"log_records": 0,
"log_bytes": 0,
"spans": 0,
"metric_points": 0,
"metric_series": 0
},
"unavailable_signals": [
"logs"
],
"date_from": "2019-08-24T14:15:22Z",
"date_to": "2019-08-24T14:15:22Z"
}