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 custom metrics and label filter to tenant operator #406

Merged
merged 2 commits into from
Jan 22, 2021

Conversation

GabriFila
Copy link
Contributor

@GabriFila GabriFila commented Jan 21, 2021

Description

This PR includes:

  • added custom metrics to allow better visualization of errors during reconciliation (more details below)
  • added label filter to allow deploying different versions of the operator to target different tenants/workspaces

Custom Prometheus metric

The operator exposes only a new metric tenant_operator_internal_errors of type COUNTER. The metric contains 2 labels:

  • controller
  • reason:
    The controller label can assume 2 values:
  • tenant
  • workspace
    Depending on the controller label, the reason label can assume the following values:
  • tenant:
    • self-update: related to changes to the spec/status/labels/finalizers of the reconciled resource
    • cluster-resources: related to the handling of the cluster resources (namespace, roleBindings,..) managed by the operator
    • workspace-not-exist: happens when a tenant is subscribed to a non-existing workspace
    • keycloak: related to the keycloak subscription
    • nextcloud: related to the nextcloud subscription
  • workspace
    • self-update: related to the handling of changes to the spec/status/labels/finalizers of the reconciled resource
    • cluster-resources: related to the handling of the cluster resources (namespace, roleBindings,..) managed by the operator
    • tenant-unsubscription: related to the subscription of a tenant when a workspace gets deleted
    • keycloak: related to the keycloak subscription

How Has This Been Tested?

This feature has not been tested

@kingmakerbot
Copy link
Collaborator

Hi @GabriFila. Thanks for your PR.

I am @kingmakerbot.
You can interact with me issuing a slash command in the first line of a comment.
Currently, I understand the following commands:

  • /rebase: Rebase this PR onto the master branch
  • /merge: Merge this PR into the master branch
  • /hold: Adds hold label to prevent merging with /merge
  • /unhold: Removes the hold label to allow merging with /merge
  • /deploy-staging: Deploy a staging environment to test this PR
  • /undeploy-staging: Manually undeploy the staging environment

Make sure this PR appears in the CrownLabs changelog, adding one of the following labels:

  • kind/breaking: 💥 Breaking Change
  • kind/feature: 🚀 New Feature
  • kind/bug: 🐛 Bug Fix
  • kind/cleanup: 🧹 Code Refactoring
  • kind/docs: 📝 Documentation

@GabriFila GabriFila force-pushed the gbf/tenant_workspace branch from bd0b60b to 45e9754 Compare January 21, 2021 18:51
@GabriFila GabriFila marked this pull request as ready for review January 22, 2021 10:59
@GabriFila GabriFila force-pushed the gbf/tenant_workspace branch from 45e9754 to be3bc1c Compare January 22, 2021 11:09
Copy link
Member

@giorio94 giorio94 left a comment

Choose a reason for hiding this comment

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

/lgtm

operators/cmd/tenant-operator/main.go Outdated Show resolved Hide resolved
deploy/crownlabs/values.yaml Outdated Show resolved Hide resolved
@GabriFila GabriFila force-pushed the gbf/tenant_workspace branch from be3bc1c to 703d7fb Compare January 22, 2021 14:14
@GabriFila GabriFila added the kind/feature New feature or request label Jan 22, 2021
@GabriFila
Copy link
Contributor Author

/rebase

@GabriFila
Copy link
Contributor Author

/merge

@kingmakerbot kingmakerbot merged commit 881ca1e into master Jan 22, 2021
@kingmakerbot kingmakerbot deleted the gbf/tenant_workspace branch January 22, 2021 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request sig/api size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants