File tree 7 files changed +45
-27
lines changed
cue/reference/components/sinks/base
7 files changed +45
-27
lines changed Original file line number Diff line number Diff line change @@ -91,23 +91,18 @@ impl DatadogLogsConfig {
91
91
// TODO: We should probably hoist this type of base URI generation so that all DD sinks can
92
92
// utilize it, since it all follows the same pattern.
93
93
fn get_uri ( & self ) -> http:: Uri {
94
- let endpoint = self
95
- . dd_common
96
- . endpoint
97
- . clone ( )
98
- . or_else ( || {
99
- Some ( format ! (
100
- "https://http-intake.logs.{}/api/v2/logs" ,
101
- self . dd_common. site
102
- ) )
103
- } )
104
- . unwrap_or_else ( || match self . region {
105
- Some ( Region :: Eu ) => "https://http-intake.logs.datadoghq.eu/api/v2/logs" . to_string ( ) ,
106
- None | Some ( Region :: Us ) => {
107
- "https://http-intake.logs.datadoghq.com/api/v2/logs" . to_string ( )
94
+ let base_url = self . dd_common . endpoint . clone ( ) . unwrap_or_else ( || {
95
+ if let Some ( region) = self . region {
96
+ match region {
97
+ Region :: Eu => "https://http-intake.logs.datadoghq.eu" . to_string ( ) ,
98
+ Region :: Us => "https://http-intake.logs.datadoghq.com" . to_string ( ) ,
108
99
}
109
- } ) ;
110
- http:: Uri :: try_from ( endpoint) . expect ( "URI not valid" )
100
+ } else {
101
+ format ! ( "https://http-intake.logs.{}" , self . dd_common. site)
102
+ }
103
+ } ) ;
104
+
105
+ http:: Uri :: try_from ( format ! ( "{}/api/v2/logs" , base_url) ) . expect ( "URI not valid" )
111
106
}
112
107
113
108
fn get_protocol ( & self ) -> String {
Original file line number Diff line number Diff line change @@ -36,8 +36,9 @@ pub(crate) fn default_site() -> String {
36
36
pub struct DatadogCommonConfig {
37
37
/// The endpoint to send observability data to.
38
38
///
39
- /// The endpoint must contain an HTTP scheme, and may specify a
40
- /// hostname or IP address and port.
39
+ /// The endpoint must contain an HTTP scheme, and may specify a hostname or IP
40
+ /// address and port. The API path should NOT be specified as this is handled by
41
+ /// the sink.
41
42
///
42
43
/// If set, overrides the `site` option.
43
44
#[ configurable( metadata( docs:: advanced) ) ]
Original file line number Diff line number Diff line change 2
2
date : " 2023-09-26"
3
3
title : " 0.33 Upgrade Guide"
4
4
description : " An upgrade guide that addresses breaking changes in 0.33.0"
5
- authors : ["spencergilbert"]
5
+ authors : ["spencergilbert", "neuronull" ]
6
6
release : " 0.33.0"
7
7
hide_on_release_notes : false
8
8
badges :
9
9
type : breaking change
10
10
---
11
11
12
+ Vector's 0.33.0 release includes ** breaking changes** :
13
+
14
+ 1 . [ Behavior of the ` datadog_logs ` sink's ` endpoint ` setting] ( #datadog-logs-endpoint )
15
+
12
16
Vector's 0.33.0 release includes ** deprecations** :
13
17
14
18
1 . [ Renaming the ` armv7 ` rpm package] ( #armv7-rename )
@@ -17,6 +21,20 @@ We cover them below to help you upgrade quickly:
17
21
18
22
## Upgrade guide
19
23
24
+ ### Breaking changes
25
+
26
+ #### Behavior of the ` datadog_logs ` sink's ` endpoint ` setting {#datadog-logs-endpoint}
27
+
28
+ The ` endpoint ` configuration setting is common to each of the Datadog sinks. Before this
29
+ change, when ` endpoint ` was set, the logs sink took the provided endpoint as the complete
30
+ URL (including API path) to use for posting HTTP requests. This behavior is inconsistent
31
+ with the other Datadog sinks, which use the ` endpoint ` as a base URL that the API path
32
+ (eg. "/api/v2/logs"), is appended to.
33
+
34
+ With this release, the ` datadog_logs ` sink's behavior is now consistent with the other
35
+ Datadog sinks for the ` endpoint ` setting.
36
+
37
+
20
38
### Deprecations
21
39
22
40
#### Renaming the ` armv7 ` rpm package {#armv7-rename}
Original file line number Diff line number Diff line change @@ -43,8 +43,9 @@ base: components: sinks: datadog_events: configuration: {
43
43
description : """
44
44
The endpoint to send observability data to.
45
45
46
- The endpoint must contain an HTTP scheme, and may specify a
47
- hostname or IP address and port.
46
+ The endpoint must contain an HTTP scheme, and may specify a hostname or IP
47
+ address and port. The API path should NOT be specified as this is handled by
48
+ the sink.
48
49
49
50
If set, overrides the `site` option.
50
51
"""
Original file line number Diff line number Diff line change @@ -128,8 +128,9 @@ base: components: sinks: datadog_logs: configuration: {
128
128
description : """
129
129
The endpoint to send observability data to.
130
130
131
- The endpoint must contain an HTTP scheme, and may specify a
132
- hostname or IP address and port.
131
+ The endpoint must contain an HTTP scheme, and may specify a hostname or IP
132
+ address and port. The API path should NOT be specified as this is handled by
133
+ the sink.
133
134
134
135
If set, overrides the `site` option.
135
136
"""
Original file line number Diff line number Diff line change @@ -85,8 +85,9 @@ base: components: sinks: datadog_metrics: configuration: {
85
85
description : """
86
86
The endpoint to send observability data to.
87
87
88
- The endpoint must contain an HTTP scheme, and may specify a
89
- hostname or IP address and port.
88
+ The endpoint must contain an HTTP scheme, and may specify a hostname or IP
89
+ address and port. The API path should NOT be specified as this is handled by
90
+ the sink.
90
91
91
92
If set, overrides the `site` option.
92
93
"""
Original file line number Diff line number Diff line change @@ -104,8 +104,9 @@ base: components: sinks: datadog_traces: configuration: {
104
104
description : """
105
105
The endpoint to send observability data to.
106
106
107
- The endpoint must contain an HTTP scheme, and may specify a
108
- hostname or IP address and port.
107
+ The endpoint must contain an HTTP scheme, and may specify a hostname or IP
108
+ address and port. The API path should NOT be specified as this is handled by
109
+ the sink.
109
110
110
111
If set, overrides the `site` option.
111
112
"""
You can’t perform that action at this time.
0 commit comments