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

Build namespace and ingress class as label #551

Merged
merged 1 commit into from
Apr 4, 2017

Conversation

gianrubio
Copy link
Contributor

@aledbf I made a mistake when I built the nginx nomenclature. The right way to fill namespace and ingress class is using labels, so it'll easy to filter and reuse.

Old format

screen shot 2017-04-04 at 14 43 26

New format

screen shot 2017-04-04 at 14 44 04

Alarm example

    ALERT NginxTooMany5XX
      IF sum by (ingress_class, status_code, server_zone) (rate(nginx_responses_total{status_code=~"[5]xx"}[5m]) ) > ( 1.1 * sum by (ingress_class, status_code, server_zone) (rate(nginx_responses_total{status_code=~"[5]xx"}[15m]) ) )
      LABELS {
        service = "nginx",
        severity = "critical"
      }
      ANNOTATIONS {
        summary = "Too many http 5XX errors,
        description = " Status code {{ $status_code }} increased 10% in the last 5 minutes. Ingress class {{ $labels.ingress_class }} on server zone {{ $labels.server_zone }}",
      }

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 4, 2017
@k8s-reviewable
Copy link

This change is Reviewable

data *vtsData
scrapeChan chan scrapeRequest
ngxHealthPort int
ngxVtsPath, watchNamespace, ingressClass string
Copy link
Member

Choose a reason for hiding this comment

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

please 1 line per attribute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

data *nginxStatusData
scrapeChan chan scrapeRequest
ngxHealthPort int
ngxVtsPath, watchNamespace, ingressClass string
Copy link
Member

Choose a reason for hiding this comment

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

please 1 attribute per line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 44.083% when pulling aa8a6de on gianrubio:review-prometheus into 22c3226 on kubernetes:master.

@aledbf
Copy link
Member

aledbf commented Apr 4, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 4, 2017
@aledbf
Copy link
Member

aledbf commented Apr 4, 2017

@gianrubio can you add an example showing how to set one or more alerts? (not in this PR)

@gianrubio
Copy link
Contributor Author

@gianrubio can you add an example showing how to set one or more alerts? (not in this PR)

Sure, I'm working on this :)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 44.1% when pulling 197acf0 on gianrubio:review-prometheus into 22c3226 on kubernetes:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 44.083% when pulling 197acf0 on gianrubio:review-prometheus into 22c3226 on kubernetes:master.

@aledbf
Copy link
Member

aledbf commented Apr 4, 2017

@gianrubio thanks!

@aledbf aledbf merged commit 0fe0d6f into kubernetes:master Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants