Skip to content

Commit d5bdec6

Browse files
asreehari-splunkatoulme
authored andcommitted
add documentation and warning log for deprecating AccessTokenPassthrough (open-telemetry#37575)
#### Description access_token_passthrough config is being deprecated in favor of enabling include_metadata in the receiver. As shown in the config and in the changelog also update batch processor as follows ```yaml batch: metadata_keys: [X-Sf-Token] ``` #### Issue: open-telemetry#37575 --------- Co-authored-by: Antoine Toulme <[email protected]> Co-authored-by: Antoine Toulme <[email protected]>
1 parent 83730e3 commit d5bdec6

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: deprecation
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: signalfxreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "`access_token_passthrough` is deprecated"
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [37575]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
- "`access_token_passthrough` is deprecated."
20+
- "Please enable include_metadata in the receiver and add the following config to the batch processor:"
21+
```yaml
22+
batch:
23+
metadata_keys: [X-Sf-Token]
24+
```
25+
26+
# If your change doesn't affect end users or the exported elements of any package,
27+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
28+
# Optional: The change log or logs in which this entry should be included.
29+
# e.g. '[user]' or '[user, api]'
30+
# Include 'user' if the change is relevant to end users.
31+
# Include 'api' if there is a change to a library API.
32+
# Default: '[user]'
33+
change_logs: [user]

receiver/signalfxreceiver/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ var errEmptyEndpoint = errors.New("empty endpoint")
1717
type Config struct {
1818
confighttp.ServerConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct
1919

20+
// Deprecated: `access_token_passthrough` is deprecated.
21+
// Please enable include_metadata in the receiver and add the following config to the batch processor:
22+
// batch:
23+
// metadata_keys: [X-Sf-Token]
2024
splunk.AccessTokenPassthroughConfig `mapstructure:",squash"`
2125
}
2226

receiver/signalfxreceiver/factory.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ func createMetricsReceiver(
7070
) (receiver.Metrics, error) {
7171
rCfg := cfg.(*Config)
7272

73+
if rCfg.AccessTokenPassthrough {
74+
params.Logger.Warn(
75+
"access_token_passthrough is deprecated. " +
76+
"Please enable include_metadata in the receiver and add " +
77+
"`metadata_keys: [X-Sf-Token]` to the batch processor",
78+
)
79+
}
80+
7381
receiverLock.Lock()
7482
r := receivers[rCfg]
7583
if r == nil {
@@ -96,6 +104,14 @@ func createLogsReceiver(
96104
) (receiver.Logs, error) {
97105
rCfg := cfg.(*Config)
98106

107+
if rCfg.AccessTokenPassthrough {
108+
params.Logger.Warn(
109+
"access_token_passthrough is deprecated. " +
110+
"Please enable include_metadata in the receiver and add " +
111+
"`metadata_keys: [X-Sf-Token]` to the batch processor",
112+
)
113+
}
114+
99115
receiverLock.Lock()
100116
r := receivers[rCfg]
101117
if r == nil {

0 commit comments

Comments
 (0)