Skip to content

allow observability operation error filter to choose error output destination(s)

Warren Gifford requested to merge nsc/observation-error-filter-enum into main

Created by: Strum355

This PR allows for the observability operation error filter to elect to have certain errors only redirected to certain outputs e.g. only add the error to the trace and metric counter but not to logs. By returning a bitfield uint8, one can have any combination of output redirection:

  • observation.EmitForTraces | observation.EmitForMetrics to have an error tracked in metrics and attached to the opentracing span but not printed to logs
  • observation.EmitForAll to emit to all 3 destinations (akin to return false from previous behaviour)
  • observation.EmitForNone to not emit anywhere (akin to return true from previous behaviour)
  • etc etc...

Use case arose from https://github.com/sourcegraph/sourcegraph/pull/23720 where I wanted the above behaviour.

Merge request reports

Loading