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

[Metrics UI] Add endpoint for Metrics API #81693

Merged
merged 4 commits into from
Oct 29, 2020

Conversation

simianhacker
Copy link
Member

@simianhacker simianhacker commented Oct 26, 2020

Summary

This PR adds the endpoint for the Metrics API under POST /api/infra/metrics_api. This also changes the Metrics API so it will calculate the interval based on metricset.period if the user sets timerange.interval to modules and adds modules as an array of strings listing the modules.

Example

POST /api/infra/metrics_api
{
    "timerange": {
        "field": "@timestamp",
        "from": {{from}},
        "to": {{to}},
        "interval": "modules"
    },
   "modules": ["system.cpu"],
    "filter": [
        {
            "term": {
                "host.name": "2019-Macbook-Pro.local"
            }
        }
    ],
    "indexPattern": "metricbeat-*",
    "limit": 9,
    "metrics": [
        {
            "id": "user",
            "aggregations": {
                "user": {
                    "avg": {
                        "field": "system.cpu.user.pct"
                    }
                }
            }
        }
    ]
}

@simianhacker simianhacker added release_note:enhancement Feature:Metrics UI Metrics UI feature v8.0.0 Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.11.0 labels Oct 26, 2020
@simianhacker simianhacker added this to the Metrics UI 7.11 milestone Oct 26, 2020
@simianhacker simianhacker marked this pull request as ready for review October 27, 2020 15:12
@simianhacker simianhacker requested a review from a team as a code owner October 27, 2020 15:12
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@phillipb phillipb self-assigned this Oct 27, 2020
Copy link
Contributor

@phillipb phillipb left a comment

Choose a reason for hiding this comment

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

LGTM

@phillipb
Copy link
Contributor

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
infra 2.6MB 2.6MB +196.0B

distributable file count

id before after diff
default 48117 48119 +2

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@simianhacker simianhacker merged commit eedf067 into elastic:master Oct 29, 2020
simianhacker added a commit to simianhacker/kibana that referenced this pull request Oct 30, 2020
* [Metrics UI] Add endpoint for Metrics API

* Adding the ability to caculate the interval based on a module

* fixing types

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
simianhacker added a commit that referenced this pull request Oct 30, 2020
* [Metrics UI] Add endpoint for Metrics API

* Adding the ability to caculate the interval based on a module

* fixing types

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@simianhacker simianhacker deleted the metrics-api-endpoint branch April 17, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Metrics UI Metrics UI feature release_note:enhancement Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants