Skip to main content

Module component_metrics

Module component_metrics 

Source
Expand description

ComponentMetrics โ€” lever-gated facade for the uniform component-operations family (dashboard-observability Task 4.1).

Components call ComponentMetrics::observe at their principal operation boundary. The facade owns two concerns so individual components do not:

  • Lever gating: the [observability.metrics].components lever (default off, metrics-configuration Req 3) suppresses only the camel_component_operations_total family.
  • Unconditional error forwarding: failures always increment the non-disableable error family (camel_errors_total) as increment_errors(component, "e:{component}:{operation}") โ€” never lever-gated (metrics-configuration Req 2).

The lever arrives as a plain bool because camel-api cannot depend on camel-core, where MetricsLeversConfig lives: the construction site (camel-core, via the RuntimeObservability blanket impl) snapshots the current levers into the facade at build time.

Structsยง

ComponentMetrics
Facade over a MetricsCollector for uniform component-operation emission. Construct via RuntimeObservability::component_metrics() or directly in tests.