-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathconfiguration.h
More file actions
76 lines (67 loc) · 2.73 KB
/
configuration.h
File metadata and controls
76 lines (67 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#pragma once
#include <datadog/config.h>
#include <datadog/expected.h>
#include <datadog/optional.h>
#include <datadog/telemetry/product.h>
#include <chrono>
#include <string>
#include <vector>
namespace datadog::telemetry {
struct Configuration {
// Enable or disable the telemetry module.
// Default: enabled.
// Can be overriden by the `DD_INSTRUMENTATION_TELEMETRY_ENABLED` environment
// variable.
tracing::Optional<bool> enabled;
// Enable or disable telemetry metrics.
// Default: enabled.
// Can be overriden by the `DD_TELEMETRY_METRICS_ENABLED` environment
// variable.
tracing::Optional<bool> report_metrics;
// Interval at which the metrics payload will be sent.
// Can be overriden by `DD_TELEMETRY_METRICS_INTERVAL_SECONDS` environment
// variable.
tracing::Optional<double> metrics_interval_seconds;
// Interval at which the heartbeat payload will be sent.
// Can be overriden by `DD_TELEMETRY_HEARTBEAT_INTERVAL` environment variable.
tracing::Optional<double> heartbeat_interval_seconds;
// Interval at which the extended heartbeat payload will be sent.
// Can be overriden by `DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL` environment variable.
tracing::Optional<double> extended_heartbeat_interval_seconds;
// `integration_name` is the name of the product integrating this library.
// Example: "nginx", "envoy" or "istio".
tracing::Optional<std::string> integration_name;
// `integration_version` is the version of the product integrating this
// library.
// Example: "1.2.3", "6c44da20", "2020.02.13"
tracing::Optional<std::string> integration_version;
// Enable or disable telemetry logs collection.
// Default: enabled.
// Can be overriden by the `DD_TELEMETRY_LOG_COLLECTION_ENABLED` environment
// variable.
tracing::Optional<bool> report_logs;
// List of products reported in the `app-started` message.
std::vector<Product> products;
};
struct FinalizedConfiguration {
bool debug;
bool enabled;
bool report_metrics;
bool report_logs;
std::chrono::steady_clock::duration metrics_interval;
std::chrono::steady_clock::duration heartbeat_interval;
std::chrono::steady_clock::duration extended_heartbeat_interval;
std::string integration_name;
std::string integration_version;
std::vector<Product> products;
// Onboarding metadata coming from `DD_INSTRUMENTATION_INSTALL_*` environment
// variables.
tracing::Optional<std::string> install_id;
tracing::Optional<std::string> install_type;
tracing::Optional<std::string> install_time;
friend tracing::Expected<FinalizedConfiguration> finalize_config(
const Configuration&);
};
tracing::Expected<FinalizedConfiguration> finalize_config(
const Configuration& = Configuration{});
} // namespace datadog::telemetry