-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(OTRM): Add validation for otel configuration in the opamp agent (#…
…1469) * feat(OTRM): Add config validation for otel config in the opamp agent * Added tests and dependencies * Changes that account for the otel core upgrade to 0.95.0 * Adding support to validate the host and Apache receiver
- Loading branch information
1 parent
f87e50d
commit 683a389
Showing
10 changed files
with
1,667 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
feat(otrm): Add validation for otel configuration in the opamp agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package opampextension | ||
|
||
import ( | ||
"go.opentelemetry.io/collector/exporter" | ||
"go.opentelemetry.io/collector/exporter/otlpexporter" | ||
"go.opentelemetry.io/collector/extension" | ||
"go.opentelemetry.io/collector/extension/ballastextension" | ||
|
||
"go.opentelemetry.io/collector/otelcol" | ||
"go.opentelemetry.io/collector/processor" | ||
"go.opentelemetry.io/collector/processor/batchprocessor" | ||
"go.opentelemetry.io/collector/processor/memorylimiterprocessor" | ||
"go.opentelemetry.io/collector/receiver" | ||
"go.opentelemetry.io/collector/receiver/otlpreceiver" | ||
"go.uber.org/multierr" | ||
|
||
"github.com/SumoLogic/sumologic-otel-collector/pkg/exporter/sumologicexporter" | ||
"github.com/SumoLogic/sumologic-otel-collector/pkg/extension/sumologicextension" | ||
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor" | ||
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor" | ||
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/apachereceiver" | ||
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver" | ||
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver" | ||
) | ||
|
||
// Components returns the set of components for tests | ||
func Components() ( | ||
otelcol.Factories, | ||
error, | ||
) { | ||
var errs error | ||
|
||
extensions, err := extension.MakeFactoryMap( | ||
ballastextension.NewFactory(), | ||
sumologicextension.NewFactory(), | ||
) | ||
errs = multierr.Append(errs, err) | ||
|
||
receivers, err := receiver.MakeFactoryMap( | ||
apachereceiver.NewFactory(), | ||
filelogreceiver.NewFactory(), | ||
hostmetricsreceiver.NewFactory(), | ||
otlpreceiver.NewFactory(), | ||
) | ||
errs = multierr.Append(errs, err) | ||
|
||
exporters, err := exporter.MakeFactoryMap( | ||
otlpexporter.NewFactory(), | ||
sumologicexporter.NewFactory(), | ||
) | ||
errs = multierr.Append(errs, err) | ||
|
||
processors, err := processor.MakeFactoryMap( | ||
batchprocessor.NewFactory(), | ||
memorylimiterprocessor.NewFactory(), | ||
resourcedetectionprocessor.NewFactory(), | ||
resourceprocessor.NewFactory(), | ||
) | ||
errs = multierr.Append(errs, err) | ||
|
||
factories := otelcol.Factories{ | ||
Extensions: extensions, | ||
Receivers: receivers, | ||
Processors: processors, | ||
Exporters: exporters, | ||
} | ||
|
||
return factories, errs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.