Skip to content

metrics: Define how to deal with errors from deeply nested libs #3281

@lukedirtwalker

Description

@lukedirtwalker

We have some handlers that use libraries but are expected to provide detailed error information in the result label. This can be very hard to achieve and is probably brittle when the code changes.

For example #3106 requires a result label for path requests. But the path request handler uses segfetcher, which uses segverifier (which uses truststore), pathdb, etc. to define clearly distinguishable errors we would need to wrap all errors that are emited by the used libraries, and in a huge switch we would need to translate the error into a metric label.
Another issue is that sometimes there is not a strict 1 to 1 mapping, e.g. as a result of a path request there could be 10 segments received, but 5 fail to verify, in which case it isn't clear what the result label should state.

IMO it would make more sense to use a single ok/nok result label and for each lib have different error counters, e.g. verification_failures, db_failures, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c/observabilityMetrics, logging, tracingi/wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions