Skip to main content
GET
/
projects
/
{projectId}
/
environments
/
{environmentId}
/
observability
/
resources
/
service
/
{service}
Get resource metrics by service
curl --request GET \
  --url {schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/resources/service/{service} \
  --header 'Authorization: Bearer <token>'
{
  "_grain": 5,
  "_from": 1704067200,
  "_to": 1704153600,
  "_project_id": "abc123def456",
  "_environment_id": "main",
  "_branch_machine_name": "main-bvxea6i",
  "_service": "admin-pipeline--kafka-profile-payloads",
  "data": [
    {
      "timestamp": 1764083040,
      "instances": {}
    }
  ],
  "_dg2_host_types_mapping": {
    "app.0": "web",
    "app.1": "unified",
    "worker.0": ""
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

projectId
string
required

The unique identifier of the Upsun project

Pattern: [a-z0-9]+
Example:

"abc123def456"

environmentId
string
required

The environment identifier

Pattern: .+
Example:

"main"

service
string
required

The service name to retrieve metrics for (e.g., "app", "database", "admin-pipeline--kafka-profile-payloads")

Example:

"app"

Query Parameters

from
integer<int64>
required

Start timestamp for the time range (Unix timestamp in seconds)

Example:

1704067200

to
integer<int64>
required

End timestamp for the time range (Unix timestamp in seconds)

Example:

1704153600

aggs[]
enum<string>[]

Statistical aggregations to include in the response. Can be specified multiple times. Available values: avg, stddev, max, min, p50, p95, p96, p97, p98, p99. Specify parameter multiple times for multiple values (e.g., ?aggs[]=avg&aggs[]=p50).

Available options:
avg,
stddev,
max,
min,
p50,
p95,
p96,
p97,
p98,
p99
types[]
enum<string>[]

Metric types to include in the response. Can be specified multiple times. Available values: cpu, memory, disk, inodes, swap, memory_pressure, cpu_pressure, io_pressure, irq_pressure. Specify parameter multiple times for multiple values (e.g., ?types[]=cpu&types[]=memory).

Available options:
cpu,
memory,
disk,
inodes,
swap,
memory_pressure,
cpu_pressure,
io_pressure,
irq_pressure

Response

Successfully retrieved service-specific resource metrics with time-series data

_grain
integer
required

Data granularity in seconds

Example:

5

_from
integer
required

Query start timestamp

Example:

1704067200

_to
integer
required

Query end timestamp

Example:

1704153600

_project_id
string
required

Project identifier

Example:

"abc123def456"

_environment_id
string
required

Environment identifier

Example:

"main"

_branch_machine_name
string
required

Branch machine name

Example:

"main-bvxea6i"

_service
string
required

Service name

Example:

"admin-pipeline--kafka-profile-payloads"

data
object[]
required

Time-series resource utilization data organized by timestamp with instance-level metrics

_dg2_host_types_mapping
object

DG2 host type mapping per instance. Only present for DG2 environments. Maps instance names to their host type ("web", "unified", or empty string).

Example:
{
"app.0": "web",
"app.1": "unified",
"worker.0": ""
}
Last modified on March 25, 2026