Skip to content

Commit

Permalink
[receiver/tcpcheck] Fix Code open-telemetry#34458
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenoCC-Peng committed Jan 20, 2025
1 parent e74f9e7 commit 421c462
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
29 changes: 0 additions & 29 deletions receiver/tcpcheckreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,3 @@ func newReceiver(
opt,
)
}

// timeout
//func createDefaultConfig() component.Config {
// cfg := scraperhelper.NewDefaultControllerConfig()
// cfg.CollectionInterval = 10 * time.Second
//
// return &Config{
// ControllerConfig: cfg,
// TCPClientSettings: configtcp.TCPClientSettings{
// Timeout: 10 * time.Second,
// },
// MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(),
// }
//}

//func createMetricsReceiver(_ context.Context, params receiver.Settings, rConf component.Config, consumer consumer.Metrics) (receiver.Metrics, error) {
// cfg, ok := rConf.(*Config)
// if !ok {
// return nil, errConfigNotTCPCheck
// }
//
// tcpCheckScraper := newScraper(cfg, params)
// scraper, err := scraperhelper.NewScraper(metadata.Type, tcpCheckScraper.scrape, scraperhelper.WithStart(tcpCheckScraper.start))
// if err != nil {
// return nil, err
// }
//
// return scraperhelper.NewScraperControllerReceiver(&cfg.ControllerConfig, params, consumer, scraperhelper.AddScraper(scraper))
//}
2 changes: 0 additions & 2 deletions receiver/tcpcheckreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ func (s *scraper) scrapeEndpoint(tcpConfig *confignet.TCPAddrConfig, wg *sync.Wa

if err != nil {
// Record error data point and log the error
//s.mb.RecordTcpcheckDurationDataPoint(now, duration, tcpConfig.Endpoint)
//s.mb.RecordTcpcheckStatusDataPoint(now, fail, tcpConfig.Endpoint)
s.mb.RecordTcpcheckErrorDataPoint(now, pointValue, tcpConfig.Endpoint, err.Error())
s.settings.Logger.Error("TCP connection error encountered", zap.String("endpoint", tcpConfig.Endpoint), zap.Error(err))
return
Expand Down

0 comments on commit 421c462

Please sign in to comment.