๐งฉWorkload API
The Workload API provides you with the option to download comprehensive metrics in either JSON or CSV format.
Last updated
The Workload API provides you with the option to download comprehensive metrics in either JSON or CSV format.
Last updated
To use the Workload API, it's necessary to generate an access token.
A comprehensive toolkit, with practical usage examples, is accessible on GitHub.
This toolkit comes pre-installed as a default component within the on-premises platform, located at /datasentinel/soft/datasentinel_toolkit
.
POST
https://<<platform-server>>/ds-api/activity/session-history
For more details, refer to Session History Feature.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Response
POST
https://<<platform-server>>/ds-api/activity/queries-summary
Present an overview of global metrics summarizing all executed queries group by database.
Response
POST
https://<<platform-server>>/ds-api/activity/top-queries
For more details, refer to Top Queries Feature.
Response
POST
https://<<platform-server>>/ds-api/activity/query
Export execution metrics based on a query identifier.
Response
POST
https://<<platform-server>>/ds-api/activity/pg-instance-infos
Response
POST
https://<<platform-server>>/ds-api/activity/pg-instance
Overall activity or minute-by-minute detailed activity of one or more clusters, encompassing cache activity, IO operation statistics, transaction metrics, and more.
Response
POST
https://<<platform-server>>/ds-api/activity/pg-background
Overall background activity or minute-by-minute detailed background activity of one or more clusters
Response
POST
https://<<platform-server>>/ds-api/activity/data-size
Response
POST
https://<<platform-server>>/ds-api/activity/tables
For more details, refer to Top Tables Feature.
Response
POST
https://<<platform-server>>/ds-api/activity/indexes
For more details, refer to Top Tables Feature.
Response
POST
https://<<platform-server>>/ds-api/activity/server
Overall activity or minute-by-minute detailed server activity
Response
POST
https://<<platform-server>>/ds-api/activity/top-consumers
Present the foremost users of a specific resource.
Metrics are grouped according to a particular dimension, which is characterized by any defined tag. Refer to Tags section for more details.
Response
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
output
json or csv format
Default: json
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
by
String
The grouping dimension.
Default: total_time
The available options for the grouping dimension are:
calls
local_blks_dirtied
local_blks_hit
local_blks_read
local_blks_written
rows
shared_blks_dirtied shared_blks_hit
shared_blks_read shared_blks_written temp_blks_read temp_blks_written
total_time
blk_read_time
blk_write_time
wal_bytes
limit
Number
Restrict the count of displayed lines within the report.
Default: 20
output
String
json or csv format
Default: json
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
query_md5_id*
String
Query internal identifier computed by Datasentinel and displayed on the user interface.
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
output
json or csv format
Default: json
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
output
json or csv format
Default: json
compute
String
There are 2 potential values:
summary: Provides an overview of the overall activity for each PostgreSQL instance. details: Offers minute-by-minute detailed activity for each PostgreSQL instance.
Default: details
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
output
json or csv format
Default: json
compute
String
There are 2 potential values:
summary: Provides an overview of the overall activity for each PostgreSQL instance. details: Offers minute-by-minute detailed activity for each PostgreSQL instance.
Default: details
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
output
json or csv format
Default: json
compute
String
There are 2 potential values:
summary: Provides an overview of the overall activity for each PostgreSQL instance. details: Offers minute-by-minute detailed activity for each PostgreSQL instance.
Default: details
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
by
String
The grouping dimension.
Default: heap_blks_hit
The available options for the grouping dimension are:
heap_blks_hit
heap_blks_read
idx_blks_hit
idx_blks_read
idx_scan
n_tup_del
n_tup_hot_upd
n_tup_ins
idx_tup_fetch
n_tup_upd
relid
relkind
relpages
reltuples
seq_scan
seq_tup_read
size
tidx_blks_hit
tidx_blks_read
toast_blks_hit
toast_blks_read
vacuum_count
autovacuum_count
analyze_count
autoanalyze_count
limit
Number
Restrict the count of displayed lines within the report.
Default: 20
output
String
json or csv format
Default: json
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
by
String
The grouping dimension.
Default: idx_blks_hit
The available options for the grouping dimension are:
idx_blks_hit
idx_blks_read
idx_scan
idx_tup_fetch
idx_tup_read
relpages
size
limit
Number
Restrict the count of displayed lines within the report.
Default: 20
output
String
json or csv format
Default: json
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
output
json or csv format
Default: json
compute
String
There are 2 potential values:
summary: Provides an overview of the overall activity for each PostgreSQL instance. details: Offers minute-by-minute detailed activity for each PostgreSQL instance.
Default: details
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
by
String
The ordered resource.
Default: db_time
The available options for the ordered resource are:
db_time: Cumulative execution time (in milliseconds) of SQL
queries. memory: Memory usage (in bytes). data_size: Total size (in bytes) of data. wal_size: Overall volume (in bytes) of Write-Ahead Logs (WAL) generated. cache_blocks_hit: Complete count of cache-hit blocks. disk_blocks_read: Total count of blocks read beyond the PostgreSQL cluster.
limit
Number
Restrict the count of displayed lines within the report.
Default: 20
output
String
json or csv format
Default: json
group_by
String
Grouping dimension. Default: pg_instance
This grouping dimension can be any defined tag.
Refer to Tags section for more details.
user-token*
String
Generated Access Token
utc_time
Boolean
When set to false, the considered timezone will rely on the platform's timezone. Default: true
from*
Begin time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
to*
String
End time Date format:
YYYY-MM-DD
YYYY-MM-DD HH:MI
YYYY-MM-DD HH:MI:SS
filters*
Array
Array of Tags {
โtagโ : Tag name,
โvalueโ: Tag value
}
output
json or csv format
Default: json