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

report duration in log after which scrape was cancelled #876

Merged
merged 1 commit into from
May 16, 2023

Conversation

vladak
Copy link
Contributor

@vladak vladak commented May 16, 2023

This change adds duration to log message about cancelled scrape. The motivation for this is the ability tune Prometheus scrape timeout values when SNMP exporter is running in default mode (with log level being info).

This is how it looks like:

ts=2023-05-16T15:45:34.828Z caller=main.go:157 level=info msg="Starting snmp_exporter" version="(version=, branch=, revision=9999e5901866ca87e8c0415f464d1d9faf7091a4-modified)"
ts=2023-05-16T15:45:34.829Z caller=main.go:158 level=info build_context="(go=go1.18.1, platform=linux/amd64, user=, date=, tags=unknown)"
ts=2023-05-16T15:45:34.834Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9116
ts=2023-05-16T15:45:34.835Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9116
ts=2023-05-16T15:45:42.545Z caller=collector.go:390 level=info module=labtemp target=example.com msg="Error scraping target" err="scrape canceled after 4.845361532s (possible timeout) walking target example.com"

@vladak vladak force-pushed the scrape_cancel_time branch from d66aa45 to 6c0c399 Compare May 16, 2023 15:50
@vladak vladak changed the title record duration after which scrape was cancelled report duration in log after which scrape was cancelled May 16, 2023
Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks!

@SuperQ SuperQ merged commit 3f0e656 into prometheus:main May 16, 2023
SuperQ added a commit that referenced this pull request Jun 15, 2023
* [FEATURE] Add indices filters #624
* [FEATURE] Add MIBOPTS flag to the generator 891
* [ENHANCEMENT] Treat Bits as OctetString #870
* [ENHANCEMENT] Report duration in logs for canceled scrapes #876

Signed-off-by: SuperQ <[email protected]>
@SuperQ SuperQ mentioned this pull request Jun 15, 2023
SuperQ added a commit that referenced this pull request Jun 15, 2023
* [FEATURE] Add indices filters #624
* [FEATURE] Add MIBOPTS flag to the generator #891
* [ENHANCEMENT] Treat Bits as OctetString #870
* [ENHANCEMENT] Report duration in logs for canceled scrapes #876
* [BUGFIX] Fix several generator MIBs. #843, #868, #889

Signed-off-by: SuperQ <[email protected]>
SuperQ added a commit that referenced this pull request Jun 15, 2023
* [FEATURE] Add indices filters #624
* [FEATURE] Add MIBOPTS flag to the generator #891
* [ENHANCEMENT] Treat Bits as OctetString #870
* [ENHANCEMENT] Report duration in logs for canceled scrapes #876
* [BUGFIX] Fix several generator MIBs. #843, #868, #889

Signed-off-by: SuperQ <[email protected]>
stephan-windischmann-sky pushed a commit to stephan-windischmann-sky/snmp_exporter that referenced this pull request Oct 27, 2023
Signed-off-by: Vladimir Kotal <[email protected]>
Signed-off-by: Stephan Windischmann <[email protected]>
stephan-windischmann-sky pushed a commit to stephan-windischmann-sky/snmp_exporter that referenced this pull request Oct 27, 2023
* [FEATURE] Add indices filters prometheus#624
* [FEATURE] Add MIBOPTS flag to the generator prometheus#891
* [ENHANCEMENT] Treat Bits as OctetString prometheus#870
* [ENHANCEMENT] Report duration in logs for canceled scrapes prometheus#876
* [BUGFIX] Fix several generator MIBs. prometheus#843, prometheus#868, prometheus#889

Signed-off-by: SuperQ <[email protected]>
Signed-off-by: Stephan Windischmann <[email protected]>
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.

2 participants