ORE Studio 0.0.4
Loading...
Searching...
No Matches
telemetry_log_entry.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2025 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_TELEMETRY_DOMAIN_TELEMETRY_LOG_ENTRY_HPP
21#define ORES_TELEMETRY_DOMAIN_TELEMETRY_LOG_ENTRY_HPP
22
23#include <chrono>
24#include <string>
25#include <optional>
26#include <boost/uuid/uuid.hpp>
27#include "ores.telemetry/domain/telemetry_source.hpp"
28
30
41struct telemetry_log_entry final {
45 boost::uuids::uuid id;
46
52 std::chrono::system_clock::time_point timestamp;
53
58
64 std::string source_name;
65
72 std::optional<boost::uuids::uuid> session_id;
73
79 std::optional<boost::uuids::uuid> account_id;
80
86 std::string level = "info";
87
93 std::string component;
94
98 std::string message;
99
105 std::string tag;
106
112 std::chrono::system_clock::time_point recorded_at;
113};
114
115}
116
117#endif
Domain types for telemetry and observability.
Definition attribute_value.hpp:29
telemetry_source
Source type for telemetry log entries.
Definition telemetry_source.hpp:33
@ client
Log entry from a client application.
A persisted telemetry log entry.
Definition telemetry_log_entry.hpp:41
std::string level
Log severity level.
Definition telemetry_log_entry.hpp:86
telemetry_source source
Source type (client or server).
Definition telemetry_log_entry.hpp:57
std::optional< boost::uuids::uuid > account_id
Account ID for authenticated logs.
Definition telemetry_log_entry.hpp:79
std::string message
The actual log message.
Definition telemetry_log_entry.hpp:98
std::chrono::system_clock::time_point timestamp
When the log was emitted by the source.
Definition telemetry_log_entry.hpp:52
std::chrono::system_clock::time_point recorded_at
Server receipt timestamp.
Definition telemetry_log_entry.hpp:112
std::string component
Logger/component name that emitted this log.
Definition telemetry_log_entry.hpp:93
std::string source_name
Name of the source application.
Definition telemetry_log_entry.hpp:64
boost::uuids::uuid id
Unique identifier for this log entry.
Definition telemetry_log_entry.hpp:45
std::optional< boost::uuids::uuid > session_id
Session ID for client logs.
Definition telemetry_log_entry.hpp:72
std::string tag
Optional tag for filtering.
Definition telemetry_log_entry.hpp:105