Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Reporting backend metrics #282

Merged
merged 28 commits into from
Jan 6, 2021

Conversation

abbashus
Copy link
Contributor

@abbashus abbashus commented Jan 4, 2021

Issue #, if available:

Description of changes:

  • Add new API _opendistro/_reports/stats to collect usage metrics and action metrics
  • Metrics details:
    count: request count in the last minute
    total: total request count since the server is up
    user_error: 4xx error status code in the last minute
    system_error: all other error status code in the last minute

Sample Response:

{
  "on_demand_from_definition": {
    "create": {
      "system_error": 0,
      "user_error": {
        "invalid_report_def_id": 0
      },
      "count": 0,
      "total": 0
    }
  },
  "report_instance": {
    "info": {
      "user_error": {
        "invalid_report_id": 0,
        "missing_report_instance": 0
      },
      "total": 0,
      "system_error": 0,
      "count": 0
    },
    "update": {
      "count": 0,
      "system_error": 0,
      "total": 0,
      "user_error": {
        "missing_report_instance": 0,
        "invalid_report_id": 0,
        "invalid_status": 0
      }
    },
    "list": {
      "user_error": {
        "invalid_from_index": 0
      },
      "total": 0,
      "count": 0,
      "system_error": 0
    }
  },
  "permission_user_error": 0,
  "request_total": 0,
  "report_definition": {
    "info": {
      "system_error": 0,
      "count": 0,
      "user_error": {
        "invalid_report_def_id": 0,
        "missing_report_def_details": 0
      },
      "total": 0
    },
    "delete": {
      "count": 0,
      "system_error": 0,
      "user_error": {
        "invalid_report_def_id": 0,
        "missing_report_def_details": 0
      },
      "total": 0
    },
    "update": {
      "user_error": {
        "invalid_report_def_id": 0,
        "invalid_report_definition": 0,
        "missing_report_def_details": 0
      },
      "count": 0,
      "system_error": 0,
      "total": 0
    },
    "create": {
      "system_error": 0,
      "user_error": 0,
      "count": 0,
      "total": 0
    },
    "list": {
      "system_error": 0,
      "count": 0,
      "total": 0,
      "user_error": {
        "invalid_from_index": 0
      }
    }
  },
  "on_demand": {
    "create": {
      "user_error": {
        "invalid_begin_time": 0,
        "invalid_status": 0,
        "invalid_end_time": 0
      },
      "system_error": 0,
      "total": 0,
      "count": 0
    }
  },
  "exception": {
    "illegal_state": 0,
    "illegal_argument": 0,
    "io": 0,
    "es_security": 0,
    "es_status": 0,
    "version_conflict_engine": 0,
    "invalid_index_name": 0,
    "index_not_found": 0,
    "internal_server_error": 0
  },
  "es_security_permission_error": 0,
  "failed_request_count_system_error": 0,
  "success_count": 0,
  "request_count": 0,
  "failed_request_count_user_error": 0
}

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

@codecov
Copy link

codecov bot commented Jan 4, 2021

Codecov Report

Merging #282 (b68ad64) into dev (45abee7) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #282   +/-   ##
=======================================
  Coverage   74.94%   74.94%           
=======================================
  Files          32       32           
  Lines        1764     1764           
  Branches      342      342           
=======================================
  Hits         1322     1322           
  Misses        437      437           
  Partials        5        5           

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 45abee7...b68ad64. Read the comment docs.

Copy link
Contributor

@davidcui1225 davidcui1225 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just some minor comments

Copy link
Contributor

@akbhatta akbhatta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add javadoc for the classes and public methods.

@abbashus abbashus merged commit 1c2a247 into opendistro-for-elasticsearch:dev Jan 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants