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 new unauthenticated route for reporting stats API #697

Merged
merged 4 commits into from
Feb 2, 2021

Conversation

abbashus
Copy link
Contributor

@abbashus abbashus commented Feb 1, 2021

Issue #, if available:

Description of changes:
This change introduces new unauthenticated route for Kibana reporting stats API api/reporting/stats.
The API exposes operational and business metrics for Kibana Reporting plugin.
See opendistro-for-elasticsearch/kibana-reports#277

Sample response:

  {
  "report": {  
    "create": {  # POST /api/reporting/generateReport
      "count": 0,
      "system_error": 0,
      "user_error": 3,
      "total": 0
    },
    "create_from_definition": {  # POST /api/reporting/gemerateReport/{reportDefinitionId}
      "count": 1,
      "system_error": 0,
      "user_error": 0,
      "total": 1
    },
    "download": {  # GET /api/reporting/generateReport/{reportId}
      "count": 5,
      "system_error": 0,
      "user_error": 0,
      "total": 5
    },
    "list": {  # GET /api/reporting/reports
      "count": 7,
      "system_error": 0,
      "user_error": 0,
      "total": 7
    },
    "info": {  # GET /api/reporting/reports/{reportId}
      "count": 1,
      "system_error": 0,
      "user_error": 0,
      "total": 1
    }
  },
  "report_definition": {
    "create": {  # POST /api/reporting/reportDefinition
      "count": 0,
      "system_error": 0,
      "user_error": 0,
      "total": 0
    },
    "list": {  # GET /api/reporting/reportDefinitions
      "count": 7,
      "system_error": 0,
      "user_error": 0,
      "total": 7
    },
    "info": {  # GET /api/reporting/reportDefinition/{reportDefinitionId}
      "count": 3,
      "system_error": 0,
      "user_error": 0,
      "total": 3
    },
    "update": {   # PUT /api/reporting/reportDefinition/{reportDefinitionId}
      "count": 0,
      "system_error": 0,
      "user_error": 0,
      "total": 0
    },
    "delete": {   # DELETE /api/reporting/reportDefinition/{reportDefinitionId}
      "count": 1,
      "system_error": 0,
      "user_error": 0,
      "total": 1
    }
  },
  "report_source": {   # GET /api/reporting/reportSource/{reportSourceType}
    "list": {
      "count": 3,
      "system_error": 0,
      "user_error": 0,
      "total": 3
    }
  },
  "dashboard": {
    "pdf": {
      "download": {
        "count": 1,
        "total": 1
      }
    },
    "png": {
      "download": {
        "count": 1,
        "total": 1
      }
    }
  },
  "visualization": {
    "pdf": {
      "download": {
        "count": 0,
        "total": 0
      }
    },
    "png": {
      "download": {
        "count": 0,
        "total": 0
      }
    }
  },
  "saved_search": {
    "csv": {
      "download": {
        "count": 4,
        "total": 4
      }
    }
  }
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@abbashus abbashus changed the title Add new unauthenticated route for reporting stats API (#673) Add new unauthenticated route for reporting stats API Feb 1, 2021
@yuxitang-amzn
Copy link
Contributor

Please fix the lint error.

@codecov
Copy link

codecov bot commented Feb 2, 2021

Codecov Report

Merging #697 (c2fa2d6) into main (6d455e7) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #697   +/-   ##
=======================================
  Coverage   74.59%   74.59%           
=======================================
  Files          85       85           
  Lines        1842     1842           
  Branches      237      237           
=======================================
  Hits         1374     1374           
  Misses        413      413           
  Partials       55       55           
Impacted Files Coverage Δ
...o_security/public/apps/configuration/constants.tsx 85.71% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d455e7...c2fa2d6. Read the comment docs.

@abbashus
Copy link
Contributor Author

abbashus commented Feb 2, 2021

Fixed the lint error.

@abbashus abbashus merged commit d9a64ca into opensearch-project:main Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants