Skip to content

Commit

Permalink
fix(compression): Changes that follow core breaking changes to the co…
Browse files Browse the repository at this point in the history
…nfighttp API
  • Loading branch information
rnishtala-sumo committed Oct 16, 2024
1 parent cf25636 commit c31d69d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
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) {

Check failure on line 660 in exporter/splunkhecexporter/client.go

View workflow job for this annotation

GitHub Actions / govulncheck (exporter-3)

undefined: configcompression.TypeWithLevel
// we handle compression explicitly.
config.ClientConfig.Compression = ""
config.ClientConfig.Compression = configcompression.TypeWithLevel{Type: "", Level: 0}

Check failure on line 662 in exporter/splunkhecexporter/client.go

View workflow job for this annotation

GitHub Actions / govulncheck (exporter-3)

undefined: configcompression.TypeWithLevel
return config.ToClient(ctx, host, telemetrySettings)
}

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

Check failure on line 147 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 147 in pkg/datadog/config/config.go

View workflow job for this annotation

GitHub Actions / govulncheck (pkg)

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

Check failure on line 147 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)

Check failure on line 147 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 147 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)

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

View workflow job for this annotation

GitHub Actions / govulncheck (pkg)

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 @@ -163,7 +164,7 @@ func TestValidate(t *testing.T) {
API: APIConfig{Key: "notnull"},
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
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 @@ func (dsb *DataSenderBase) Flush() {

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

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

0 comments on commit c31d69d

Please sign in to comment.