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

nginx-ingress sli plugin #74

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

warmfusion
Copy link

@warmfusion warmfusion commented Nov 15, 2022

Lazily adapted from the apiserver example given to use the nginx-ingress metrics rules

What it do?

Adds a simple SLI plugin that uses the default nginx metrics for ingress controllers so people can throw an SLO that reflects their ingress quite easily.

How it do?

...
slos:
  - name: "my-public-ingress"
    objective: 99.9
    description: HTTP Availability for my ingress
    sli:
      plugin:
        id: "sloth-common/kubernetes/nginx-ingress/availability"
        options:
          filter: ingress="public-ingress",exported_namespace="my-awesome-website"

Lazily adapted from the apiserver example given to use the nginx-ingress metrics rules
@warmfusion
Copy link
Author

While this works do you think I should spend a bit more time on making the options a bit more focused, for example;

    sli:
      plugin:
        id: "sloth-common/kubernetes/nginx-ingress/availability"
        options:
          ingress: public-ingress
          host: www.example.com
          filter: additional=labels,and=keys

so folks can more directly target their particular ingress and host patterns..?

@warmfusion
Copy link
Author

Arguments For My Previous;

  • Ingress and Host are common patterns for users to define
  • Clarity on options fields makes for better user experience when defining SLOs
  • Easier to validate field input (eg host must be a domain name)

Arguments Against My Previous

  • Lots of 'optional' fields makes for complex code and test cases
  • Makes for quite an opinionated SLI measure tool...

For now - filter by itself will do, as I would assume a 'new' version of this SLI plugin could introduce the shiny new features in a backwards compatible manner with little effort, so i'm not going to add the additional optional keys for now.

Unless you have a feeling to the contrary?

@nlamirault
Copy link

any news for this plugin @slok ?

@warmfusion
Copy link
Author

I made a tweak to the plugin so that it has a failsafe or on() vector(0) bullt in; this ensures that the error rate is 0 even if there are no errors reported from metrics and prevents NaN errors up the SLI calculation stack.

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