Skip to content

Add observability utilities

Administrator requested to merge internal-observability-utils into master

Created by: efritz

Add PrepObservation to help writing decorators around interfaces that observe (logs, metrics, and tracing) operations. Currently repoupdater is the only service (of which I'm aware) that decorates structs in this way, but it seems like a very good idea.

The precise code intel services are beginning to follow the same technique. I'm open to the proposal of this PR as I'd like the use of this function to be common in this codebase.

For a sample usage, see one of the four observable.go files in https://github.com/sourcegraph/sourcegraph/pull/10311.

If it's sufficiently expressive, repoupdater should be updated to use this function. If not, then its functionality should be expanded so it covers the current required cases.

Merge request reports

Loading