Uploaded image for project: 'Network Observability'
  1. Network Observability
  2. NETOBSERV-1748

Updating a FlowMetric may generate errors in FLP

    • False
    • None
    • False
    • Hide
      Previously, when using the FlowMetrics API to generate a custom metric and later modifying its labels (such as adding a new label), the metric stopped to be populated, and an error was showing up in flowlogs-pipeline logs.
      With this patch, it is now possible to modify the labels, and no more error is raised in the logs.
      Show
      Previously, when using the FlowMetrics API to generate a custom metric and later modifying its labels (such as adding a new label), the metric stopped to be populated, and an error was showing up in flowlogs-pipeline logs. With this patch, it is now possible to modify the labels, and no more error is raised in the logs.
    • NetObserv - Sprint 256, NetObserv - Sprint 257

      Description of problem:

      When a metric is created with the FlowMetric API, then edited (e.g. to change a label), it may generate an error in FLP:
      
      error msg=error during prometheus.Register: a previously registered descriptor with the same fully-qualified name as Desc{fqName: "netobserv_ingress_cardinality", help: "", constLabels: {}, variableLabels: {Flags,SrcSubnetLabel,DstK8S_Namespace,DstK8S_OwnerName,SrcK8S_OwnerName,SrcK8S_Namespace}} has different label names or a different help string
      
      

      Steps to Reproduce:

      1. Install netobserv
      2. Install a flowmetrics, e.g. "oc apply -f https://raw.githubusercontent.com/netobserv/network-observability-operator/main/config/samples/flowmetrics/pods_ingress_traffic.yaml -n netobserv"
      3. Edit it "oc edit flowmetrics flowmetric-pod-ingress-traffic", e.g. to add "Flags" as a label
      
      
      Actual results:
      
      The new metric never comes up.
      
      Also, in FLP logs:
      time=2024-07-16T10:49:29Z level=error msg=error during prometheus.Register: a previously registered descriptor with the same fully-qualified name as Desc{fqName: "netobserv_pod_ingress_bytes_total", help: "", constLabels: {}, variableLabels: {DstK8S_Name,DstK8S_Namespace,DstK8S_OwnerName,DstK8S_OwnerType,DstK8S_HostName,Flags}} has different label names or a different help string

      Expected results:

      No error

       

       

      Workaround:

      When modifying an existing metric that changes its definition in prometheus (different labels), the workaround is to also change the metric name, so prometheus sees it as a new metric.

      Alternatively, you can also restart the FLP pods.

              jtakvori Joel Takvorian
              jtakvori Joel Takvorian
              Mehul Modi Mehul Modi
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: