userver: userver/tracing/opentelemetry.hpp Source File
Loading...
Searching...
No Matches
opentelemetry.hpp
1#pragma once
2
3#include <string>
4
5#include <userver/utils/expected.hpp>
6#include <userver/utils/strong_typedef.hpp>
7
8USERVER_NAMESPACE_BEGIN
9
10namespace tracing::opentelemetry {
11
12struct TraceParentData {
13 std::string version;
14 std::string trace_id;
15 std::string span_id;
16 std::string trace_flags;
17};
18
19utils::expected<TraceParentData, std::string> ExtractTraceParentData(std::string_view trace_parent);
20
21utils::expected<std::string, std::string>
22BuildTraceParentHeader(std::string_view trace_id, std::string_view span_id, std::string_view trace_flags);
23
24} // namespace tracing::opentelemetry
25
26USERVER_NAMESPACE_END