Hanzo
OpenapiO11y

Creates a volume-control rule for a metric and returns it with its id; a metric…

Creates a volume-control rule for a metric and returns it with its id; a metric that already has a rule is refused.

POST /v1/o11y/metric_reduction_rules

Addresshttps://api.hanzo.ai/v1/o11y/metric_reduction_rules
MethodPOST
OperationCreateMetricReductionRule
AuthAuthorization: Bearer $HANZO_API_KEY

Creates a volume-control rule for a metric and returns it with its id; a metric that already has a rule is refused.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
labelsbodystring[]yesLabels are the label names the rule matches.
matchTypebodystringyesMatchType is drop or keep: drop the named labels, or keep only them.
metricNamebodystringyesMetricName is the metric the rule governs; one rule per metric.

Response

StatusBodyMeaning
201o11y.O11yReductionRuleOutcreated

201 body — 16 fields.

FieldInTypeAlwaysDescription
databodyo11y.O11yReductionRule
data.activebodybooleanActive says whether the rule is in force.
data.createdAtbodystring (date-time)CreatedAt is when the rule was created.
data.createdBybodystringCreatedBy is who created it.
data.effectiveFrombodystring (date-time)EffectiveFrom is when the rule took effect.
data.idbodystringID is the rule's id.
data.ingestedSamplesbodyintegerIngestedSamples is how many samples arrived while the rule was active.
data.ingestedSeriesbodyintegerIngestedSeries is how many series arrived while the rule was active.
data.labelsbodystring[]Labels are the label names the rule matches.
data.matchTypebodystringMatchType is drop or keep.
data.metricNamebodystringMetricName is the metric the rule governs.
data.retainedSamplesbodyintegerRetainedSamples is how many of them were kept.
data.retainedSeriesbodyintegerRetainedSeries is how many of them were kept.
data.updatedAtbodystring (date-time)UpdatedAt is when the rule last changed.
data.updatedBybodystringUpdatedBy is who last changed it.
statusbodystringStatus is "success".

Failure carries the platform error shape — see Errors.

Examples

hanzo o11y metric_reduction_rules create \
  --labels '["<labels>"]' \
  --match-type <matchType> \
  --metric-name <metricName>

O11y API · All Hanzo APIs · Interactive reference

How is this guide?

On this page