mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 01:12:12 +00:00
aee034a597
- Move some code into module part to avoid dependency from IStorage in SystemLog - Remove extra headers from SystemLog.h - Rewrite some code that was relying on headers that was included by SystemLog.h v2: rebase v3: squash move into module part with explicit template instantiation (to make each commit self compilable after rebase)
52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <Interpreters/SystemLog.h>
|
|
#include <Core/NamesAndTypes.h>
|
|
#include <Core/NamesAndAliases.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
struct OpenTelemetrySpan
|
|
{
|
|
UUID trace_id;
|
|
UInt64 span_id;
|
|
UInt64 parent_span_id;
|
|
std::string operation_name;
|
|
UInt64 start_time_us;
|
|
UInt64 finish_time_us;
|
|
Array attribute_names;
|
|
Array attribute_values;
|
|
// I don't understand how Links work, namely, which direction should they
|
|
// point to, and how they are related with parent_span_id, so no Links for
|
|
// now.
|
|
};
|
|
|
|
struct OpenTelemetrySpanLogElement : public OpenTelemetrySpan
|
|
{
|
|
OpenTelemetrySpanLogElement() = default;
|
|
OpenTelemetrySpanLogElement(const OpenTelemetrySpan & span)
|
|
: OpenTelemetrySpan(span) {}
|
|
|
|
static std::string name() { return "OpenTelemetrySpanLog"; }
|
|
static NamesAndTypesList getNamesAndTypes();
|
|
static NamesAndAliases getNamesAndAliases();
|
|
void appendToBlock(MutableColumns & columns) const;
|
|
};
|
|
|
|
// OpenTelemetry standartizes some Log data as well, so it's not just
|
|
// OpenTelemetryLog to avoid confusion.
|
|
class OpenTelemetrySpanLog : public SystemLog<OpenTelemetrySpanLogElement>
|
|
{
|
|
public:
|
|
using SystemLog<OpenTelemetrySpanLogElement>::SystemLog;
|
|
};
|
|
|
|
struct OpenTelemetrySpanHolder : public OpenTelemetrySpan
|
|
{
|
|
OpenTelemetrySpanHolder(const std::string & _operation_name);
|
|
~OpenTelemetrySpanHolder();
|
|
};
|
|
|
|
}
|