curl --request POST \
--url https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"groupBy": [
"<string>"
],
"limit": 123,
"metrics": [
{
"metric": "<string>",
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"startTime": "2023-11-07T05:31:56Z"
}
],
"orderBy": [
{
"attribute": "<string>"
}
],
"startTime": "2023-11-07T05:31:56Z",
"comparison": {
"type": "<string>",
"peerFilters": [
{
"attribute": "<string>",
"predicate": {}
}
]
},
"daysOfWeek": [
123
],
"nestedAggregations": [
{
"aggregations": [
{
"metric": "<string>",
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"startTime": "2023-11-07T05:31:56Z"
}
],
"groupBy": [
"<string>"
],
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"timeAttribute": "<string>"
}
],
"nextPage": "<string>",
"timeAttribute": "<string>",
"timeAttributes": [
"<string>"
]
}
'import requests
url = "https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time"
payload = {
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"groupBy": ["<string>"],
"limit": 123,
"metrics": [
{
"metric": "<string>",
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"startTime": "2023-11-07T05:31:56Z"
}
],
"orderBy": [{ "attribute": "<string>" }],
"startTime": "2023-11-07T05:31:56Z",
"comparison": {
"type": "<string>",
"peerFilters": [
{
"attribute": "<string>",
"predicate": {}
}
]
},
"daysOfWeek": [123],
"nestedAggregations": [
{
"aggregations": [
{
"metric": "<string>",
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"startTime": "2023-11-07T05:31:56Z"
}
],
"groupBy": ["<string>"],
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"timeAttribute": "<string>"
}
],
"nextPage": "<string>",
"timeAttribute": "<string>",
"timeAttributes": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endTime: '2023-11-07T05:31:56Z',
filters: [{attribute: '<string>', predicate: {}}],
groupBy: ['<string>'],
limit: 123,
metrics: [
{
metric: '<string>',
endTime: '2023-11-07T05:31:56Z',
filters: [{attribute: '<string>', predicate: {}}],
startTime: '2023-11-07T05:31:56Z'
}
],
orderBy: [{attribute: '<string>'}],
startTime: '2023-11-07T05:31:56Z',
comparison: {type: '<string>', peerFilters: [{attribute: '<string>', predicate: {}}]},
daysOfWeek: [123],
nestedAggregations: [
{
aggregations: [
{
metric: '<string>',
endTime: '2023-11-07T05:31:56Z',
filters: [{attribute: '<string>', predicate: {}}],
startTime: '2023-11-07T05:31:56Z'
}
],
groupBy: ['<string>'],
filters: [{attribute: '<string>', predicate: {}}],
timeAttribute: '<string>'
}
],
nextPage: '<string>',
timeAttribute: '<string>',
timeAttributes: ['<string>']
})
};
fetch('https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'endTime' => '2023-11-07T05:31:56Z',
'filters' => [
[
'attribute' => '<string>',
'predicate' => [
]
]
],
'groupBy' => [
'<string>'
],
'limit' => 123,
'metrics' => [
[
'metric' => '<string>',
'endTime' => '2023-11-07T05:31:56Z',
'filters' => [
[
'attribute' => '<string>',
'predicate' => [
]
]
],
'startTime' => '2023-11-07T05:31:56Z'
]
],
'orderBy' => [
[
'attribute' => '<string>'
]
],
'startTime' => '2023-11-07T05:31:56Z',
'comparison' => [
'type' => '<string>',
'peerFilters' => [
[
'attribute' => '<string>',
'predicate' => [
]
]
]
],
'daysOfWeek' => [
123
],
'nestedAggregations' => [
[
'aggregations' => [
[
'metric' => '<string>',
'endTime' => '2023-11-07T05:31:56Z',
'filters' => [
[
'attribute' => '<string>',
'predicate' => [
]
]
],
'startTime' => '2023-11-07T05:31:56Z'
]
],
'groupBy' => [
'<string>'
],
'filters' => [
[
'attribute' => '<string>',
'predicate' => [
]
]
],
'timeAttribute' => '<string>'
]
],
'nextPage' => '<string>',
'timeAttribute' => '<string>',
'timeAttributes' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time"
payload := strings.NewReader("{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"limit\": 123,\n \"metrics\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"orderBy\": [\n {\n \"attribute\": \"<string>\"\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"comparison\": {\n \"type\": \"<string>\",\n \"peerFilters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ]\n },\n \"daysOfWeek\": [\n 123\n ],\n \"nestedAggregations\": [\n {\n \"aggregations\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"timeAttribute\": \"<string>\"\n }\n ],\n \"nextPage\": \"<string>\",\n \"timeAttribute\": \"<string>\",\n \"timeAttributes\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"limit\": 123,\n \"metrics\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"orderBy\": [\n {\n \"attribute\": \"<string>\"\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"comparison\": {\n \"type\": \"<string>\",\n \"peerFilters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ]\n },\n \"daysOfWeek\": [\n 123\n ],\n \"nestedAggregations\": [\n {\n \"aggregations\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"timeAttribute\": \"<string>\"\n }\n ],\n \"nextPage\": \"<string>\",\n \"timeAttribute\": \"<string>\",\n \"timeAttributes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"limit\": 123,\n \"metrics\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"orderBy\": [\n {\n \"attribute\": \"<string>\"\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"comparison\": {\n \"type\": \"<string>\",\n \"peerFilters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ]\n },\n \"daysOfWeek\": [\n 123\n ],\n \"nestedAggregations\": [\n {\n \"aggregations\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"timeAttribute\": \"<string>\"\n }\n ],\n \"nextPage\": \"<string>\",\n \"timeAttribute\": \"<string>\",\n \"timeAttributes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"columns": [
{
"alias": "<string>",
"name": "<string>",
"ordinal": 123,
"type": "<string>",
"aggregationFunction": "SUM",
"attributeName": "<string>",
"resultType": "STRING",
"category": "<string>",
"description": "<string>"
}
],
"nextPage": "<string>"
},
"rows": [
[
"platform-team",
12.5,
30
],
[
"payments-team",
8,
17
]
]
}{
"metadata": {
"columns": [
{
"alias": "<string>",
"name": "<string>",
"ordinal": 123,
"type": "<string>",
"aggregationFunction": "SUM",
"attributeName": "<string>",
"resultType": "STRING",
"category": "<string>",
"description": "<string>"
}
],
"nextPage": "<string>"
},
"rows": [
[
"platform-team",
12.5,
30
],
[
"payments-team",
8,
17
]
]
}{
"metadata": {
"columns": [
{
"alias": "<string>",
"name": "<string>",
"ordinal": 123,
"type": "<string>",
"aggregationFunction": "SUM",
"attributeName": "<string>",
"resultType": "STRING",
"category": "<string>",
"description": "<string>"
}
],
"nextPage": "<string>"
},
"rows": [
[
"platform-team",
12.5,
30
],
[
"payments-team",
8,
17
]
]
}{
"status": 429,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"instance": "<string>",
"retryAfter": 1
}Execute point-in-time engineering metrics queries
Query current metric values with optional period comparisons and flexible grouping. Supports batch queries for multiple metrics efficiently.
curl --request POST \
--url https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"groupBy": [
"<string>"
],
"limit": 123,
"metrics": [
{
"metric": "<string>",
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"startTime": "2023-11-07T05:31:56Z"
}
],
"orderBy": [
{
"attribute": "<string>"
}
],
"startTime": "2023-11-07T05:31:56Z",
"comparison": {
"type": "<string>",
"peerFilters": [
{
"attribute": "<string>",
"predicate": {}
}
]
},
"daysOfWeek": [
123
],
"nestedAggregations": [
{
"aggregations": [
{
"metric": "<string>",
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"startTime": "2023-11-07T05:31:56Z"
}
],
"groupBy": [
"<string>"
],
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"timeAttribute": "<string>"
}
],
"nextPage": "<string>",
"timeAttribute": "<string>",
"timeAttributes": [
"<string>"
]
}
'import requests
url = "https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time"
payload = {
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"groupBy": ["<string>"],
"limit": 123,
"metrics": [
{
"metric": "<string>",
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"startTime": "2023-11-07T05:31:56Z"
}
],
"orderBy": [{ "attribute": "<string>" }],
"startTime": "2023-11-07T05:31:56Z",
"comparison": {
"type": "<string>",
"peerFilters": [
{
"attribute": "<string>",
"predicate": {}
}
]
},
"daysOfWeek": [123],
"nestedAggregations": [
{
"aggregations": [
{
"metric": "<string>",
"endTime": "2023-11-07T05:31:56Z",
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"startTime": "2023-11-07T05:31:56Z"
}
],
"groupBy": ["<string>"],
"filters": [
{
"attribute": "<string>",
"predicate": {}
}
],
"timeAttribute": "<string>"
}
],
"nextPage": "<string>",
"timeAttribute": "<string>",
"timeAttributes": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endTime: '2023-11-07T05:31:56Z',
filters: [{attribute: '<string>', predicate: {}}],
groupBy: ['<string>'],
limit: 123,
metrics: [
{
metric: '<string>',
endTime: '2023-11-07T05:31:56Z',
filters: [{attribute: '<string>', predicate: {}}],
startTime: '2023-11-07T05:31:56Z'
}
],
orderBy: [{attribute: '<string>'}],
startTime: '2023-11-07T05:31:56Z',
comparison: {type: '<string>', peerFilters: [{attribute: '<string>', predicate: {}}]},
daysOfWeek: [123],
nestedAggregations: [
{
aggregations: [
{
metric: '<string>',
endTime: '2023-11-07T05:31:56Z',
filters: [{attribute: '<string>', predicate: {}}],
startTime: '2023-11-07T05:31:56Z'
}
],
groupBy: ['<string>'],
filters: [{attribute: '<string>', predicate: {}}],
timeAttribute: '<string>'
}
],
nextPage: '<string>',
timeAttribute: '<string>',
timeAttributes: ['<string>']
})
};
fetch('https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'endTime' => '2023-11-07T05:31:56Z',
'filters' => [
[
'attribute' => '<string>',
'predicate' => [
]
]
],
'groupBy' => [
'<string>'
],
'limit' => 123,
'metrics' => [
[
'metric' => '<string>',
'endTime' => '2023-11-07T05:31:56Z',
'filters' => [
[
'attribute' => '<string>',
'predicate' => [
]
]
],
'startTime' => '2023-11-07T05:31:56Z'
]
],
'orderBy' => [
[
'attribute' => '<string>'
]
],
'startTime' => '2023-11-07T05:31:56Z',
'comparison' => [
'type' => '<string>',
'peerFilters' => [
[
'attribute' => '<string>',
'predicate' => [
]
]
]
],
'daysOfWeek' => [
123
],
'nestedAggregations' => [
[
'aggregations' => [
[
'metric' => '<string>',
'endTime' => '2023-11-07T05:31:56Z',
'filters' => [
[
'attribute' => '<string>',
'predicate' => [
]
]
],
'startTime' => '2023-11-07T05:31:56Z'
]
],
'groupBy' => [
'<string>'
],
'filters' => [
[
'attribute' => '<string>',
'predicate' => [
]
]
],
'timeAttribute' => '<string>'
]
],
'nextPage' => '<string>',
'timeAttribute' => '<string>',
'timeAttributes' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time"
payload := strings.NewReader("{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"limit\": 123,\n \"metrics\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"orderBy\": [\n {\n \"attribute\": \"<string>\"\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"comparison\": {\n \"type\": \"<string>\",\n \"peerFilters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ]\n },\n \"daysOfWeek\": [\n 123\n ],\n \"nestedAggregations\": [\n {\n \"aggregations\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"timeAttribute\": \"<string>\"\n }\n ],\n \"nextPage\": \"<string>\",\n \"timeAttribute\": \"<string>\",\n \"timeAttributes\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"limit\": 123,\n \"metrics\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"orderBy\": [\n {\n \"attribute\": \"<string>\"\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"comparison\": {\n \"type\": \"<string>\",\n \"peerFilters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ]\n },\n \"daysOfWeek\": [\n 123\n ],\n \"nestedAggregations\": [\n {\n \"aggregations\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"timeAttribute\": \"<string>\"\n }\n ],\n \"nextPage\": \"<string>\",\n \"timeAttribute\": \"<string>\",\n \"timeAttributes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getcortexapp.com/api/v1/eng-intel/metrics/point-in-time")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"limit\": 123,\n \"metrics\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"orderBy\": [\n {\n \"attribute\": \"<string>\"\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\",\n \"comparison\": {\n \"type\": \"<string>\",\n \"peerFilters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ]\n },\n \"daysOfWeek\": [\n 123\n ],\n \"nestedAggregations\": [\n {\n \"aggregations\": [\n {\n \"metric\": \"<string>\",\n \"endTime\": \"2023-11-07T05:31:56Z\",\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"startTime\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"groupBy\": [\n \"<string>\"\n ],\n \"filters\": [\n {\n \"attribute\": \"<string>\",\n \"predicate\": {}\n }\n ],\n \"timeAttribute\": \"<string>\"\n }\n ],\n \"nextPage\": \"<string>\",\n \"timeAttribute\": \"<string>\",\n \"timeAttributes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"columns": [
{
"alias": "<string>",
"name": "<string>",
"ordinal": 123,
"type": "<string>",
"aggregationFunction": "SUM",
"attributeName": "<string>",
"resultType": "STRING",
"category": "<string>",
"description": "<string>"
}
],
"nextPage": "<string>"
},
"rows": [
[
"platform-team",
12.5,
30
],
[
"payments-team",
8,
17
]
]
}{
"metadata": {
"columns": [
{
"alias": "<string>",
"name": "<string>",
"ordinal": 123,
"type": "<string>",
"aggregationFunction": "SUM",
"attributeName": "<string>",
"resultType": "STRING",
"category": "<string>",
"description": "<string>"
}
],
"nextPage": "<string>"
},
"rows": [
[
"platform-team",
12.5,
30
],
[
"payments-team",
8,
17
]
]
}{
"metadata": {
"columns": [
{
"alias": "<string>",
"name": "<string>",
"ordinal": 123,
"type": "<string>",
"aggregationFunction": "SUM",
"attributeName": "<string>",
"resultType": "STRING",
"category": "<string>",
"description": "<string>"
}
],
"nextPage": "<string>"
},
"rows": [
[
"platform-team",
12.5,
30
],
[
"payments-team",
8,
17
]
]
}{
"status": 429,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"instance": "<string>",
"retryAfter": 1
}Authorizations
All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.
Body
Point-in-time metrics query request for batch processing
End time for the query period
Filters to apply to the data
Show child attributes
Show child attributes
Fields to group results by
Fields to group results by
Maximum number of results to return
List of metrics to query with their aggregation functions
Show child attributes
Show child attributes
Sort order for results
Show child attributes
Show child attributes
Start time for the query period
Optional comparison to previous time period
- Option 1
- Option 2
Show child attributes
Show child attributes
Optional day-of-week restriction (ISO: Monday=1..Sunday=7). When set, the query filters out rows whose time-attribute does not fall on one of these weekdays. Use {1,2,3,4,5} to exclude weekends. Empty set matches nothing.
Optional day-of-week restriction (ISO: Monday=1..Sunday=7). When set, the query filters out rows whose time-attribute does not fall on one of these weekdays. Use {1,2,3,4,5} to exclude weekends. Empty set matches nothing.
Nested aggregations for advanced sub-queries
Show child attributes
Show child attributes
Pagination token for next page of results
Deprecated: use timeAttributes instead. Single time attribute override as a fully-qualified path (e.g. 'pull_requests.date_closed').
Time attributes to use for queries. Each entry is a fully-qualified attribute path (e.g. 'pull_requests.date_closed'). The source is inferred from the prefix. For single-source queries, provide one entry. For multi-source, provide one per source to override.
Time attributes to use for queries. Each entry is a fully-qualified attribute path (e.g. 'pull_requests.date_closed'). The source is inferred from the prefix. For single-source queries, provide one entry. For multi-source, provide one per source to override.
Response
Successfully executed metrics query
Query metadata describing the structure of returned columns
Show child attributes
Show child attributes
Result rows, one array per grouping. Cells are positional: the value at index i corresponds to metadata.columns[i], and its JSON type follows that column's type (string, number, boolean, or null). Rows are not keyed by column name.
Result rows, one array per grouping. Cells are positional: the value at index i corresponds to metadata.columns[i], and its JSON type follows that column's type (string, number, boolean, or null). Rows are not keyed by column name.
[
["platform-team", 12.5, 30],
["payments-team", 8, 17]
]
[
["platform-team", 12.5, 30],
["payments-team", 8, 17]
]