Skip to content

Throttle HTTP probe logging #1000

Open
Open

Description

@ls692

For "deny" probes, we have the problem of heavy logging [1] due to expected failures. I think we can solve this in several ways but i was wondering if cloudprober would benefit with some notion of throttled logging at a probe level. Once we have throttled logging parameters, we can add a utility function say

func shouldLogForProbe() bool { ...}  // time-based control or one-every-N logging.

then probes can change their probe path to be

func doOneProbe(...) {

   shouldLog := shouldLogForProbe()

   ...
   throttledLog(p.l, shouldLog, msg)
   // OR we could hide the logic for throttling completely by passing a timestamp or probe ID.
   throttledLog(p.l, probeTSorID, msg)
   ...
}

With this we could capture all logs for a single probe and probe writers can also increase the logging per probe with the confidence that there wont be too much log spam.

Alternatively, as a quick fix, we could also add "throttle_log_interval" param to http probe that could be used to limit logging to every 'interval'.

Or a tertiary fix of removing the log line completely.

[1] https://github.com/cloudprober/cloudprober/blob/main/probes/http/http.go#L334

Activity

  1. added
    enhancement
    on Feb 12, 2025
  2. manugarg commented on Feb 13, 2025

    @manugarg
    Contributor

    Other than logs throttling, we can also look at implementing negative test in HTTP probe, similar to the TCP probe:

    if p.opts.NegativeTest {

  3. ls692 commented on Feb 18, 2025

    @ls692
    CollaboratorAuthor

    Using negative test in HTTP seems like a good start, I will propose a CL.

    That said, it will be a while before we can move the probes to this (alerts, slos, etc... will have to be modified). So internally, we are have disabled logging and will keep it disabled till we can enable negative test for HTTP probes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions