Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
|
2b8897470c | |
|
0af53f260d | |
|
b72ff3ffe8 |
21
server.go
21
server.go
|
@ -104,16 +104,29 @@ func (server *RPCServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
cltIP := GetIP(r)
|
cltIP := GetIP(r)
|
||||||
|
|
||||||
span.SetAttributes(
|
span.SetAttributes(
|
||||||
attribute.String("request_method", r.Method),
|
attribute.String("request.method", r.Method),
|
||||||
attribute.String("request_proto", r.Proto),
|
attribute.String("request.proto", r.Proto),
|
||||||
attribute.Int("request_proto_major", r.ProtoMajor),
|
attribute.Int("request.proto_major", r.ProtoMajor),
|
||||||
attribute.Int("request_proto_minor", r.ProtoMinor),
|
attribute.Int("request.proto_minor", r.ProtoMinor),
|
||||||
|
attribute.Int64("request.content_length", r.ContentLength),
|
||||||
|
attribute.String("request.host", r.Host),
|
||||||
|
attribute.String("request.remote_addr", r.RemoteAddr),
|
||||||
|
attribute.String("request.request_uri", r.RequestURI),
|
||||||
attribute.String("client_ver", cltVersion),
|
attribute.String("client_ver", cltVersion),
|
||||||
attribute.Int("client_platform", cltPlatform),
|
attribute.Int("client_platform", cltPlatform),
|
||||||
attribute.String("client_ip", cltIP.String()),
|
attribute.String("client_ip", cltIP.String()),
|
||||||
attribute.Bool("can_gzip", canGzip),
|
attribute.Bool("can_gzip", canGzip),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if url := r.URL; url != nil {
|
||||||
|
span.SetAttributes(
|
||||||
|
attribute.String("request.url.scheme", url.Scheme),
|
||||||
|
attribute.String("request.url.host", url.Host),
|
||||||
|
attribute.String("request.url.path", url.Path),
|
||||||
|
attribute.String("request.url.raw_query", url.RawQuery),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
|
Loading…
Reference in New Issue