20#ifndef ORES_TELEMETRY_REPOSITORY_TELEMETRY_ENTITY_HPP
21#define ORES_TELEMETRY_REPOSITORY_TELEMETRY_ENTITY_HPP
26#include "sqlgen/Timestamp.hpp"
27#include "sqlgen/PrimaryKey.hpp"
38 constexpr static const char* schema =
"production";
39 constexpr static const char* tablename =
"telemetry_logs_tbl";
44 sqlgen::PrimaryKey<std::string>
id;
51 sqlgen::PrimaryKey<sqlgen::Timestamp<
"%Y-%m-%d %H:%M:%S">>
timestamp;
108 constexpr static const char* schema =
"production";
109 constexpr static const char* tablename =
"telemetry_stats_hourly_vw";
113 std::string source_name;
115 std::int64_t log_count = 0;
116 std::int64_t unique_sessions = 0;
117 std::int64_t unique_accounts = 0;
126 constexpr static const char* schema =
"production";
127 constexpr static const char* tablename =
"telemetry_stats_daily_vw";
131 std::string source_name;
132 std::string component;
134 std::int64_t log_count = 0;
135 std::int64_t unique_sessions = 0;
136 std::int64_t unique_accounts = 0;
std::basic_ostream< CharT, TraitsT > & operator<<(std::basic_ostream< CharT, TraitsT > &stream, boost_severity level)
Inserter for boost_severity enum.
Definition boost_severity.hpp:80
Database persistence layer for telemetry data.
Definition ores.telemetry.repository.hpp:36
Represents a telemetry log record in the database.
Definition telemetry_entity.hpp:37
std::string source
Source type ('client' or 'server').
Definition telemetry_entity.hpp:56
std::string level
Log severity level.
Definition telemetry_entity.hpp:79
std::string session_id
Session ID (empty string for no session).
Definition telemetry_entity.hpp:69
std::string message
Log message body.
Definition telemetry_entity.hpp:89
sqlgen::PrimaryKey< std::string > id
Log entry UUID - part of composite primary key.
Definition telemetry_entity.hpp:44
sqlgen::Timestamp<"%Y-%m-%d %H:%M:%S"> recorded_at
Server receipt timestamp.
Definition telemetry_entity.hpp:99
sqlgen::PrimaryKey< sqlgen::Timestamp<"%Y-%m-%d %H:%M:%S"> > timestamp
Log timestamp - part of composite primary key.
Definition telemetry_entity.hpp:51
std::string account_id
Account ID (empty string for no account).
Definition telemetry_entity.hpp:74
std::string component
Logger/component name.
Definition telemetry_entity.hpp:84
std::string source_name
Source application name.
Definition telemetry_entity.hpp:61
std::string tag
Optional tag for filtering.
Definition telemetry_entity.hpp:94
Entity for hourly telemetry statistics from continuous aggregates.
Definition telemetry_entity.hpp:107
Entity for daily telemetry statistics from continuous aggregates.
Definition telemetry_entity.hpp:125