Skip to content

Commit

Permalink
feat grpc: write meta_type and set log level in client logs
Browse files Browse the repository at this point in the history
feat grpc: “meta-type” tag added to client middleware log

Тесты: протестировано локально и в СИ.

Relates: <https://st.yandex-team.ru/>
commit_hash:de1a2f63827774510961b3a4b3d7d423bf14ea09
  • Loading branch information
nepritula committed Sep 23, 2024
1 parent e2e5850 commit 295530a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions grpc/src/ugrpc/client/middlewares/log/middleware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ class SpanLogger {
Middleware::Middleware(const Settings& settings) : settings_(settings) {}

void Middleware::PreStartCall(MiddlewareCallContext& context) const {
auto& span = context.GetSpan();
span.SetLocalLogLevel(settings_.log_level);

span.AddTag("meta_type", std::string{context.GetCallName()});

if (!IsSingleRequest(context.GetCallKind())) {
SpanLogger{context.GetSpan(), settings_.log_level}.Log(
"gRPC request stream started",
Expand Down

0 comments on commit 295530a

Please sign in to comment.