Get edge HTTP traffic timeline
curl --request GET \
--url {schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge \
--header 'Authorization: Bearer <token>'import requests
url = "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge', 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 => "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge",
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 := "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge"
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("{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_grain": 60,
"_from": 1704067200,
"_to": 1704153600,
"_project_id": "abc123def456",
"_environment_id": "main",
"_environment_type": "production",
"_branch_machine_name": "main-bvxea6i",
"top_hits_timeline": {
"data": [
{
"timestamp": 1704067200,
"_total_count": 4120,
"response_size": 2097152,
"codes": {
"UNKNOWN": 0,
"1XX": 0,
"2XX": 3900,
"3XX": 150,
"4XX": 65,
"5XX": 5
}
}
]
}
}{
"type": "https://tools.ietf.org/html/rfc2616#section-1",
"title": "Please ensure parameters are correct.",
"status": 400,
"violations": {
"grain": [
"Grain can not be larger than the selection windows."
],
"from": [
"The from timestamp must be in the past."
],
"to": [
"The to timestamp must be greater than the from timestamp."
]
}
}{
"error": "Too much data fetched",
"message": "Please reduce the time range or add more filters to narrow down the query"
}Http Traffic
Get edge HTTP traffic timeline
Returns the HTTP requests and bandwidth seen by the global edge (Cloudflare) for the environment, including requests answered from the edge cache or blocked there. The grain is at least 60 seconds.
GET
/
projects
/
{projectId}
/
environments
/
{environmentId}
/
observability
/
http
/
edge
Get edge HTTP traffic timeline
curl --request GET \
--url {schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge \
--header 'Authorization: Bearer <token>'import requests
url = "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge', 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 => "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge",
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 := "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge"
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("{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/observability/http/edge")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_grain": 60,
"_from": 1704067200,
"_to": 1704153600,
"_project_id": "abc123def456",
"_environment_id": "main",
"_environment_type": "production",
"_branch_machine_name": "main-bvxea6i",
"top_hits_timeline": {
"data": [
{
"timestamp": 1704067200,
"_total_count": 4120,
"response_size": 2097152,
"codes": {
"UNKNOWN": 0,
"1XX": 0,
"2XX": 3900,
"3XX": 150,
"4XX": 65,
"5XX": 5
}
}
]
}
}{
"type": "https://tools.ietf.org/html/rfc2616#section-1",
"title": "Please ensure parameters are correct.",
"status": 400,
"violations": {
"grain": [
"Grain can not be larger than the selection windows."
],
"from": [
"The from timestamp must be in the past."
],
"to": [
"The to timestamp must be greater than the from timestamp."
]
}
}{
"error": "Too much data fetched",
"message": "Please reduce the time range or add more filters to narrow down the query"
}Authorizations
Path Parameters
Query Parameters
Response
Edge HTTP traffic timeline retrieved successfully
Was this page helpful?