Skip to content

Commit 6a83a9a

Browse files
sumo-drosiekMikołaj ŚwiątekAlex Boten
authored
[exporter/sumologic]: deprecate options which are going to be removed (open-telemetry#23337)
Deprecate options which are going to be removed **Link to tracking Issue:** open-telemetry#23059 --------- Signed-off-by: Dominik Rosiek <[email protected]> Co-authored-by: Mikołaj Świątek <[email protected]> Co-authored-by: Alex Boten <[email protected]>
1 parent 3faedfc commit 6a83a9a

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Use this changelog template to create an entry for release notes.
2+
# If your change doesn't affect end users, such as a test fix or a tooling change,
3+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
4+
5+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
6+
change_type: deprecation
7+
8+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
9+
component: sumologicexporter
10+
11+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
12+
note: deprecating options which are going to be removed
13+
14+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
15+
issues: [23059]
16+
17+
# (Optional) One or more lines of additional information to render under the primary note.
18+
# These lines will be padded with 2 spaces and then inserted directly into the document.
19+
# Use pipe (|) for multiline entries.
20+
subtext: |-
21+
The following options are going to be deprecated and removed in the future:
22+
23+
- `metric_format: {carbon2, graphite}` (leaving only `prometheus`)
24+
- `metadata_attributes: [<regex>]`
25+
- `graphite_template: <template>`
26+
- `source_category: <template>`
27+
- `source_name: <template>`
28+
- `source_host: <template>`

exporter/sumologicexporter/README.md

+73
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,61 @@
1010
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
1111
<!-- end autogenerated section -->
1212

13+
## Migration to new architecture
14+
15+
**This exporter is undergoing major changes right now.**
16+
17+
For some time we have been developing the [new Sumo Logic exporter](https://github.com/SumoLogic/sumologic-otel-collector/tree/main/pkg/exporter/sumologicexporter#sumo-logic-exporter) and now we are in the process of moving it into this repository.
18+
19+
The following options are deprecated and they will not exist in the new version:
20+
21+
- `metric_format: {carbon2, graphite}`
22+
- `metadata_attributes: [<regex>]`
23+
- `graphite_template: <template>`
24+
- `source_category: <template>`
25+
- `source_name: <template>`
26+
- `source_host: <template>`
27+
28+
After the new exporter will be moved to this repository:
29+
30+
- `carbon2` and `graphite` are going to be no longer supported and `prometheus` or `otlp` format should be used
31+
- all resource level attributes are going to be treated as `metadata_attributes`. You can use [Group by Attributes processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/groupbyattrsprocessor) to move attributes from record level to resource level. For example:
32+
33+
```yaml
34+
# before switch to new collector
35+
exporters:
36+
sumologic:
37+
metadata_attribute:
38+
- my_attribute
39+
# after switch to new collector
40+
processors:
41+
groupbyattrs:
42+
keys:
43+
- my_attribute
44+
```
45+
46+
- Source templates (`source_category`, `source_name` and `source_host`) are going to be removed from the exporter and sources may be set using `_sourceCategory`, `sourceName` or `_sourceHost` resource attributes. We recommend to use [Transform Processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor/). For example:
47+
48+
```yaml
49+
# before switch to new collector
50+
exporters:
51+
sumologic:
52+
source_category: "%{foo}/constant/%{bar}"
53+
# after switch to new collector
54+
processors:
55+
transformprocessor:
56+
log_statements:
57+
context: log
58+
statements:
59+
# set default value to unknown
60+
- set(attributes["foo"], "unknown") where attributes["foo"] == nil
61+
- set(attributes["bar"], "unknown") where attributes["foo"] == nil
62+
# set _sourceCategory as "%{foo}/constant/%{bar}"
63+
- set(resource.attributes["_sourceCategory"], Concat([attributes["foo"], "/constant/", attributes["bar"]], ""))
64+
```
65+
66+
## Configuration
67+
1368
This exporter supports sending logs and metrics data to [Sumo Logic](https://www.sumologic.com/).
1469
Traces are exported using native otlphttp exporter as described
1570
[here](https://help.sumologic.com/Traces/Getting_Started_with_Transaction_Tracing)
@@ -30,12 +85,18 @@ exporters:
3085
3186
# List of regexes for attributes which should be send as metadata
3287
# default = []
88+
#
89+
# This option is deprecated:
90+
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
3391
metadata_attributes: [<regex>]
3492
3593
# format to use when sending logs to Sumo Logic, default = json,
3694
log_format: {json, text}
3795
3896
# format to use when sending metrics to Sumo Logic, default = prometheus,
97+
#
98+
# carbon2 and graphite are deprecated:
99+
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
39100
metric_format: {carbon2, graphite, prometheus}
40101
41102
# Template for Graphite format.
@@ -44,24 +105,36 @@ exporters:
44105
#
45106
# Please regfer to Source temmplates for formatting explanation:
46107
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#source-templates
108+
#
109+
# This option is deprecated:
110+
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
47111
graphite_template: <template>
48112
49113
# Desired source category. Useful if you want to override the source category configured for the source.
50114
#
51115
# Please regfer to Source temmplates for formatting explanation:
52116
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#source-templates
117+
#
118+
# This option is deprecated:
119+
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
53120
source_category: <template>
54121
55122
# Desired source name. Useful if you want to override the source name configured for the source.
56123
#
57124
# Please regfer to Source temmplates for formatting explanation:
58125
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#source-templates
126+
#
127+
# This option is deprecated:
128+
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
59129
source_name: <template>
60130
61131
# Desired source host. Useful if you want to override the source hosy configured for the source.
62132
#
63133
# Please regfer to Source temmplates for formatting explanation:
64134
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#source-templates
135+
#
136+
# This option is deprecated:
137+
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
65138
source_host: <template>
66139
67140
# timeout is the timeout for every attempt to send data to the backend,

exporter/sumologicexporter/exporter.go

+25
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,31 @@ type sumologicexporter struct {
2929
}
3030

3131
func initExporter(cfg *Config, settings component.TelemetrySettings) (*sumologicexporter, error) {
32+
33+
if cfg.MetricFormat == GraphiteFormat {
34+
settings.Logger.Warn("`metric_format: graphite` nad `graphite_template` are deprecated and are going to be removed in the future. See https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture for more information")
35+
}
36+
37+
if cfg.MetricFormat == Carbon2Format {
38+
settings.Logger.Warn("`metric_format: carbon` is deprecated and is going to be removed in the future. See https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture for more information")
39+
}
40+
41+
if len(cfg.MetadataAttributes) > 0 {
42+
settings.Logger.Warn("`metadata_attributes: []` is deprecated and is going to be removed in the future. See https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture for more information")
43+
}
44+
45+
if cfg.SourceCategory != "" {
46+
settings.Logger.Warn("`source_category: <template>` is deprecated and is going to be removed in the future. See https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture for more information")
47+
}
48+
49+
if cfg.SourceHost != "" {
50+
settings.Logger.Warn("`source_host: <template>` is deprecated and is going to be removed in the future. See https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture for more information")
51+
}
52+
53+
if cfg.SourceName != "" {
54+
settings.Logger.Warn("`source_name: <template>` is deprecated and is going to be removed in the future. See https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture for more information")
55+
}
56+
3257
sfs := newSourceFormats(cfg)
3358

3459
f, err := newFilter(cfg.MetadataAttributes)

0 commit comments

Comments
 (0)