liara_get_metrics
Retrieve application performance metrics and summary data from the Liara cloud platform to monitor resource usage and track operational health.
Instructions
Get app metrics summary
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appName | Yes | The name of the app | |
| period | No | Time period for metrics (optional) |
Implementation Reference
- src/services/observability.ts:8-23 (handler)The main handler function for the liara_get_metrics tool. It validates the app name, optionally adds a period parameter, and fetches the metrics summary from the Liara API endpoint /v1/projects/{appName}/metrics/summary./** * Get app metrics summary */ export async function getAppMetrics( client: LiaraClient, appName: string, period?: string ): Promise<MetricsSummary> { validateAppName(appName); const params: Record<string, string | number | boolean> | undefined = period ? { period } : undefined; return await client.get<MetricsSummary>( `/v1/projects/${appName}/metrics/summary`, params ); }
- src/api/types.ts:322-337 (schema)Type definitions for the metrics data structures used by the liara_get_metrics tool. AppMetrics defines the metric fields, and MetricsSummary wraps it with the period.// Metrics types export interface AppMetrics { cpu: number; memory: number; disk: number; network: { in: number; out: number; }; requests?: number; } export interface MetricsSummary { period: string; metrics: AppMetrics; }
- src/services/observability.ts:19-22 (helper)The core API call that retrieves the metrics data from Liara's observability endpoint.return await client.get<MetricsSummary>( `/v1/projects/${appName}/metrics/summary`, params );