Get function metric aggregates
Returns aggregate request, latency, CPU, memory, and resource-limit metrics for a function over the requested window.
GET
/
compute
/
funcs
/
{id}
/
metric_aggregates
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.compute.funcs.retrieveMetricAggregates('id');
console.log(response.meta);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.compute.funcs.retrieve_metric_aggregates(
"id",
)
print(response.meta)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Compute.Funcs.GetMetricAggregates(
context.TODO(),
"id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var response = client.compute().funcs().retrieveMetricAggregates("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.compute.funcs.retrieve_metric_aggregates("id")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->compute->funcs->retrieveMetricAggregates(
'id',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx compute:funcs retrieve-metric-aggregates \
--api-key 'My API Key' \
--id idcurl --request GET \
--url https://api.telnyx.com/v2/compute/funcs/{id}/metric_aggregates \
--header 'Authorization: Bearer <token>'{
"meta": {
"total_pages": 1,
"total_results": 1,
"page_number": 1,
"page_size": 20
},
"data": [
{
"record_type": "edge_compute_function_metric_aggregate",
"product": "edge_compute",
"start_time": "2026-09-08T16:00:00.000Z",
"end_time": "2026-09-09T16:00:00.000Z",
"function_id": "01998f0a-1111-7777-8888-123456789abc",
"function_name": "my-func",
"request_count": 1250,
"request_success_rate": 0.982,
"request_client_error_rate": 0.012,
"request_error_rate": 0.006,
"request_latency_p50_ms": 8.4,
"request_latency_p95_ms": 21.7,
"request_latency_p99_ms": 44.2,
"request_latency_avg_ms": 10.1,
"cpu_used_cores_avg": 0.03,
"cpu_used_cores_max": 0.18,
"memory_used_bytes_avg": 67108864,
"memory_used_bytes_max": 94371840
}
]
}Authorizations
Query Parameters
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.compute.funcs.retrieveMetricAggregates('id');
console.log(response.meta);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.compute.funcs.retrieve_metric_aggregates(
"id",
)
print(response.meta)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Compute.Funcs.GetMetricAggregates(
context.TODO(),
"id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var response = client.compute().funcs().retrieveMetricAggregates("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.compute.funcs.retrieve_metric_aggregates("id")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->compute->funcs->retrieveMetricAggregates(
'id',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx compute:funcs retrieve-metric-aggregates \
--api-key 'My API Key' \
--id idcurl --request GET \
--url https://api.telnyx.com/v2/compute/funcs/{id}/metric_aggregates \
--header 'Authorization: Bearer <token>'{
"meta": {
"total_pages": 1,
"total_results": 1,
"page_number": 1,
"page_size": 20
},
"data": [
{
"record_type": "edge_compute_function_metric_aggregate",
"product": "edge_compute",
"start_time": "2026-09-08T16:00:00.000Z",
"end_time": "2026-09-09T16:00:00.000Z",
"function_id": "01998f0a-1111-7777-8888-123456789abc",
"function_name": "my-func",
"request_count": 1250,
"request_success_rate": 0.982,
"request_client_error_rate": 0.012,
"request_error_rate": 0.006,
"request_latency_p50_ms": 8.4,
"request_latency_p95_ms": 21.7,
"request_latency_p99_ms": 44.2,
"request_latency_avg_ms": 10.1,
"cpu_used_cores_avg": 0.03,
"cpu_used_cores_max": 0.18,
"memory_used_bytes_avg": 67108864,
"memory_used_bytes_max": 94371840
}
]
}