Skip to content

Sampling advisor

Skep does not sample your data. Your sampler does: Honeycomb Refinery or the OpenTelemetry Collector’s tail_sampling processor. The sampling advisor writes that sampler’s configuration for you, from what you say sampling must protect and what it may cost, and shows what the change does to cost and to the questions you can answer before you apply it.

You find it under Policy, Sampling, with four tabs: Intent & simulation, Snapshots, Boosts and Delivery.

Each environment has one sampling intent: a short YAML document that says what to protect and what you can spend. With nothing saved, Skep uses a built-in default. Its spec looks like this:

spec:
target: otel_tail_sampling # or refinery
# budget: { kind: spend, target: 42000, per: month, tolerance: 0.1 }
protect:
questions: [is_it_erroring_and_where, why_is_it_slow, did_the_deploy_cause_it]
floors: from_policy # organization policy sampling floors and keep_on
novelty: { keep_first: 50 } # new versions kept at full rate up to a quota
keys:
- { name: route_status, fields: [service.name, http.route, http.response.status_code] }
boosts:
allow_from: [api, mcp, ui]
max_duration: 2h
max_concurrent: 10
ramp: { max_rate_change_per_apply: 2.0 }
default_rate: 10 # keep 1 in 10 of unprotected traffic when no budget is set
Field What it does
target refinery or otel_tail_sampling.
budget Optional monthly spend target, priced with your rate card.
protect.questions Catalog questions sampling must keep answerable. See Readiness and health.
protect.floors from_policy applies the sampling floors and keep_on rules (errors, outliers, new versions) from your organization policy.
protect.novelty Keeps the first traces of each new version at full rate.
keys The fields that define a bucket. Keys with more than 200 values are rejected, with a suggestion.
boosts Who can request boosts in this environment, for how long, and how many at once.
ramp How far any rate may move in one apply. The default is 2x.
default_rate Keep 1 in N of unprotected traffic when there is no budget.

Rates are “keep 1 in N”, the same as Refinery’s sample rate.

The advisor resolves the intent against the pre-sampling data, with no model involved:

  • it protects the buckets the chosen questions need;
  • it fits the budget, keeping rare traffic at higher rates;
  • it limits how fast rates change between applies.

The result is a set of rules (boost, error, slow, version, floor, bucket, service default and default) compiled to:

  • Refinery rules (TOML, rules version 2);
  • OpenTelemetry tail_sampling YAML, validated by the real Collector. It includes a transform processor right after tail_sampling that stamps each span with its sample rate, so counts in your backend and in Skep stay correct.

Each compile comes with a fidelity report: what that target cannot express exactly. The rule set stays bounded: a service with more than 100 distinct routes gets rules per status class instead of per route, and latency rules cover at most the 20 busiest routes.

Simulate runs the intent (saved or edited) against current traffic without changing anything. It shows:

  • the projected monthly spend next to the current spend, and whether the budget is feasible;
  • each protected question’s status before and after;
  • blind spots the plan would leave;
  • keys rejected for high cardinality;
  • per bucket keep rates and traces per hour, before and after.

Every projection is an estimate and is labeled as one. Agents run the same simulation with simulate_sampling_intent.

Compiling an intent produces a snapshot: the compiled configuration, its projection and a diff against the previous one. Only one snapshot is applied at a time per environment. Applying one supersedes the last. Rolling back creates a new snapshot with the configuration from before and delivers it the same way.

Mode What applying does Plan
Advise (default) Records the snapshot. You copy the configuration into your sampler yourself. Every plan
Manage Delivers the snapshot to your sampler through the environment’s delivery method, with ramp limits and rollback. Plus plan

In both modes, a person needs the sampling:enforce permission (admins have it) to apply or roll back a snapshot.

While your sampler shows stress (traces evicted before their decision, memory near its limit, a slow decision timer, or Refinery stress relief), Skep raises SAMPLER_STRESS and pauses manage mode applies. Rollbacks and boost expiries still go through.

In manage mode, each environment’s sampler has one delivery method. An admin sets it under Policy, Sampling, Delivery:

Delivery Target How it works
Fleet revision (OpAMP) tail_sampling Skep renders the sampler into the revisions of the gateway fleets you choose and deploys them. The snapshot is applied when every fleet runs it. Only gateway fleets running the Skep distribution with a profile qualify.
Rules URL Refinery Refinery fetches its rules from Skep at /v1/sampling/refinery/{env_id}/rules.toml. A delivery token, shown once, goes in the X-Honeycomb-Team header that Refinery sends.
Git pull request Either Skep commits the compiled file to a path in your repository and opens a pull request. Your review decides the merge. A read-only repository gets a patch instead. See Config sources.
Webhook Either Skep posts the snapshot to your HTTPS endpoint, signed with X-Skep-Signature.

A failed delivery keeps the previous snapshot applied, answers 502 delivery_failed, and raises SAMPLING_APPLY_FAILED until the next successful apply.

A boost raises the keep rate for a narrow scope for a short time, for example while you investigate one route. The scope is a service, plus an optional route, status class, or attribute value. You see its estimated cost before it starts.

  • A boost lasts at most max_duration (2 hours by default), with at most 10 active at once by default.
  • When it expires, Skep recompiles the plan without it. If the sampler still seems to keep the boosted rate afterward, Skep raises BOOST_EXPIRY_UNCONFIRMED.
  • Requesting a boost needs the sampling:boost permission (editors and admins have it).

Agents use the same advisor over MCP: get_sampling_intent, simulate_sampling_intent, suggest_sampling_keys, request_sampling_boost and cancel_sampling_boost. What they may do without a person depends on your approval rules:

Agent action Default
Request a boost Allowed within the boost caps
Apply a sampler snapshot Needs a person’s approval
Deploy a fleet revision that carries the sampler Always needs a person with fleet:deploy

An agent’s request that needs a person answers 202 with status: pending_approval and waits under Agents, Approvals. Approving a sampler change also needs sampling:enforce. See Agents and approvals.

Skep · Security · Changelog · Privacy