Skip to content

Commit a133a8e

Browse files
authored
[exporter/sumologic] change logs behavior (open-telemetry#32939)
**Description:** * set OTLP as default format * add support for OTLP format * do not support metadata attributes * do not support source headers **Link to tracking Issue:** open-telemetry#32315 **Testing:** * unit tests **Documentation:** * inline comments * readme --------- Signed-off-by: Dominik Rosiek <[email protected]>
1 parent c5485bf commit a133a8e

13 files changed

+1117
-862
lines changed

.chloggen/drosiek-exporter-logs.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: sumologicexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: change logs behavior
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: [31479]
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+
* set OTLP as default format
20+
* add support for OTLP format
21+
* do not support metadata attributes
22+
* do not support source headers
23+
24+
# If your change doesn't affect end users or the exported elements of any package,
25+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
26+
# Optional: The change log or logs in which this entry should be included.
27+
# e.g. '[user]' or '[user, api]'
28+
# Include 'user' if the change is relevant to end users.
29+
# Include 'api' if there is a change to a library API.
30+
# Default: '[user]'
31+
change_logs: [user]

exporter/sumologicexporter/README.md

+11-32
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
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.
2020

21-
The following options are deprecated for logs and already do not work for metrics:
21+
The following options are no longer supported:
2222

2323
- `metric_format: {carbon2, graphite}`
2424
- `metadata_attributes: [<regex>]`
@@ -30,7 +30,7 @@ The following options are deprecated for logs and already do not work for metric
3030
After the new exporter will be moved to this repository:
3131

3232
- `carbon2` and `graphite` are no longer supported and `prometheus` or `otlp` format should be used
33-
- all resource level attributes are going to be treated (are treated for metrics) 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:
33+
- all resource level attributes are treated as `metadata_attributes` so this option is no longer supported. 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:
3434

3535
```yaml
3636
# before switch to new collector
@@ -45,7 +45,7 @@ After the new exporter will be moved to this repository:
4545
- my_attribute
4646
```
4747
48-
- 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. This feature has been already disabled for metrics. We recommend to use [Transform Processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor/). For example:
48+
- Source templates (`source_category`, `source_name` and `source_host`) are no longer supported. We recommend to use [Transform Processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor/). For example:
4949

5050
```yaml
5151
# before switch to new collector
@@ -88,12 +88,12 @@ exporters:
8888
# List of regexes for attributes which should be send as metadata
8989
# default = []
9090
#
91-
# This option is deprecated:
91+
# This option is unsupported:
9292
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
9393
metadata_attributes: [<regex>]
9494
95-
# format to use when sending logs to Sumo Logic, default = json,
96-
log_format: {json, text}
95+
# format to use when sending logs to Sumo Logic, default = otlp,
96+
log_format: {otlp, json, text}
9797
9898
# format to use when sending metrics to Sumo Logic, default = otlp,
9999
# NOTE: only `otlp` is supported when used with sumologicextension
@@ -112,7 +112,7 @@ exporters:
112112
# Please regfer to Source temmplates for formatting explanation:
113113
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#source-templates
114114
#
115-
# This option is deprecated:
115+
# This option is unsupported:
116116
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
117117
graphite_template: <template>
118118

@@ -121,7 +121,7 @@ exporters:
121121
# Please regfer to Source temmplates for formatting explanation:
122122
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#source-templates
123123
#
124-
# This option is deprecated:
124+
# This option is unsupported:
125125
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
126126
source_category: <template>
127127

@@ -130,7 +130,7 @@ exporters:
130130
# Please regfer to Source temmplates for formatting explanation:
131131
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#source-templates
132132
#
133-
# This option is deprecated:
133+
# This option is unsupported:
134134
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
135135
source_name: <template>
136136

@@ -139,7 +139,7 @@ exporters:
139139
# Please regfer to Source temmplates for formatting explanation:
140140
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#source-templates
141141
#
142-
# This option is deprecated:
142+
# This option is unsupported:
143143
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
144144
source_host: <template>
145145

@@ -183,25 +183,4 @@ exporters:
183183
184184
## Source Templates
185185
186-
You can specify a template with an attribute for `source_category`, `source_name`, `source_host` or `graphite_template` using `%{attr_name}`.
187-
188-
For example, when there is an attribute `my_attr`: `my_value`, `metrics/%{my_attr}` would be expanded to `metrics/my_value`.
189-
190-
For `graphite_template`, in addition to above, `%{_metric_}` is going to be replaced with metric name.
191-
192-
## Example Configuration
193-
194-
```yaml
195-
exporters:
196-
sumologic:
197-
endpoint: http://localhost:3000
198-
compress_encoding: "gzip"
199-
max_request_body_size: "1_048_576" # 1MB
200-
log_format: "text"
201-
metric_format: "prometheus"
202-
source_category: "custom category"
203-
source_name: "custom name"
204-
source_host: "custom host"
205-
metadata_attributes:
206-
- k8s.*
207-
```
186+
Source Templates are no longer supported. Please follow [Migration to new architecture](#migration-to-new-architecture)

exporter/sumologicexporter/compress.go

-77
This file was deleted.

exporter/sumologicexporter/compress_test.go

-142
This file was deleted.

0 commit comments

Comments
 (0)