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

Instrument obsreport.Scraper #19

Merged
merged 6 commits into from
Nov 1, 2022

Conversation

moh-osman3
Copy link

This PR instruments obsreport.Scraper with otel go. This is a followup PR that is based on similar changes made for obsreport.Receiver: open-telemetry#6222

Link to tracking Issue: Part of open-telemetry#816

Testing:
Ran contrib collector with prometheusreceiver and hostmetricsreceiver and confirmed that new metrics show up. Tested both with feature gate disabled and enabled.

curl http://localhost:8888/metrics | tail -n 8 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14245    0 14245    0     0   869k      0 --:--:-- --:--:-- --:--:--  927k
# HELP otelcol_scraper_errored_metric_points Number of metric points that were unable to be scraped.
# TYPE otelcol_scraper_errored_metric_points counter
otelcol_scraper_errored_metric_points{receiver="hostmetrics",scraper="cpu",service_instance_id="020a1f19-6180-4de5-ae54-57cbd4ee9591",service_name="otelcontribcol",service_version="v0.62.0-60-g42049e14b"} 2
otelcol_scraper_errored_metric_points{receiver="hostmetrics",scraper="memory",service_instance_id="020a1f19-6180-4de5-ae54-57cbd4ee9591",service_name="otelcontribcol",service_version="v0.62.0-60-g42049e14b"} 0
# HELP otelcol_scraper_scraped_metric_points Number of metric points successfully scraped.
# TYPE otelcol_scraper_scraped_metric_points counter
otelcol_scraper_scraped_metric_points{receiver="hostmetrics",scraper="cpu",service_instance_id="020a1f19-6180-4de5-ae54-57cbd4ee9591",service_name="otelcontribcol",service_version="v0.62.0-60-g42049e14b"} 0
otelcol_scraper_scraped_metric_points{receiver="hostmetrics",scraper="memory",service_instance_id="020a1f19-6180-4de5-ae54-57cbd4ee9591",service_name="otelcontribcol",service_version="v0.62.0-60-g42049e14b"} 1

Copy link

@paivagustavo paivagustavo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - added few comments!

obsreport/obsreport_scraper.go Outdated Show resolved Hide resolved
obsreport/obsreport_scraper.go Outdated Show resolved Hide resolved
obsreport/obsreporttest/obsreporttest.go Show resolved Hide resolved
obsreport/obsreport_test.go Outdated Show resolved Hide resolved
@moh-osman3 moh-osman3 merged commit 1f4cbb8 into main Nov 1, 2022
@jaronoff97 jaronoff97 deleted the mohosman/instrument-scraper-and-test branch November 1, 2022 22:37
moh-osman3 added a commit that referenced this pull request Nov 2, 2022
* instrument obsreport.scraper metrics with otel go
moh-osman3 added a commit that referenced this pull request Nov 3, 2022
* instrument obsreport.scraper metrics with otel go
moh-osman3 added a commit that referenced this pull request Nov 3, 2022
* instrument obsreport.scraper metrics with otel go
moh-osman3 added a commit that referenced this pull request Nov 4, 2022
* instrument obsreport.scraper metrics with otel go
moh-osman3 added a commit that referenced this pull request Nov 9, 2022
* instrument obsreport.scraper metrics with otel go
moh-osman3 added a commit that referenced this pull request Nov 15, 2022
* instrument obsreport.scraper metrics with otel go
moh-osman3 added a commit that referenced this pull request Nov 21, 2022
* Instrument obsreport.Scraper (#19)

* instrument obsreport.scraper metrics with otel go

* add changelog

* update API to use MustNewScraper

* fix typo add testing for checkScraperMetrics

* remove accidental merge conflict references

* fix references after rebase

* address review comments

* remove unneded log

* add newlines

* run gofmt

* fix indenting
jaronoff97 added a commit that referenced this pull request Dec 14, 2022
* instrument obsreport.scraper metrics with otel go
jaronoff97 added a commit that referenced this pull request Dec 14, 2022
* instrument obsreport.scraper metrics with otel go
jaronoff97 added a commit that referenced this pull request Dec 14, 2022
* instrument obsreport.scraper metrics with otel go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants