Projects
GetProjectMetrics
Get project metrics
Returns recent project metrics snapshots, optionally filtered by region.
Usage
result, err := client.Projects.GetProjectMetrics(ctx, "prj_xxx", nil)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ctx | context.Context | Yes | Request context |
| projectID | string | Yes | Unique project identifier (prefixed, e.g. prj_xxx). |
| params | *pgbeam.GetProjectMetricsParams | No | Query parameters |
| params.Limit | int | No | Maximum number of recent snapshots to return. |
| params.Region | string | No | Filter metrics by region code. |
Response
(*pgbeam.ProjectMetricsResponse, error) — metrics snapshots
Example
import pgbeam "github.com/pgbeam/pgbeam-go"
client := pgbeam.NewClient(&pgbeam.ClientOptions{
APIKey: "pgb_your_api_key",
})
result, err := client.Projects.GetProjectMetrics(ctx, "prj_xxx", &pgbeam.GetProjectMetricsParams{
Limit: 20,
Region: "...",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result)Errors
| Status | Description |
|---|---|
| 400 | Invalid request parameters. |
| 401 | Missing or invalid authentication. |
| 404 | Resource not found. |
| 429 | Rate limited. Try again later. |