Metrics commands
provide.foundation.integrations.openobserve.metrics_commands
¶
CLI commands for OpenObserve metrics integration.
These commands are auto-registered by Foundation's command discovery system.
Classes¶
Functions¶
info_command
¶
info_command(
client: OpenObserveClient | None,
ctx: Context,
metric_name: str | None,
format: str,
) -> None
Get metadata about metrics.
If metric_name is provided, shows metadata for that specific metric. Otherwise, shows metadata for all metrics.
Examples:
foundation openobserve metrics info foundation openobserve metrics info http_requests_total
Source code in provide/foundation/integrations/openobserve/metrics_commands.py
labels_command
¶
labels_command(
client: OpenObserveClient | None,
ctx: Context,
metric_name: str | None,
format: str,
) -> None
List label names for metrics.
If metric_name is provided, shows labels for that specific metric. Otherwise, shows all label names across all metrics.
Examples:
foundation openobserve metrics labels foundation openobserve metrics labels http_requests_total
Source code in provide/foundation/integrations/openobserve/metrics_commands.py
list_command
¶
List all available metrics.
Source code in provide/foundation/integrations/openobserve/metrics_commands.py
metrics_group
¶
Metrics command stub when click is not available.
Source code in provide/foundation/integrations/openobserve/metrics_commands.py
query_command
¶
query_command(
client: OpenObserveClient | None,
ctx: Context,
promql: str,
time: str | None,
format: str,
pretty: bool,
) -> None
Execute instant PromQL query.
Examples:
foundation openobserve metrics query "up" foundation openobserve metrics query "rate(http_requests_total[5m])" foundation openobserve metrics query "up" --format json --pretty
Source code in provide/foundation/integrations/openobserve/metrics_commands.py
query_range_command
¶
query_range_command(
client: OpenObserveClient | None,
ctx: Context,
promql: str,
start: str,
end: str,
step: str,
format: str,
pretty: bool,
) -> None
Execute PromQL range query over a time period.
Examples:
foundation openobserve metrics query-range "up" --start 1234567890 --end 1234567900 --step 10 foundation openobserve metrics query-range "rate(http_requests[5m])" -s "2024-01-01T00:00:00Z" -e "2024-01-01T01:00:00Z" --step "1m"
Source code in provide/foundation/integrations/openobserve/metrics_commands.py
values_command
¶
values_command(
client: OpenObserveClient | None,
ctx: Context,
label_name: str,
format: str,
) -> None
List values for a specific label.
Examples:
foundation openobserve metrics values job foundation openobserve metrics values instance foundation openobserve metrics values name