Add span attrs "client_ver" and "client_platform".

This commit is contained in:
Владислав Весельский 2024-04-15 13:48:15 +03:00
parent ad59658962
commit f4b03d7e40
1 changed files with 6 additions and 0 deletions

View File

@ -102,6 +102,12 @@ func (server *RPCServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
versionHeader := r.Header.Get(server.versionHeader) versionHeader := r.Header.Get(server.versionHeader)
cltVersion, cltPlatform := parseVersionHeader(versionHeader) cltVersion, cltPlatform := parseVersionHeader(versionHeader)
cltIP := GetIP(r) 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) server.logger.V(1).Info("New request", "client_ver", cltVersion)
payload, err := readRequestBody(ctx, r.Body) payload, err := readRequestBody(ctx, r.Body)