20#ifndef ORES_TELEMETRY_DOMAIN_RESOURCE_HPP
21#define ORES_TELEMETRY_DOMAIN_RESOURCE_HPP
26#include "ores.telemetry/domain/attribute_value.hpp"
61 std::optional<std::string>
host_name()
const;
66 std::optional<std::string>
host_id()
const;
79 std::string_view service_version);
Domain types for telemetry and observability.
Definition attribute_value.hpp:29
std::map< std::string, attribute_value > attributes
A collection of attributes as key-value pairs.
Definition attribute_value.hpp:52
Represents the entity producing telemetry data.
Definition resource.hpp:39
attributes attrs
Key-value pairs describing the resource.
Definition resource.hpp:51
std::optional< std::string > host_name() const
Gets the host name attribute if present.
Definition resource.cpp:39
std::optional< std::string > host_id() const
Gets the host ID (machine identifier) if present.
Definition resource.cpp:49
std::optional< std::string > service_name() const
Gets the service name attribute if present.
Definition resource.cpp:29
static resource from_environment(std::string_view service_name, std::string_view service_version)
Creates a resource by detecting the local environment.
Definition resource.cpp:59