Skip to content

Q: How to debug context deadline exceeded #1098

Open

Description

@sebastiangaiser

Hey, from time to time I get:

level=ERROR source=probes/external/external_server.go:219 msg="context deadline exceeded" system=cloudprober probe=my_probe

I already added --debug_log to my deployment and can see my added log lines but this does not indicate a reason for the timeout to me. Do you can give me a hint on how to debug this a bit further? I already started to increase the timeout (and interval as I have to), too. My only best idea would be that e.g. closing a client takes longer than e.g store and read an entry in Redis.
Here's my config (using v0.14.0):

probe {
  name: "my_probe"
  type: EXTERNAL
  targets {
    dummy_targets {}
  }
  interval_msec: 60000
  timeout_msec: 60000
  external_probe {
    mode: SERVER
    command: "my_probe --server --enableTLS=true"

    output_metrics_options {
      aggregate_in_cloudprober: true

      dist_metric {
        key: "op_latency_seconds"
        value: {
          explicit_buckets: "0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.5,2.0"
        }
      }
    }
  }
}

Thanks in advance!

Activity

  1. manugarg commented on Jul 14, 2025

    @manugarg
    Contributor

    This timeout seems to be coming from delay in probe server (my_probe in this case) responding to cloudprober -- it seems probe server is taking longer to respond from time to time. Have you tried adding more logging to the probe server. I think adding logging around receiving the request from cloudprober, and responding to it will be useful.

  2. sebastiangaiser commented on Jul 17, 2025

    @sebastiangaiser
    Author

    Thanks for the hint. I will try to add some logging around that.

  3. sebastiangaiser commented on Jul 22, 2025

    @sebastiangaiser
    Author

    I added logs my program. Unfortunately this seams to only work inside of the probe function but e.g. not in the main of my program, similar to the redis example. My fear is that the client takes long to be created/closed but I initialize/close them outside of the probe function. Do you maybe have another hint for me? 😅

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions