Get HTTP function traffic
GET
/api/v1/projects/{id}/functions/{functionId}/http-stats
const url = 'https://api.deploybase.eu/api/v1/api/v1/projects/example/functions/example/http-stats';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.deploybase.eu/api/v1/api/v1/projects/example/functions/example/http-stats \ --header 'Authorization: <Authorization>'Returns a kind=http function’s requests, p50/p99 latency and 5xx rate over the last 24 hours, as the HTTP router counted them. When the metrics backend cannot be asked, available is false and reason says why; the request still succeeds. available=true with requests_24h=0 means the function had no traffic.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” id
required
string
Project ID
functionId
required
string
Function ID
Responses
Section titled “ Responses ”OK
Media type application/json
object
data
meta
object
request_id
string
timestamp
string
trace_id
string
data
object
available
boolean
error_rate_5xx
number
p50_ms
number
p99_ms
number
reason
string
requests_24h
integer
window_hours
integer
Example generated
{ "data": { "available": true, "error_rate_5xx": 1, "p50_ms": 1, "p99_ms": 1, "reason": "example", "requests_24h": 1, "window_hours": 1 }, "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Bad Request
Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Unauthorized
Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Function not found
Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Internal Server Error
Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{ "code": "example", "details": "example", "error": "example", "meta": { "request_id": "example", "timestamp": "example", "trace_id": "example" }}Live 174db30c built