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

Add support to ignore request in metrics #6177

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jan-stanek
Copy link

@jan-stanek jan-stanek commented Dec 16, 2024

Proposed Changes

  • Added possibility to mark request to be ignored in metrics using header K-Ignore-Metrics

Copy link

linux-foundation-easycla bot commented Dec 16, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link

knative-prow bot commented Dec 16, 2024

Welcome @jan-stanek! It looks like this is your first PR to knative/docs 🎉

@knative-prow knative-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 16, 2024
@knative-prow knative-prow bot requested review from Cali0707 and Leo6Leo December 16, 2024 13:47
Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for knative ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 74cf40b
🔍 Latest deploy log https://app.netlify.com/sites/knative/deploys/677b8423a51e6500083d7761
😎 Deploy Preview https://deploy-preview-6177--knative.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

knative-prow bot commented Jan 6, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jan-stanek
Once this PR has been reviewed and has the lgtm label, please assign dprotaso for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -19,6 +19,9 @@ Requests endpoint.
!!! note
The `revision_queue_depth` metric will be exported only if the revision concurrency hard limit is set to a value greater than 1.

!!! note
To exclude request from metrics (e.g. health check requests), set the `K-Ignore-Metrics` header to non-empty value.
Copy link
Member

Choose a reason for hiding this comment

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

What are the security implications of this header? I'm concerned that someone could use this header to sneak in a DDoS attack that wouldn't show up on monitoring.

Copy link
Author

Choose a reason for hiding this comment

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

Good point, would it be better to have possibility to specify additional label for metrics?

Copy link
Member

Choose a reason for hiding this comment

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

I think a single additional label would be safe; extracting a label into a header has a different DoS risk by expanding the cardinality of the metric.

Copy link
Member

Choose a reason for hiding this comment

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

I think this feature needs to go through a feature track document to outline possible approaches and to confirm the problem we're trying to address. In the serving repo all this work seems to go towards external health checks but we need to outline the behaviour when we've scaled to zero etc.

Details on the feature track process is here:
https://github.com/knative/community/blob/main/mechanics/FEATURE-TRACKS.md

Copy link
Member

Choose a reason for hiding this comment

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

I think this can be fairly short, but it would be good to explain why external health checks should be treated differently from other traffic -- I'm assuming this is because the artificial traffic would perturb dashboards and other monitoring, but I don't have full context.

If you have external health checks that don't execute the application, it seems like you could just deploy (for example) a dummy Revision and use tag-routed headers or hostnames for the external probe. If the health checks do execute some part of the application, it seems like you'd want to scale them in the same way as other requests (which may mean you always have one instance live).

@dprotaso
Copy link
Member

/hold

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants