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(
20 std::string_view trace_parent);
21
22utils::expected<std::string, std::string> BuildTraceParentHeader(
23 std::string_view trace_id, std::string_view span_id,
24 std::string_view trace_flags);
25
26} // namespace tracing::opentelemetry
27
28USERVER_NAMESPACE_END