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

Add logs for API checks #2125

Merged
merged 2 commits into from
Jan 12, 2025
Merged

Add logs for API checks #2125

merged 2 commits into from
Jan 12, 2025

Conversation

audiodude
Copy link
Member

This will help debugging when we get a message along the lines of "No available [foo] renderer".

@audiodude
Copy link
Member Author

See #2090

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.33%. Comparing base (a4db759) to head (5f665f9).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2125      +/-   ##
==========================================
+ Coverage   75.25%   75.33%   +0.07%     
==========================================
  Files          41       41              
  Lines        3197     3207      +10     
  Branches      706      706              
==========================================
+ Hits         2406     2416      +10     
  Misses        674      674              
  Partials      117      117              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benoit74
Copy link
Contributor

benoit74 commented Jan 3, 2025

I love this. Given these checks are done only once per scrape, the 4 additional log lines are "very cheap" and having the exact URL used helps a lot to ensure there is no problem of misconfiguration of the scraper URLs.

My only suggestion is that you should probably use logger.log rather than console.log so that it is properly filtered by the log levels system.

@audiodude
Copy link
Member Author

My only suggestion is that you should probably use logger.log rather than console.log so that it is properly filtered by the log levels system.

Thanks, done.

@kelson42
Copy link
Collaborator

kelson42 commented Jan 3, 2025

@audiodude Could we use also this PR to log as well what API end-point(s) is/are chosen at the end?

@audiodude
Copy link
Member Author

Great idea, done.

@audiodude
Copy link
Member Author

Also changed the code to only build the URL once, PTAL

@kelson42
Copy link
Collaborator

kelson42 commented Jan 6, 2025

@audiodude I guess this is ready to review!?

@kelson42 kelson42 requested review from kelson42 and benoit74 January 6, 2025 05:24
@kelson42 kelson42 added this to the 1.15.0 milestone Jan 6, 2025
Copy link
Contributor

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

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

LGTM, please consider replacing Checking with Checked in the messages since the check is complete once log is done

@kelson42 kelson42 merged commit 4314576 into main Jan 12, 2025
2 of 3 checks passed
@kelson42 kelson42 deleted the api-check-logs branch January 12, 2025 15:02
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.

3 participants