Dash0 acquires Polar Signals

Manage Sampling Rules

Update or create a sampling rule by origin or ID

put/api/sampling-rules/{originOrId}

Updates an existing sampling rule or creates a new one if it doesn't exist. Useful for Infrastructure-as-Code workflows.

Parameters 2

originOrIdpathrequired

Sampling rule origin or UUID

string
datasetquery
References Dataset

Optional dataset to query across. Defaults to whatever is configured to be the default dataset for the organization.

stringpattern "^[a-zA-Z0-9_-]{3,26}$"
bash
Sample request
1234567891011121314151617181920212223242526272829303132333435363738394041424344
curl --request PUT 'https://api.eu-west-1.aws.dash0.com/api/sampling-rules/123e4567-e89b-42d3-a456-426614174000' \
--header "Authorization: Bearer ${DASH0_AUTH_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
"kind": "Dash0Sampling",
"metadata": {
"name": "Example"
},
"spec": {
"enabled": true,
"conditions": {
"kind": "and",
"spec": {
"conditions": [
{
"kind": "and",
"spec": {
"conditions": [
{
"kind": "and",
"spec": {
"conditions": [
{
"kind": "and",
"spec": {
"conditions": [
{
"kind": "error",
"spec": {}
}
]
}
}
]
}
}
]
}
}
]
}
}
}
}'

Request body required

stringrequired
"Dash0Sampling"
SamplingMetadatarequired
SamplingSpecrequired

Responses

The updated or created sampling rule

stringrequired
"Dash0Sampling"
SamplingMetadatarequired
SamplingSpecrequired