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

Support scraping metrics from function pods for custom scaling types #1221

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

welteki
Copy link
Member

@welteki welteki commented Aug 21, 2024

Description

Scrape metrics from functions directly

Support scraping metrics from function pods directly. This allows users
to provide metrics for custom scaling types.

Function pods that have the annotation prometheus.io.scrape: true will get scraped. Optionally the port and endpoint can be configured through additional annotations: prometheus.io.path:, prometheus.io.port

Ceil load values for scaling in recording rule

The load used to be sealed by the autoscaler when it queried the load
metric. To support custom load recording rules that do not need to be
ceiled ceiling is now done on the individual recording rules that need
it.

Why is this needed?

  • I have raised an issue to propose this change (required)

Who is this for?

What company is this for? Are you listed in the ADOPTERS.md file?

How Has This Been Tested?

Deployed function with the annotation prometheus.io.scrape: true in different namespaces and verified function pods were included in the Prometheus targets though the UI.

This test was repeated without a ClusterRole for Prometheus to verify function pods in the default function namespace can be scraped.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Support scraping metrics from function pods directly. This allows users
to provide metrics for custom scaling types.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
The load used to be sealed by the autoscaler when it queried the load
metric. To support custom load recording rules that do not need to be
ceiled ceiling is now done on the individual recording rules that need
it.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

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

Approved

@alexellis alexellis merged commit 3393190 into openfaas:master Aug 21, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants