Skip to content
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

Host Metrics receiver: use correct TCP state labels on Unix systems #2087

Merged

Conversation

james-bebbington
Copy link
Member

@james-bebbington james-bebbington commented Nov 7, 2020

For the tcp_connections metric, we want to always return a data point for each TCP state label. Unix uses slightly different TCP state labels than Windows:

This PR updates the code to set the tcp state labels based on OS. This also fixes a test that would fail intermittently on Linux if any connections were in state CLOSE or SYN_RECV when the test ran, since the label value differs slightly from the Windows labels that were previously always used.

I considered also making the test less restrictive (i.e. don't fail if unexpected state values are returned, and thus additional data points are created), but the test failure was very useful for detecting this bug so I have left as is for now.

Fixes #2033

@james-bebbington james-bebbington requested a review from a team as a code owner November 7, 2020 03:33
@codecov
Copy link

codecov bot commented Nov 7, 2020

Codecov Report

Merging #2087 (c8db13a) into master (6c8a896) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2087      +/-   ##
==========================================
- Coverage   92.10%   92.09%   -0.01%     
==========================================
  Files         278      278              
  Lines       16977    16966      -11     
==========================================
- Hits        15636    15625      -11     
  Misses        922      922              
  Partials      419      419              
Impacted Files Coverage Δ
...internal/scraper/networkscraper/network_scraper.go 97.89% <100.00%> (-0.22%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c8a896...c8db13a. Read the comment docs.

@tigrannajaryan tigrannajaryan merged commit bf818a2 into open-telemetry:master Nov 10, 2020
@tigrannajaryan
Copy link
Member

@james-bebbington thanks for the fix.

MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
…elemetry#2087) (open-telemetry#2093)

* Update otel.Meter to global.Meter in Getting Started Document. (open-telemetry#2087)

Signed-off-by: lastchiliarch <lastchiliarch@163.com>

* Update CHANGELOG.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestScrape/Validate_Start_Time failed
2 participants