Skip to content

Commit cbaf74e

Browse files
Create noop_tracer.h
1 parent fad89b4 commit cbaf74e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#pragma once
2+
3+
#include <ydb-cpp-sdk/client/tracing/tracer.h>
4+
5+
namespace NYdb::inline V3 {
6+
namespace NTracing {
7+
8+
class TNoopSpan : public ISpan {
9+
public:
10+
void AddAttribute(const std::string&, const std::string&) override {}
11+
void End() override {}
12+
};
13+
14+
class TNoopTracer : public ITracer {
15+
public:
16+
std::unique_ptr<ISpan> StartSpan(const std::string&) override {
17+
return std::make_unique<TNoopSpan>();
18+
}
19+
};
20+
21+
} // namespace NTracing
22+
} // namespace NYdb

0 commit comments

Comments
 (0)