question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow waiting for a specific number of log occurences

See original GitHub issue

Description

Info

  • d-m-p version : 0.17.1
  • Maven version (mvn -v) : 3.3.9
  • Docker version : 1.12.3

Some containers (observed both with postgres:9.5 for example) emit a log message indicating readiness multiple times (probably the db is restarted after initial env setup I assume). Example:

waiting for server to start....LOG:  database system was shut down at 2016-12-01 09:31:22 UTC
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started
 done
server started
ALTER ROLE


/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

LOG:  received fast shutdown request
LOG:  aborting any active transactions
LOG:  autovacuum launcher shutting down
waiting for server to shut down....LOG:  shutting down
LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

LOG:  database system was shut down at 2016-12-01 09:31:30 UTC
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections

For such cases it would be useful to specify that the plugin should wait for a specific number of occurences of the specified log message pattern.

Something like:

                              <wait>
                                 <log>database system is ready to accept connections</log>
                                 <count>2</count>
                              </wait>

would wait for the second occurrence of the pattern before continuing. This seems it would solve #608 as well.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

2reactions
rhusscommented, Mar 25, 2017

Another idea would be to allow multi-line patterns: When the multiline option is enabled in the pattern (?s), then keep all log lines and try to match on the whole log. Of course this can be a bit more memory intensive, but should be easy to add in the LogWatcher.

Kudos to @michael-simons for the idea 😉

1reaction
rhusscommented, Feb 14, 2017

looks useful to me. We still would have to think about to introduce the configuration. Simply <count> doesn’t work because its on the same level a http checks and so on.

Ideally we would have something like:

<wait>
  <log>
     <pattern>database system is ready to accept connections</pattern>
     <count>2</count>
  </log>
</wait>

however <log> is already burned (for backwards compatibility). Maybe <out> or <stdout> (with then in addition <stderr>, too) would be a good fit as alternative for the extended definition ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot active sessions waiting on SYNCH wait events ...
If you see MySQL SYNCH wait events in Performance Insights, this means that a large number of sessions in the database are attempting...
Read more >
Conditional Access insights and reporting - Azure
Using the Azure AD Conditional Access insights and reporting workbook to troubleshoot policies.
Read more >
[GA4] Monitor events in DebugView - Analytics Help
The DebugView report shows you data (from events, event parameters, and user properties) as Analytics collects the data. The report can help you...
Read more >
New Relic data types: metrics, events, logs, and traces (MELT)
An overview of the MELT data New Relic reports: metrics, events, logs, and traces (spans).
Read more >
Log4j 2 Lock-free Asynchronous Loggers for Low-Latency ...
yield(), and eventually parks for the minimum number of nanos the OS and JVM will allow while the I/O thread is waiting for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found