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

Merged

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

@dmitryax
Copy link
Member

@pjanotti PTAL at the failing tests

@pjanotti
Copy link
Contributor Author

pjanotti commented Jun 13, 2025

@dmitryax ops, I guess a ran the local tests on the wrong terminal 🤦🏼‍♂️ ... anyway, the only way to get the correct number of failures is either to have the page faults scraping on the same scope as the original scrapererror.ScrapeErrors or to pass it as referece to the function called from the scope where the local scrapererror.ScrapeErrors is created. I opted for the latter.

@dmitryax dmitryax merged commit ab48eb9 into open-telemetry:main Jun 15, 2025
210 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 15, 2025
@pjanotti pjanotti deleted the add-system.paging.faults-metric-on-windows branch June 16, 2025 16:23
dd-jasminesun pushed a commit to DataDog/opentelemetry-collector-contrib that referenced this pull request Jun 23, 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.
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.

5 participants