Uploaded image for project: 'Red Hat Internal Developer Platform'
  1. Red Hat Internal Developer Platform
  2. RHIDP-9710

Create aggregated metrics API for Scorecard backend plugin

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Major Major
    • 1.9.0
    • None
    • Scorecard plugin
    • None
    • RHDH Plugins 3283

      Story

      Create an API to fetch metric values.

      The format should look like this:

      GET /scorecard/metrics/aggregated

      Support threshold definitions Config or default one:

      Config:

      scorecard:
       plugins:
         jira:
           open_issues:
             thresholds:
               rules:
                 error: ">40"
                 warning: ">20"
                 success: "<=20"

      Expected return object:

       

      {
       id: 'jira.issues_open',
       status: 'success',
       metadata: {
         title: 'Open Jira Issues',
         type: 'object',
         history: true,
       },
       result: {
         value: {
      success: {
        value: 2,
        entities: [“component:default/example-website”, “api:default/example-grpc-api”]
      },
      warning: {
        value: 1,
        entities: [“system:default/examples”]
      },
      error: {
          value: 3
        entities: [
          “component:default/site-testing”, 
          “component:default/site-production”, 
          “component:default/site-staging”
        ]
      },
         }
         timestamp: '2024-01-15T10:30:00Z',
         lastUpdated: '2024-01-15T10:30:00Z',
         thresholdResult: {
           definition: {
             rules: [
               { key: 'error', expression: '>40' },
               { key: 'warning', expression: '>20' },
               { key: 'success', expression: '<=20' },
             ],
           },
           status: 'success',
           evaluation: 'error',
         },
       },
       }
      }
      

       

      Background

      Dependencies and Blockers

      QE impacted work

      Documentation impacted work

      Acceptance Criteria

      upstream documentation updates (design docs, release notes etc)

      Technical enablement / Demo

              rh-ee-imykhno Ihor Mykhno
              rh-ee-imykhno Ihor Mykhno
              RHIDP - Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: