Skip to content

API Reference parrot.handlers.metric_definitions

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.handlers.metric_definitions

View source

REST lane of the FEAT-756 metric registry: /api/v1/metrics[/schema|/{metric_id}].

Alias MetricDefinition

Re-exported from parrot.metrics.MetricDefinition.

Class MetricDefinitionsHandler

REST lane of the metric registry (UISurfacesHandler idiom: one view, dispatch on match_info/path).

Attributes:

Attribute Type Description
store PgMetricDefinitionStore app["metric_definitions_store"] or a lazily created PgMetricDefinitionStore().

Method MetricDefinitionsHandler.post_init

Create the handler logger.

post_init(*args: Any, **kwargs: Any) -> None

Parameter Type Default Description
*args Any ()
**kwargs Any {}

Method MetricDefinitionsHandler.get

/schema → JSON Schema; {metric_id} → 200 | 404; list → store.list_visible(scope, program=).

get() -> web.Response

Returns: web.Response

Method MetricDefinitionsHandler.post

Create: 401/403/422 gates; tenant := scope.tenant; global needs is_superuser; 409 duplicate; 201.

post() -> web.Response

Returns: web.Response

Method MetricDefinitionsHandler.put

Replace: same gates; owner or may_administer only; 404 when absent; 200.

put() -> web.Response

Returns: web.Response

Alias MetricVersionConflict

Re-exported from parrot.handlers.models.metric_definitions.MetricVersionConflict.

Alias MetricView

Re-exported from parrot.metrics.registry.MetricView.

Alias PgMetricDefinitionStore

Re-exported from parrot.handlers.models.metric_definitions.PgMetricDefinitionStore.

Alias RequestScope

Re-exported from parrot.handlers.scope.RequestScope.

Class UpsertMetricRequest

definition: dict — a MetricDefinition WITHOUT tenant / owner (server-set; 422 when present).

Fields:

Field Type Default Description
definition dict[str, Any]

Alias get_scope_resolver

Re-exported from parrot.handlers.scope.get_scope_resolver.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally