Skip to content

Commit

Permalink
feat: upgrade to v0.93.0 (#52)
Browse files Browse the repository at this point in the history
* feat: upgrade to v0.93.0

* feat: add more processor and receiver

* fix: duplicate extension

* fix: duplicate extension
  • Loading branch information
Cluas authored Feb 1, 2024
1 parent befe075 commit bf98e7f
Show file tree
Hide file tree
Showing 8 changed files with 1,462 additions and 1,121 deletions.
125 changes: 102 additions & 23 deletions cmd/otel-collector/components.go

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion exporter/clickhouseprofileexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package clickhouseprofileexporter

import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)

// Represents the receiver config within the collector's config.yaml
type Config struct {
exporterhelper.TimeoutSettings `mapstructure:",squash"`
exporterhelper.RetrySettings `mapstructure:"retry_on_failure"`
configretry.BackOffConfig `mapstructure:"retry_on_failure"`
QueueSettings `mapstructure:"sending_queue"`

// DSN is the ClickHouse server Data Source Name.
Expand Down
5 changes: 3 additions & 2 deletions exporter/clickhouseprofileexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)
Expand All @@ -19,7 +20,7 @@ func createDefaultConfig() component.Config {
return &Config{
TimeoutSettings: exporterhelper.NewDefaultTimeoutSettings(),
QueueSettings: QueueSettings{QueueSize: exporterhelper.NewDefaultQueueSettings().QueueSize},
RetrySettings: exporterhelper.NewDefaultRetrySettings(),
BackOffConfig: configretry.NewDefaultBackOffConfig(),
Dsn: defaultDsn,
}
}
Expand All @@ -38,7 +39,7 @@ func createLogsExporter(ctx context.Context, set exporter.CreateSettings, cfg co
exporterhelper.WithShutdown(exp.Shutdown),
exporterhelper.WithQueue(c.enforceQueueSettings()),
exporterhelper.WithTimeout(c.TimeoutSettings),
exporterhelper.WithRetry(c.RetrySettings),
exporterhelper.WithRetry(c.BackOffConfig),
)
}

Expand Down
3 changes: 2 additions & 1 deletion exporter/qrynexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package qrynexporter

import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)

Expand All @@ -26,7 +27,7 @@ const (
// Config defines configuration for logging exporter.
type Config struct {
exporterhelper.TimeoutSettings `mapstructure:",squash"`
exporterhelper.RetrySettings `mapstructure:"retry_on_failure"`
configretry.BackOffConfig `mapstructure:"retry_on_failure"`
// QueueSettings is a subset of exporterhelper.QueueSettings,
// because only QueueSize is user-settable.
QueueSettings QueueSettings `mapstructure:"sending_queue"`
Expand Down
3 changes: 2 additions & 1 deletion exporter/qrynexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/confmap/confmaptest"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)
Expand Down Expand Up @@ -36,7 +37,7 @@ func TestLoadConfig(t *testing.T) {
TimeoutSettings: exporterhelper.TimeoutSettings{
Timeout: 5 * time.Second,
},
RetrySettings: exporterhelper.RetrySettings{
BackOffConfig: configretry.BackOffConfig{
Enabled: true,
InitialInterval: 5 * time.Second,
MaxInterval: 30 * time.Second,
Expand Down
10 changes: 5 additions & 5 deletions exporter/qrynexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"fmt"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)
Expand All @@ -42,7 +43,7 @@ func createDefaultConfig() component.Config {
return &Config{
TimeoutSettings: exporterhelper.NewDefaultTimeoutSettings(),
QueueSettings: QueueSettings{QueueSize: exporterhelper.NewDefaultQueueSettings().QueueSize},
RetrySettings: exporterhelper.NewDefaultRetrySettings(),
BackOffConfig: configretry.NewDefaultBackOffConfig(),
DSN: defaultDSN,
}
}
Expand All @@ -54,7 +55,6 @@ func createTracesExporter(
params exporter.CreateSettings,
cfg component.Config,
) (exporter.Traces, error) {

c := cfg.(*Config)
oce, err := newTracesExporter(params.Logger, c)
if err != nil {
Expand All @@ -69,7 +69,7 @@ func createTracesExporter(
exporterhelper.WithShutdown(oce.Shutdown),
exporterhelper.WithTimeout(c.TimeoutSettings),
exporterhelper.WithQueue(c.enforcedQueueSettings()),
exporterhelper.WithRetry(c.RetrySettings),
exporterhelper.WithRetry(c.BackOffConfig),
)
}

Expand All @@ -94,7 +94,7 @@ func createLogsExporter(
exporterhelper.WithShutdown(exporter.Shutdown),
exporterhelper.WithTimeout(c.TimeoutSettings),
exporterhelper.WithQueue(c.enforcedQueueSettings()),
exporterhelper.WithRetry(c.RetrySettings),
exporterhelper.WithRetry(c.BackOffConfig),
)
}

Expand All @@ -119,6 +119,6 @@ func createMetricsExporter(
exporterhelper.WithShutdown(exporter.Shutdown),
exporterhelper.WithTimeout(c.TimeoutSettings),
exporterhelper.WithQueue(c.enforcedQueueSettings()),
exporterhelper.WithRetry(c.RetrySettings),
exporterhelper.WithRetry(c.BackOffConfig),
)
}
Loading

0 comments on commit bf98e7f

Please sign in to comment.