Commit e11aa016 authored by Jacob Vosmaer's avatar Jacob Vosmaer 👋 Committed by Bob Van Landuyt
Browse files

Add grpc.start_time to gRPC logging

parent 3609c357
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ module Labkit
        ensure
          service_name, method_name = rpc_split(method)
          message = @default_tags.merge(
            'grpc.start_time': start.utc.rfc3339,
            'grpc.time_ms': ((Time.now - start) * 1000.0).truncate(3),
            'grpc.code': CODE_STRINGS.fetch(code, code.to_s),
            'grpc.method': method_name,
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ describe Labkit::Logging::GRPC::ServerInterceptor do

        expect(result["correlation_id"]).to match(/[0-9a-f]{10}/)
        expect(result["time"]).to match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z$/)
        expect(result["grpc.start_time"]).to match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$/)

        time_ms = result["grpc.time_ms"]
        expect(time_ms).to be_a Float