XMLWordPrintable

Details

    • Sub-task
    • Resolution: Done
    • Major
    • None
    • None
    • Camel-K
    • % %

    Description

      What

      For SRE or a customer to manage Camel K, they need to be notified if there is an issue occurring or degraded service, for example, the UI is unreachable or the API request duration has been above 10s for the last 5 mins.

      How

      The alerts are PrometheusRule resources. This will be the same as the creation and reconciliation of other child resources created as part of a Camel-K operator deployment and IntegrationPlatform CR instantiation, for example, the deployment resource.

      Futher Information:

      Note:

      • This could be feature flagged in the CR spec and only created if turned on
      • The prometheus operator needs to be installed on cluster for the PrometheusRule CR kind to exist. It is easy to check for the existence of a resource kind using the following code
        import (
        	"github.com/operator-framework/operator-sdk/pkg/k8sutil"
        	"k8s.io/client-go/discovery"
        	"k8s.io/client-go/rest"
        )
        
        ...
        
        // hasServiceMonitor checks if ServiceMonitor is registered in the cluster.
        func hasServiceMonitor(config *rest.Config) (bool, error) {
        	dc := discovery.NewDiscoveryClientForConfigOrDie(config)
        	apiVersion := "monitoring.coreos.com/v1"
        	kind := "PrometheusRule"
        
        	return k8sutil.ResourceExists(dc, apiVersion, kind)
        }
        

      Attachments

        Activity

          People

            astefanu@redhat.com Antonin Stefanutti
            dffrench@redhat.com David Ffrench
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: