Instrumentation: Add status_source label to request metrics/logs (#74114)

Ref #68480

Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
This commit is contained in:
Marcus Efraimsson
2023-09-11 12:13:13 +02:00
committed by GitHub
co-authored by Giuseppe Guerra
parent 97d568e60a
commit 8ee43f3705
27 changed files with 487 additions and 67 deletions
+18
View File
@@ -0,0 +1,18 @@
package errutil
// Source identifies from where an error originates.
type Source string
const (
// SourceServer implies error originates from within the server, i.e. this application.
SourceServer Source = "server"
// SourceDownstream implies error originates from response error while server acting
// as a proxy, i.e. from a downstream service.
SourceDownstream Source = "downstream"
)
// IsDownstream checks if Source is SourceDownstream.
func (s Source) IsDownstream() bool {
return s == SourceDownstream
}