userver
                                
                                
                                
                                    userver copied to clipboard
                            
                            
                            
                        Scoped tags for tracing::Span
Implement a tracing::ScopeTag for tracing::Span. The tracing::ScopeTag should add a tag to the current span for the lifetime of the  tracing::ScopeTag.
Add tests for the feature.
Internal ticket: 5164
tracing::TagScope
Hello @apolukhin . I would like to work on this issue.
Also I have a question about dealing with key collision. Consider following code:
Span s{"myspan"};
{
  ScopeTag low = s.AddScopeTag("key", "value");
  {
    ScopeTag high = s.AddScopeTag("key", "value2");
    LOG(DEBUG) << "something";
  }
  LOG(DEBUG) << "something";
}
I see 3 ways of designing this:
- The code snippet is valid, output is: first log: "key=value2" second log: "key=value"
 - Get an error trying to add second ScopeTag. Colliding keys are not allowed.
 - Ignore an attempt to add colliding key, output is: first log: "key=value" second log: "key=value"