curl --request GET \
--url https://api.streamkap.com/pipelines/{pipeline_id}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.streamkap.com/pipelines/{pipeline_id}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.streamkap.com/pipelines/{pipeline_id}/metrics', 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.streamkap.com/pipelines/{pipeline_id}/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.streamkap.com/pipelines/{pipeline_id}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.streamkap.com/pipelines/{pipeline_id}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.streamkap.com/pipelines/{pipeline_id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"latency": 123,
"recordsLag": 123,
"status": "<string>"
},
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Get Metrics For Pipeline
Retrieve metrics for a specific pipeline based on the provided parameters.
This endpoint returns latest metrics data for a given pipeline ID
- timesummary and timeseries will be supported soon, the time interval, and the time range. The response includes metadata about the metrics and is tailored to the specified time type.
Parameters:
- pipeline_id (path): The unique identifier of the pipeline for which metrics are requested.
- time_interval (query): The numeric interval between metrics data points (e.g., 1, 2, etc.).
- time_unit (query): The unit of time for the interval (e.g., minute, hour, day, week, month).
Combined with
time_intervalto define the granularity (e.g., 1 hour, 2 days). - timestamp_from (query, optional): The start time of the metrics data in UTC (ISO 8601 format, e.g.,
2025-03-02T07:10:15Z). Defaults to 24 hours before the current time if not provided. - timestamp_to (query, optional): The end time of the metrics data in UTC (ISO 8601 format). Defaults to the current time if not provided.
Authentication:
- Requires a valid user token with the
read:pipeline_metricspermission.
Returns:
PipelineLatestMetricsWithMetadata:latestmetrics.
Errors:
- 400 Bad Request: Invalid parameters or unexpected errors during processing.
- 404 Not Found: Metrics not found for the specified pipeline or connector plugin issues.
- 500 Internal Server Error: Connector plugin not found or misconfigured.
Example Request:
https://api.streamkap.com/pipelines/67bca128e1519efb914e6b51/metrics?time_interval=2&time_unit=hour×tamp_from=2025-03-02T07:10:15Z×tamp_to=2025-03-04T07:10:15Z
Example Response:
{
"data": {
"latency": 1,
"recordsLag": 0,
"status": "Active"
},
"metadata": {
"latency": {
"name": "Pipeline Latency",
"unit": "milliseconds"
},
"status": {
"name": "Pipeline Status",
"unit": "milliseconds"
},
"recordsLag": {
"name": "Lag in Events",
"unit": "count"
}
}
}
curl --request GET \
--url https://api.streamkap.com/pipelines/{pipeline_id}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.streamkap.com/pipelines/{pipeline_id}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.streamkap.com/pipelines/{pipeline_id}/metrics', 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.streamkap.com/pipelines/{pipeline_id}/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.streamkap.com/pipelines/{pipeline_id}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.streamkap.com/pipelines/{pipeline_id}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.streamkap.com/pipelines/{pipeline_id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"latency": 123,
"recordsLag": 123,
"status": "<string>"
},
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
The interval between each metrics data point.
1
The unit of the time interval. Combined with time_interval to determine the interval between each metrics data point. For example, if time_interval=1 and time_unit=hour, the interval between each metrics data point is 1 hour.
minute, hour, day, week, month "hour"
Start time of the metrics data in UTC timezone. If not provided, start time is set to 24 hours before the current time.
"2025-03-02T07:10:15Z"
End time of the metrics data in UTC timezone. If not provided, end time is set to the current time.
"2025-03-04T07:10:15Z"
Was this page helpful?