Skip to content

Commit

Permalink
chore(sumologicexporter): remove deprecation error messages
Browse files Browse the repository at this point in the history
We left some deprecated configuration options in just so we could
provide more informative error messages. Many releases have since come
and gone and it's time to remove these messages.
  • Loading branch information
Mikołaj Świątek committed Jun 15, 2023
1 parent 52680ce commit 075d0c5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 45 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!-- ## [Unreleased]
## [Unreleased]

### Released TBA

[unreleased]: https://github.com/SumoLogic/sumologic-otel-collector/compare/v0.79.0-sumo-0...main -->
### Changed

- chore(sumologicexporter): remove deprecation error messages [#1167]

[#1167]: https://github.com/SumoLogic/sumologic-otel-collector/pull/1167

[unreleased]: https://github.com/SumoLogic/sumologic-otel-collector/compare/v0.79.0-sumo-0...main

## [v0.79.0-sumo-0]

Expand Down
30 changes: 0 additions & 30 deletions pkg/exporter/sumologicexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ type Config struct {

// DEPRECATED: The below attributes only exist so we can print a nicer error
// message about not supporting them anymore.
TranslateAttributes bool `mapstructure:"translate_attributes"`
TranslateTelegrafMetrics bool `mapstructure:"translate_telegraf_attributes"`
MetadataAttributes []string `mapstructure:"metadata_attributes"`
SourceCategory string `mapstructure:"source_category"`
SourceName string `mapstructure:"source_name"`
SourceHost string `mapstructure:"source_host"`

// Attribute used by routingprocessor which should be dropped during data ingestion
// This is workaround for the following issue:
Expand Down Expand Up @@ -113,30 +107,6 @@ func CreateDefaultHTTPClientSettings() confighttp.HTTPClientSettings {

func (cfg *Config) Validate() error {

if len(cfg.MetadataAttributes) > 0 {
return fmt.Errorf(`the property metadata_attributes was removed in v0.49.0-sumo-0.
See upgrade guide at https://github.com/SumoLogic/sumologic-otel-collector/blob/main/docs/upgrading.md#sumo-logic-exporter-metadata-handling`,
)
}

if cfg.TranslateTelegrafMetrics {
return fmt.Errorf(`the property translate_telegraf_attributes was removed in v0.66.0-sumo-0.
See upgrade guide at https://github.com/SumoLogic/sumologic-otel-collector/blob/main/docs/upgrading.md#sumologic-exporter-drop-support-for-translating-telegraf-metric-names`,
)
}

if cfg.TranslateAttributes {
return fmt.Errorf(`the property translate_attributes was removed in v0.66.0-sumo-0.
See upgrade guide at https://github.com/SumoLogic/sumologic-otel-collector/blob/main/docs/upgrading.md#sumologic-exporter-drop-support-for-translating-attributes`,
)
}

if cfg.SourceCategory != "" || cfg.SourceHost != "" || cfg.SourceName != "" {
return fmt.Errorf(`the properties source_category, source_host, source_name was removed in v0.66.0-sumo-0.
See upgrade guide at https://github.com/SumoLogic/sumologic-otel-collector/blob/main/docs/upgrading.md#sumologic-exporter-drop-support-for-source-headers`,
)
}

switch cfg.LogFormat {
case OTLPLogFormat:
case JSONFormat:
Expand Down
9 changes: 0 additions & 9 deletions pkg/exporter/sumologicexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,6 @@ func TestInitExporterInvalidConfiguration(t *testing.T) {
},
},
},
{
name: "deprecated metadata_attributes",
expectedError: errors.New(`the property metadata_attributes was removed in v0.49.0-sumo-0.
See upgrade guide at https://github.com/SumoLogic/sumologic-otel-collector/blob/main/docs/upgrading.md#sumo-logic-exporter-metadata-handling`,
),
cfg: &Config{
MetadataAttributes: []string{"some_attribute"},
},
},
}

for _, tc := range testcases {
Expand Down
4 changes: 0 additions & 4 deletions pkg/exporter/sumologicexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,6 @@ func TestPushLogs_DontRemoveSourceAttributes(t *testing.T) {
}

config := createTestConfig()
config.SourceCategory = "%{_sourceCategory}"
config.SourceName = "%{_sourceName}"
config.SourceHost = "%{_sourceHost}"
config.LogFormat = TextFormat
config.MaxRequestBodySize = 32

Expand Down Expand Up @@ -739,7 +736,6 @@ func Benchmark_ExporterPushLogs(b *testing.B) {
config.CompressEncoding = GZIPCompression
config.MetricFormat = PrometheusFormat
config.LogFormat = TextFormat
config.SourceCategory = "testing_source_templates %{_sourceCategory}"
config.HTTPClientSettings.Auth = nil
return config
}
Expand Down

0 comments on commit 075d0c5

Please sign in to comment.