-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload_util.hpp
More file actions
66 lines (57 loc) · 2.17 KB
/
Copy pathupload_util.hpp
File metadata and controls
66 lines (57 loc) · 2.17 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
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
//
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2025-Present Datadog, Inc.
#pragma once
#include <string>
#include <string_view>
#include "datadog/impl/core/types.hpp"
namespace datadog::impl {
/**
* Returns the host (i.e. hostname and port, if any) associated with the intake server
* for the given Datadog site (i.e. datacenter).
*/
std::string GetIntakeHost(Site site);
/**
* Given the relevant configuration options, returns the origin (i.e. protocol and host)
* to be used as the basis of all URLs for requests that upload SDK-generated event data
* to Datadog intake.
*/
std::string GetIntakeOrigin(Site site, std::string_view custom_endpoint_url);
/**
* Builds the string value used for the User-Agent header in all HTTP requests made by
* the SDK.
*/
std::string GetUserAgent(
std::string_view service,
std::string_view application_version,
std::string_view reporter_name,
std::string_view reporter_version,
std::string_view device_name,
std::string_view os_name,
std::string_view os_version
);
/**
* Builds the string value for the core set of 'ddtags' values used to label uploaded
* data, as a comma-separated string containing `key:value` pairs, with any occurrence
* of ',' or ':' stripped out of all input values.
*
* In this context, 'ddtags' refers to the fixed set of values used for unified service
* tagging, supplied with uploads in event payloads, typically in a top-level property
* called 'ddtags' on each event object. (These values are distinct from a separate set
* of values provided per-HTTP-request in a `?ddtags` query parameter, which shares the
* same name for historical reasons.)
*
* `tail`, if provided, represents an additional set of comma-delimited tag values to be
* concatenated with the result.
*/
std::string BuildDdTags(
std::string_view service,
std::string_view application_version,
std::string_view env,
std::string_view sdk_version,
std::string_view variant,
std::string_view tail = {}
);
} // namespace datadog::impl