Uploaded image for project: 'Observability Documentation'
  1. Observability Documentation
  2. OBSDOCS-2897

add thanos ruler retention default value as user workload prometheus retention setting

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • None
    • 0
    • False
    • Hide

      None

      Show
      None
    • False

      with https://issues.redhat.com/browse/MON-4444 merged to 4.21, PR: https://github.com/openshift/cluster-monitoring-operator/pull/2759

      If the user configured a retention for user-workload Prometheus but did not explicitly set a retention for Thanos Ruler, default Thanos Ruler retention to the same value as Prometheus. This keeps the effective retention aligned, unless the user overrides it for Thanos Ruler.

      explanation:

      1. configured a retention for user-workload Prometheus but did not explicitly set a retention for Thanos Ruler, default Thanos Ruler retention to the same value as Prometheus. This also include no user-workload  promethues/thanos ruler retention settings.

      no user-workload  promethues/thanos ruler retention settings. default retention for user-workload  promethues/thanos ruler is 24h

      $ oc -n openshift-user-workload-monitoring get po thanos-ruler-user-workload-0 -oyaml | grep -i retention
          - --tsdb.retention=24h
      $ oc -n openshift-user-workload-monitoring get po prometheus-user-workload-0 -oyaml | grep -i retention
          - --storage.tsdb.retention.time=24h
      

      set user-workload  promethues retention only

      apiVersion: v1
      data:
        config.yaml: |
          prometheus:
            retention: 2d
      kind: ConfigMap
      metadata:
        name: user-workload-monitoring-config
        namespace: openshift-user-workload-monitoring 

      Thanos Ruler retention to the same value as user-workload Prometheus

      $ oc -n openshift-user-workload-monitoring get po prometheus-user-workload-0 -oyaml | grep -i retention
          - --storage.tsdb.retention.time=2d
      
      $ oc -n openshift-user-workload-monitoring get po thanos-ruler-user-workload-0 -oyaml | grep -i retention
          - --tsdb.retention=2d
      

       

      2.  set different retention value for user-workload  promethues/thanos ruler

      $ oc -n openshift-user-workload-monitoring get cm user-workload-monitoring-config -oyaml
      apiVersion: v1
      data:
        config.yaml: |
          prometheus:
            retention: 2d
          thanosRuler:
            retention: 36h
      kind: ConfigMap
      metadata:
        name: user-workload-monitoring-config
        namespace: openshift-user-workload-monitoring 

      thanos ruler would use its retention setting

      $ oc -n openshift-user-workload-monitoring get po prometheus-user-workload-0 -oyaml | grep -i retention
          - --storage.tsdb.retention.time=2d
      
      $ oc -n openshift-user-workload-monitoring get po thanos-ruler-user-workload-0 -oyaml | grep -i retention
          - --tsdb.retention=36h
      

       

      should add note `If the user configured a retention for user-workload Prometheus but did not explicitly set a retention for Thanos Ruler, default Thanos Ruler retention to the same value as Prometheus` to

      https://docs.redhat.com/en/documentation/openshift_container_platform/4.20/html/monitoring/configuring-user-workload-monitoring#modifying-the-retention-time-for-thanos-ruler-metrics-data_storing-and-recording-data-uwm

              eromanov@redhat.com Eliska Romanova
              juzhao@redhat.com Junqi Zhao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: