Skip to content

Commit 5f760c2

Browse files
[receiver/hostmetrics] Allow process scraping under FreeBSD
1 parent 52a072f commit 5f760c2

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

receiver/hostmetricsreceiver/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ The available scrapers are:
4747
| [memory] | All | Memory utilization metrics |
4848
| [network] | All | Network interface I/O metrics & TCP connection metrics |
4949
| [paging] | All | Paging/Swap space utilization and I/O metrics |
50-
| [processes] | Linux, Mac | Process count metrics |
51-
| [process] | Linux, Windows, Mac | Per process CPU, Memory, and Disk I/O metrics |
50+
| [processes] | Linux, Mac, FreeBSD | Process count metrics |
51+
| [process] | Linux, Windows, Mac, FreeBSD | Per process CPU, Memory, and Disk I/O metrics |
5252
| [system] | Linux, Windows, Mac | Miscellaneous system metrics |
5353

5454
[cpu]: ./internal/scraper/cpuscraper/documentation.md

receiver/hostmetricsreceiver/internal/scraper/processscraper/factory.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ func createMetricsScraper(
4444
settings scraper.Settings,
4545
cfg component.Config,
4646
) (scraper.Metrics, error) {
47-
if runtime.GOOS != "linux" && runtime.GOOS != "windows" && runtime.GOOS != "darwin" {
48-
return nil, errors.New("process scraper only available on Linux, Windows, or macOS")
47+
if runtime.GOOS != "linux" && runtime.GOOS != "windows" && runtime.GOOS != "darwin" && runtime.GOOS != "freebsd" {
48+
return nil, errors.New("process scraper only available on Linux, Windows, macOS, or FreeBSD")
4949
}
5050

5151
s, err := newProcessScraper(settings, cfg.(*Config))

receiver/hostmetricsreceiver/internal/scraper/processscraper/factory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestCreateResourceMetricsScraper(t *testing.T) {
2626

2727
scraper, err := factory.CreateMetrics(context.Background(), scrapertest.NewNopSettings(metadata.Type), cfg)
2828

29-
if runtime.GOOS == "linux" || runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
29+
if runtime.GOOS == "linux" || runtime.GOOS == "windows" || runtime.GOOS == "darwin" || runtime.GOOS == "freebsd" {
3030
assert.NoError(t, err)
3131
assert.NotNil(t, scraper)
3232
} else {

receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_darwin.go renamed to receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_bsds.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
//go:build darwin
4+
//go:build darwin || freebsd
55

66
package processscraper // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processscraper"
77

receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_others.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The OpenTelemetry Authors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
//go:build !linux && !windows && !darwin
4+
//go:build !linux && !windows && !darwin && !freebsd
55

66
package processscraper // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processscraper"
77

0 commit comments

Comments
 (0)