Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compression): Changes that follow core breaking changes to the confighttp API #36399

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .chloggen/fix-contrib-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

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

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Multiple components have been updated to fix the failing contrib tests, because of core API changes.

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

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

# 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: []
3 changes: 2 additions & 1 deletion exporter/splunkhecexporter/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/goccy/go-json"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configcompression"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/pdata/plog"
Expand Down Expand Up @@ -658,7 +659,7 @@ func checkHecHealth(ctx context.Context, client *http.Client, healthCheckURL *ur

func buildHTTPClient(ctx context.Context, config *Config, host component.Host, telemetrySettings component.TelemetrySettings) (*http.Client, error) {
// we handle compression explicitly.
config.ClientConfig.Compression = ""
config.ClientConfig.Compression = configcompression.TypeWithLevel{Type: "", Level: 0}
return config.ToClient(ctx, host, telemetrySettings)
}

Expand Down
6 changes: 5 additions & 1 deletion exporter/splunkhecexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
github.com/testcontainers/testcontainers-go v0.34.0
go.opentelemetry.io/collector/component v0.115.0
go.opentelemetry.io/collector/component/componenttest v0.115.0
go.opentelemetry.io/collector/config/configcompression v1.21.0
go.opentelemetry.io/collector/config/confighttp v0.115.0
go.opentelemetry.io/collector/config/configopaque v1.21.0
go.opentelemetry.io/collector/config/configretry v1.21.0
Expand Down Expand Up @@ -93,7 +94,6 @@ require (
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/collector/client v1.21.0 // indirect
go.opentelemetry.io/collector/config/configauth v0.115.0 // indirect
go.opentelemetry.io/collector/config/configcompression v1.21.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect
go.opentelemetry.io/collector/config/internal v0.115.0 // indirect
go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect
Expand Down Expand Up @@ -137,3 +137,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden

replace go.opentelemetry.io/collector/config/configcompression => github.com/rnishtala-sumo/opentelemetry-collector/config/configcompression v0.0.0-20241204155200-78d83fd4ebca
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather we merge the changes in core and use the latest main snapshot.

Copy link
Contributor Author

@rnishtala-sumo rnishtala-sumo Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing this PR after SIG meeting discussion in favor of - open-telemetry/opentelemetry-collector#11805


replace go.opentelemetry.io/collector/config/confighttp => github.com/rnishtala-sumo/opentelemetry-collector/config/confighttp v0.0.0-20241204155200-78d83fd4ebca
8 changes: 4 additions & 4 deletions exporter/splunkhecexporter/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/datadog/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
if cfg.Endpoint != "" {
unsupported = append(unsupported, "endpoint")
}
if cfg.Compression != "" {
if cfg.Compression.Type != "" {

Check failure on line 163 in pkg/datadog/config/config.go

View workflow job for this annotation

GitHub Actions / govulncheck (connector)

cfg.Compression.Type undefined (type configcompression.Type has no field or method Type)

Check failure on line 163 in pkg/datadog/config/config.go

View workflow job for this annotation

GitHub Actions / govulncheck (exporter-1)

cfg.Compression.Type undefined (type configcompression.Type has no field or method Type)
unsupported = append(unsupported, "compression")
}
if len(cfg.Headers) > 0 {
Expand Down
3 changes: 2 additions & 1 deletion pkg/datadog/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config/configauth"
"go.opentelemetry.io/collector/config/configcompression"
"go.opentelemetry.io/collector/config/confighttp"
"go.opentelemetry.io/collector/config/confignet"
"go.opentelemetry.io/collector/config/configopaque"
Expand Down Expand Up @@ -183,7 +184,7 @@ func TestValidate(t *testing.T) {
API: APIConfig{Key: "aaaaaaa"},
ClientConfig: confighttp.ClientConfig{
Endpoint: "endpoint",
Compression: "gzip",
Compression: configcompression.TypeWithLevel{Type: configcompression.TypeGzip, Level: -1},
Auth: &auth,
Headers: map[string]configopaque.String{"key": "val"},
HTTP2ReadIdleTimeout: 250,
Expand Down
6 changes: 5 additions & 1 deletion pkg/datadog/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
go.opentelemetry.io/collector/component v0.115.0
go.opentelemetry.io/collector/component/componenttest v0.115.0
go.opentelemetry.io/collector/config/configauth v0.115.0
go.opentelemetry.io/collector/config/configcompression v1.21.0
go.opentelemetry.io/collector/config/confighttp v0.115.0
go.opentelemetry.io/collector/config/confignet v1.21.0
go.opentelemetry.io/collector/config/configopaque v1.21.0
Expand Down Expand Up @@ -56,7 +57,6 @@ require (
github.com/rs/cors v1.11.1 // indirect
github.com/tinylib/msgp v1.1.8 // indirect
go.opentelemetry.io/collector/client v1.21.0 // indirect
go.opentelemetry.io/collector/config/configcompression v1.21.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect
go.opentelemetry.io/collector/config/internal v0.115.0 // indirect
go.opentelemetry.io/collector/consumer v1.21.0 // indirect
Expand Down Expand Up @@ -87,3 +87,7 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace go.opentelemetry.io/collector/config/configcompression => github.com/rnishtala-sumo/opentelemetry-collector/config/configcompression v0.0.0-20241204155200-78d83fd4ebca

replace go.opentelemetry.io/collector/config/confighttp => github.com/rnishtala-sumo/opentelemetry-collector/config/confighttp v0.0.0-20241204155200-78d83fd4ebca
8 changes: 4 additions & 4 deletions pkg/datadog/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions testbed/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -438,3 +438,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl => ..
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics => ../internal/exp/metrics

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil => ../internal/pdatautil

replace go.opentelemetry.io/collector/config/configcompression => github.com/rnishtala-sumo/opentelemetry-collector/config/configcompression v0.0.0-20241118202008-518d136b719c

replace go.opentelemetry.io/collector/config/confighttp => github.com/rnishtala-sumo/opentelemetry-collector/config/confighttp v0.0.0-20241118202008-518d136b719c
2 changes: 1 addition & 1 deletion testbed/testbed/senders.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

type otlpHTTPDataSender struct {
DataSenderBase
compression configcompression.Type
compression configcompression.TypeWithLevel

Check failure on line 81 in testbed/testbed/senders.go

View workflow job for this annotation

GitHub Actions / govulncheck (exporter-1)

undefined: configcompression.TypeWithLevel
}

func (ods *otlpHTTPDataSender) fillConfig(cfg *otlphttpexporter.Config) *otlphttpexporter.Config {
Expand Down
Loading