Skip to content

Commit

Permalink
Merge pull request #37 from metrico/feat-support_connector
Browse files Browse the repository at this point in the history
feat: support connector
  • Loading branch information
lmangani authored Nov 21, 2023
2 parents 6053061 + 59b373d commit ff0f0b2
Show file tree
Hide file tree
Showing 4 changed files with 914 additions and 899 deletions.
20 changes: 20 additions & 0 deletions cmd/otel-collector/components.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
package main

import (
"github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector"
"github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector"
"github.com/open-telemetry/opentelemetry-collector-contrib/connector/exceptionsconnector"
"github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector"
"github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector"
"github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector"
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter"
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter"
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter"
Expand Down Expand Up @@ -111,6 +117,8 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowseventlogreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zookeeperreceiver"
"go.opentelemetry.io/collector/connector"
"go.opentelemetry.io/collector/connector/forwardconnector"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/loggingexporter"
"go.opentelemetry.io/collector/exporter/otlpexporter"
Expand Down Expand Up @@ -319,11 +327,23 @@ func CoreComponents() (
)
errs = multierr.Append(errs, err)

connectors, err := connector.MakeFactoryMap(
forwardconnector.NewFactory(),
countconnector.NewFactory(),
datadogconnector.NewFactory(),
exceptionsconnector.NewFactory(),
routingconnector.NewFactory(),
servicegraphconnector.NewFactory(),
spanmetricsconnector.NewFactory(),
)
errs = multierr.Append(errs, err)

factories := otelcol.Factories{
Extensions: extensions,
Receivers: receivers,
Processors: processors,
Exporters: exporters,
Connectors: connectors,
}

return factories, errs
Expand Down
8 changes: 1 addition & 7 deletions cmd/otel-collector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@ import (
)

func main() {

factories, err := components()
if err != nil {
log.Fatalf("failed to build default components: %v", err)
}

info := component.BuildInfo{
Command: "otel-collector",
Description: "qryn OTEL Collector",
Version: "latest",
}

params := otelcol.CollectorSettings{
Factories: factories,
Factories: components,
BuildInfo: info,
}

Expand Down
Loading

0 comments on commit ff0f0b2

Please sign in to comment.