Create a new Operation Pattern Rule
/api/operation-pattern-rulesCreates a new user-defined Operation Pattern Rule. The server compiles spec.pattern
into its canonical representation and rejects it with 400 if it is malformed, exceeds
the placeholder/length limits, or is not specific enough (needs at least one
non-placeholder path segment). spec.ownership is always user_defined on create --
any client-supplied value is ignored.
The dataset query parameter is authoritative over metadata.labels["dash0.com/dataset"] in the
request body whenever both are present.
metadata.labels["dash0.com/origin"] is stamped per this API's standard
origin-stamping convention: a client-provided value wins; a machine-token caller that
omits it gets a server-generated api-<uuid> fallback; a UI (Clerk) or OAuth caller
that omits it keeps a null origin. A client-supplied origin that itself looks like a
UUID is rejected with 400.
Parameters 1
datasetqueryrequiredThe dataset to create the Pattern Rule in.
Optional dataset to query across. Defaults to whatever is configured to be the default dataset for the organization.
"^[a-zA-Z0-9_-]{3,26}$"Sample request123456789101112curl --request POST 'https://api.eu-west-1.aws.dash0.com/api/operation-pattern-rules?dataset=default' \--header "Authorization: Bearer ${DASH0_AUTH_TOKEN}" \--header 'Content-Type: application/json' \--data-raw '{"kind": "Dash0OperationPatternRule","metadata": {},"spec": {"serviceName": "example","pattern": "example","status": "active"}}'
Request body required
A Pattern Rule abstracts a high-cardinality span operation name (e.g. /users/1234)
into a templated one (e.g. /users/<userId>), so the collector's Operation Processor
can collapse matching operation names together. Rows are either authored by a human
through this API (spec.ownership: user_defined) or inferred by the Operation Miner
(spec.ownership: auto_derived).
Unlike most CRD-enveloped resources in this API, Pattern Rules have no independent,
user-editable display name, versioning, folder, or sharing concept -- metadata.name is
server-computed (see below). They are addressable either by their server-generated
metadata.labels["dash0.com/id"] or by metadata.labels["dash0.com/origin"] (an
IaC/Terraform-style stable label) -- see {originOrId} on each path below.
metadata.labels["dash0.com/dataset"]/spec.serviceNamespace/spec.serviceName identify
the partition (dataset + service) a rule belongs to, and are immutable once the rule is
created.
"Dash0OperationPatternRule"Responses
The created Operation Pattern Rule
A Pattern Rule abstracts a high-cardinality span operation name (e.g. /users/1234)
into a templated one (e.g. /users/<userId>), so the collector's Operation Processor
can collapse matching operation names together. Rows are either authored by a human
through this API (spec.ownership: user_defined) or inferred by the Operation Miner
(spec.ownership: auto_derived).
Unlike most CRD-enveloped resources in this API, Pattern Rules have no independent,
user-editable display name, versioning, folder, or sharing concept -- metadata.name is
server-computed (see below). They are addressable either by their server-generated
metadata.labels["dash0.com/id"] or by metadata.labels["dash0.com/origin"] (an
IaC/Terraform-style stable label) -- see {originOrId} on each path below.
metadata.labels["dash0.com/dataset"]/spec.serviceNamespace/spec.serviceName identify
the partition (dataset + service) a rule belongs to, and are immutable once the rule is
created.
"Dash0OperationPatternRule"