Skip to content

Commit

Permalink
[exporter/sumologic] change logs behavior (#32939)
Browse files Browse the repository at this point in the history
**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:** #32315

**Testing:**

* unit tests

**Documentation:**

* inline comments
* readme

---------

Signed-off-by: Dominik Rosiek <drosiek@sumologic.com>
  • Loading branch information
sumo-drosiek committed May 13, 2024
1 parent c5485bf commit a133a8e
Show file tree
Hide file tree
Showing 13 changed files with 1,117 additions and 862 deletions.
31 changes: 31 additions & 0 deletions .chloggen/drosiek-exporter-logs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: sumologicexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: change logs behavior

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [31479]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
* set OTLP as default format
* add support for OTLP format
* do not support metadata attributes
* do not support source headers
# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
43 changes: 11 additions & 32 deletions exporter/sumologicexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

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.

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

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

- `carbon2` and `graphite` are no longer supported and `prometheus` or `otlp` format should be used
- 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:
- 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:

```yaml
# before switch to new collector
Expand All @@ -45,7 +45,7 @@ After the new exporter will be moved to this repository:
- my_attribute
```

- 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:
- 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:

```yaml
# before switch to new collector
Expand Down Expand Up @@ -88,12 +88,12 @@ exporters:
# List of regexes for attributes which should be send as metadata
# default = []
#
# This option is deprecated:
# This option is unsupported:
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
metadata_attributes: [<regex>]

# format to use when sending logs to Sumo Logic, default = json,
log_format: {json, text}
# format to use when sending logs to Sumo Logic, default = otlp,
log_format: {otlp, json, text}

# format to use when sending metrics to Sumo Logic, default = otlp,
# NOTE: only `otlp` is supported when used with sumologicextension
Expand All @@ -112,7 +112,7 @@ exporters:
# Please regfer to Source temmplates for formatting explanation:
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#source-templates
#
# This option is deprecated:
# This option is unsupported:
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sumologicexporter#migration-to-new-architecture
graphite_template: <template>

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

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

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

Expand Down Expand Up @@ -183,25 +183,4 @@ exporters:

## Source Templates

You can specify a template with an attribute for `source_category`, `source_name`, `source_host` or `graphite_template` using `%{attr_name}`.

For example, when there is an attribute `my_attr`: `my_value`, `metrics/%{my_attr}` would be expanded to `metrics/my_value`.

For `graphite_template`, in addition to above, `%{_metric_}` is going to be replaced with metric name.

## Example Configuration

```yaml
exporters:
sumologic:
endpoint: http://localhost:3000
compress_encoding: "gzip"
max_request_body_size: "1_048_576" # 1MB
log_format: "text"
metric_format: "prometheus"
source_category: "custom category"
source_name: "custom name"
source_host: "custom host"
metadata_attributes:
- k8s.*
```
Source Templates are no longer supported. Please follow [Migration to new architecture](#migration-to-new-architecture)
77 changes: 0 additions & 77 deletions exporter/sumologicexporter/compress.go

This file was deleted.

142 changes: 0 additions & 142 deletions exporter/sumologicexporter/compress_test.go

This file was deleted.

Loading

0 comments on commit a133a8e

Please sign in to comment.