From aa57e4d89728e2e1ffb3d9969a444b7b1a10868a Mon Sep 17 00:00:00 2001 From: chengchuanp Date: Wed, 15 Jan 2025 18:40:04 -0700 Subject: [PATCH] [receiver/tcpcheck] Fit Scraper #34458 --- receiver/tcpcheckreceiver/scraper.go | 1 + .../testdata/expected_metrics/metrics_golden.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/receiver/tcpcheckreceiver/scraper.go b/receiver/tcpcheckreceiver/scraper.go index 34c80693e945..dff4655c5c81 100644 --- a/receiver/tcpcheckreceiver/scraper.go +++ b/receiver/tcpcheckreceiver/scraper.go @@ -83,6 +83,7 @@ func (s *scraper) scrape(_ context.Context) (pmetric.Metrics, error) { var mux sync.Mutex for _, tcpConfig := range s.cfg.Targets { + // endpoint and dialer go s.scrapeEndpoint(tcpConfig, &wg, &mux) } diff --git a/receiver/tcpcheckreceiver/testdata/expected_metrics/metrics_golden.yaml b/receiver/tcpcheckreceiver/testdata/expected_metrics/metrics_golden.yaml index 477fa4bf455b..bc70d45793d0 100644 --- a/receiver/tcpcheckreceiver/testdata/expected_metrics/metrics_golden.yaml +++ b/receiver/tcpcheckreceiver/testdata/expected_metrics/metrics_golden.yaml @@ -7,25 +7,25 @@ resourceMetrics: dataPoints: - asInt: "36" attributes: - - key: tcp.endpoint + - key: tcpcheck.endpoint value: stringValue: 127.0.0.1:8080 startTimeUnixNano: "1000000" timeUnixNano: "2000000" name: tcpcheck.duration - unit: ns + unit: ms - description: 1 if the TCP client successfully connected, otherwise 0. name: tcpcheck.status gauge: dataPoints: - asInt: "1" attributes: - - key: tcp.endpoint + - key: tcpcheck.endpoint value: stringValue: 127.0.0.1:8080 startTimeUnixNano: "1000000" timeUnixNano: "2000000" unit: "1" scope: - name: otelcol/tcpcheckreceiver + name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tcpcheckreceiver version: latest