From f4b03d7e40c785c2ac6f49359f1c7a95bc09ba12 Mon Sep 17 00:00:00 2001 From: Vladislav Veselskiy Date: Mon, 15 Apr 2024 13:48:15 +0300 Subject: [PATCH] Add span attrs "client_ver" and "client_platform". --- server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.go b/server.go index 99f06c5..f3faba3 100644 --- a/server.go +++ b/server.go @@ -102,6 +102,12 @@ func (server *RPCServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { versionHeader := r.Header.Get(server.versionHeader) cltVersion, cltPlatform := parseVersionHeader(versionHeader) cltIP := GetIP(r) + + span.SetAttributes( + attribute.String("client_ver", cltVersion), + attribute.Int("client_platform", cltPlatform), + ) + server.logger.V(1).Info("New request", "client_ver", cltVersion) payload, err := readRequestBody(ctx, r.Body)