Skip to content

Metric for response body size #508

Closed

Description

@syd20

I did't find anything in the document about a metric for response size? Can we have a metric for emitting the response body size? I have a use case where I would like to check the content length and configure alerting if it's below the threshold

Activity

  1. added
    enhancement
    on Sep 8, 2023
  2. manugarg commented on Sep 8, 2023

    @manugarg
    Contributor

    I think tracking individual use case like this is not going to work well. I'm trying to think of some generic approach to validators.

  3. syd20 commented on Sep 9, 2023

    @syd20
    Author

    Here I would not require a validator but just the response body size to be sent as a metric similar to those for latency and status codes. I do agree we would need some generic long term approach for validator especially where we need some dynamic comparison

  4. manugarg commented on Sep 9, 2023

    @manugarg
    Contributor

    Adding a new metric is expensive in the sense that it affects everyone automatically, so we don't do that unless it's something that applies to a lot of use cases, and there is a significant demand for it.

    Validators are less invasive as you have to explicitly enable them. One thing we can add to validators is an option to mark probe as success even if that validator fails -- this will allow users to generate/use validator metrics without failing the probe.

    Another option we've been thinking of for a while is to generate metrics from HTTP responses: #356
    We can possibly utilize that option to generate metrics from headers as well.

  5. manugarg commented on Aug 6, 2024

    @manugarg
    Contributor

    I am going to merge this into #356.

  6. manugarg commented on Sep 10, 2024

    @manugarg
    Contributor

    @syd20 This can now be done (unreleased, but checked in). Please see #841 .

    https://cloudprober.org/docs/config/metrics/#cloudprober_metrics_payload_OutputMetricsOptions

    You can add something like the following to your http_probe config stanza:

        response_metrics_options {
          header_metric {
            metric_name: "content-length"
            type: INT
          }
        }
    
  7. added this to the v0.13.8 milestone on Sep 10, 2024
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions