Skip to content

Add system.paging.faults metrics on Windows #40468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

pjanotti
Copy link
Contributor

@pjanotti pjanotti commented Jun 3, 2025

Description

Added the system.paging.faults metrics on Windows.

Testing

Besides updated tests the change was validated with a local run of the collector and the new metric.

Documentation

N/A since this metric was not documented as not being generated on Windows.

@songy23 songy23 added the Run Windows Enable running windows test on a PR label Jun 3, 2025
@pjanotti
Copy link
Contributor Author

pjanotti commented Jun 4, 2025

CI has failures in two scrappers of the hostmetricsreceive, one is the scrapper being changed in this PR and the other is on the loadscraper. I will look at it later today, detailed info:

https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/15427440377/job/43417762772?pr=40468#step:8:165

=== FAIL: internal/scraper/loadscraper TestScrape (3.01s)
make[2]: *** [../../Makefile.Common:105: test] Error 1
==================
WARNING: DATA RACE
Read at 0x000140cc82e8 by goroutine 16:
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper.(*sampler).startSamplingTicker.func1()
      C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper/load_scraper_windows.go:102 +0x3e

Previous write at 0x000140cc82e8 by goroutine 17:
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper.setSamplingFrequency()
      C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper/load_scraper_windows.go:57 +0x4b1
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper.TestScrape()
      C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper/load_scraper_test.go:142 +0x4a5
  testing.tRunner()
      C:/hostedtoolcache/windows/go/1.23.9/x64/src/testing/testing.go:1690 +0x1dd
  testing.(*T).Run.gowrap1()
      C:/hostedtoolcache/windows/go/1.23.9/x64/src/testing/testing.go:1743 +0x44

Goroutine 16 (running) created at:
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper.(*sampler).startSamplingTicker()
      C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper/load_scraper_windows.go:101 +0x8d
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper.startSampling()
make[1]: *** [Makefile:254: receiver/hostmetricsreceiver] Error 2
make[1]: *** Waiting for unfinished jobs....
      C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper/load_scraper_windows.go:81 +0x358
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper.(*loadScraper).start()
      C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper/load_scraper.go:55 +0x32b
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper.(*loadScraper).start-fm()
      <autogenerated>:1 +0x64
  go.opentelemetry.io/collector/component.StartFunc.Start()
      C:/Users/runneradmin/go/pkg/mod/go.opentelemetry.io/collector/[email protected]/component.go:66 +0x7c
  go.opentelemetry.io/collector/scraper.(*metrics).Start()
      <autogenerated>:1 +0x38
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper.TestComponentLifecycle.func3()
      C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper/generated_component_test.go:66 +0x3cd
  testing.tRunner()
      C:/hostedtoolcache/windows/go/1.23.9/x64/src/testing/testing.go:1690 +0x1dd
  testing.(*T).Run.gowrap1()
      C:/hostedtoolcache/windows/go/1.23.9/x64/src/testing/testing.go:1743 +0x44

Goroutine 17 (running) created at:
  testing.(*T).Run()
      C:/hostedtoolcache/windows/go/1.23.9/x64/src/testing/testing.go:1743 +0x83c
  testing.runTests.func1()
      C:/hostedtoolcache/windows/go/1.23.9/x64/src/testing/testing.go:2168 +0x85
  testing.tRunner()
      C:/hostedtoolcache/windows/go/1.23.9/x64/src/testing/testing.go:1690 +0x1dd
  testing.runTests()
      C:/hostedtoolcache/windows/go/1.23.9/x64/src/testing/testing.go:2[166](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/15427440377/job/43417762772?pr=40468#step:8:167) +0x8be
  testing.(*M).Run()
      C:/hostedtoolcache/windows/go/1.23.9/x64/src/testing/testing.go:2034 +0xf17
  go.uber.org/goleak.VerifyTestMain()
      C:/Users/runneradmin/go/pkg/mod/go.uber.org/[email protected]/testmain.go:53 +0x64
  github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper.TestMain()
      C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/loadscraper/generated_package_test.go:12 +0x184
  main.main()
      _testmain.go:65 +0x16d
==================
    testing.go:1399: race detected during execution of test

=== FAIL: internal/scraper/pagingscraper TestScrape/Standard (0.00s)
    testutils.go:72: 
        	Error Trace:	C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/testutils.go:72
        	            				C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/paging_scraper_test.go:91
        	Error:      	Not equal: 
        	            	expected: 0x1845a37bc33651b0
        	            	actual  : 0x1845a37bc3[176](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/15427440377/job/43417762772?pr=40468#step:8:177)28c
        	Test:       	TestScrape/Standard
        	Messages:   	metrics contained different end timestamp values

=== FAIL: internal/scraper/pagingscraper TestScrape/Standard_with_direction_removed (0.00s)
    testutils.go:72: 
        	Error Trace:	C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/testutils.go:72
        	            				C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/paging_scraper_test.go:91
        	Error:      	Not equal: 
        	            	expected: 0x1845a37bc3cb9ba8
        	            	actual  : 0x[184](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/15427440377/job/43417762772?pr=40468#step:8:185)5a37bc3c6b110
        	Test:       	TestScrape/Standard_with_direction_removed
        	Messages:   	metrics contained different end timestamp values

=== FAIL: internal/scraper/pagingscraper TestScrape (0.01s)

=== FAIL: internal/scraper/pagingscraper TestScrape/Standard_with_direction_removed (re-run 1) (0.49s)
    testutils.go:72: 
        	Error Trace:	C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/testutils.go:72
        	            				C:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/paging_scraper_test.go:91
        	Error:      	Not equal: 
        	            	expected: 0x1845a3827403eaec
        	            	actual  : 0x1845a38273f0214c
        	Test:       	TestScrape/Standard_with_direction_removed
        	Messages:   	metrics contained different end timestamp values

=== FAIL: internal/scraper/pagingscraper TestScrape (re-run 1) (0.49s)

DONE 2 runs, 351 tests, 3 skipped, 6 failures in 46.749s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants