Interfaces#
plone.observability registers all of its components through the Zope Component Architecture. Third-party packages extend or replace any of them. This page describes the interfaces. These pages show how to register implementations: How to add a custom health check, How to add a custom metric provider, and How to add a custom metric formatter.
ILivenessCheck#
A named utility that reports whether the process is fundamentally alive.
A liveness check must not access ZODB and must not block.
Member |
Description |
|---|---|
|
The check name, reported in the |
|
Returns a |
IReadinessCheck#
A named utility that reports whether the process can serve requests.
A readiness check may access ZODB.
Member |
Description |
|---|---|
|
The check name, reported in the |
|
Returns a |
IMetricProvider#
An adapter on OFS.interfaces.IApplication that yields metrics.
Member |
Description |
|---|---|
|
The provider name, used for registration. |
|
Default scope for the provider’s metrics, |
|
A generator yielding |
IMetricFormatter#
A named utility that serializes metrics to a wire format.
Member |
Description |
|---|---|
|
The MIME type of the produced output. |
|
Returns the serialized string for an iterable of |
The formatter name is selected with the format query-string parameter on @@metrics.
Metric#
The value object yielded by metric providers.
Field |
Description |
|---|---|
|
The metric name, for example |
|
The numeric value. |
|
The metric type: |
|
|
|
A human-readable description. |
|
A dictionary of label names and values. Default: empty. |
The Prometheus text format has no info type.
A metric with type="info" makes Prometheus reject the whole scrape.
Report version or build information as a gauge with the value 1 and the details in labels, as plone_info does.
A histogram is reported as counters named <name>_bucket with an le label, <name>_sum, and <name>_count.
Import it from plone.observability.metric.
start_span#
A dependency-optional helper for opening custom trace spans.
It is a no-op when the opentelemetry extra is not installed.
See Tracing.