Drop noisy spans and expected errors from Maple.layer
Maple.layer now takes the same span options as MapleFlush.make, plus subtree drops and predicates for both.
Maple.layer, the long-running preset in @maple-dev/effect-sdk, now accepts the span options
that were only on MapleFlush.make and the Cloudflare make. All three presets take the same
options and classify spans the same way.
dropSpanNamesdrops spans by name prefix, as before. Only the matching span goes.dropSpanSubtreesdrops a span and every span under it, so an idle polling loop and the queries it runs stop exporting. Outgoing calls under a dropped span carry an unsampledtraceparent, and errors inside it are not tracked, so keep real work outside it.dropSpantakes a predicate on the finished span (name, kind, attributes, exit), for example to drop only polls that found nothing.anticipatedErrorIdentifiersmarks expected failures (a duplicate, a not-found) asOkwith no exception, so they stop creating error groups.isAnticipatedErroris its predicate form, for driver errors that are only expected in one case.excludeLogSpansis now available onMaple.layertoo.
A few behaviour changes come with it:
- A server span that answered 5xx stays an error even when its failure is listed as anticipated.
- On
Maple.layer, spans for unmatched-route 404s are dropped, and server spans that rendered a 5xx response are recorded as errors, matching the other presets. That can surface new error groups for crashes that used to export asOk.
Upgrade to @maple-dev/effect-sdk 0.11.0.