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 AWS Metricsets to Inventory Models #49983

Merged
merged 36 commits into from
Dec 12, 2019

Conversation

simianhacker
Copy link
Member

@simianhacker simianhacker commented Nov 1, 2019

Summary

This PR adds the AWS metricset to the Inventory Models for EC2, RDS, S3 and SQS. It also cleans up a few areas that were missed in the Inventory Model PR.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@simianhacker
Copy link
Member Author

@sorantis What "actions" should we have for the AWS EC2 metrics? Here is what we have now:

image

I think the question is "Can we correlate on EC2 data with our other pillars of Observability? If so what are the fields used for each option?"

@elasticmachine
Copy link
Contributor

💔 Build Failed

@sorantis
Copy link

sorantis commented Nov 15, 2019

@simianhacker good question.

  • View metrics should be possible as we [collect a bunch of them].(https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-metricset-aws-ec2.html)
  • View logs is a bit trickier. Currently we have support for S3 logs, and the plan is to add CloudWatch support. @kaiyan-sheng what would we need from AWS filebeat module to ensure correlation with logs? Can it be done already today? If so, what fields can we use?
  • View EC2 APM traces - I don't think we have any special handling for EC2. If an APM agent is installed on an EC2 VM, I'd assume we have similar correlation as with any host.
  • View EC2 in Uptime - Looks like Uptime can interact with AWS and get cloud metadata.

@kaiyan-sheng
Copy link
Contributor

kaiyan-sheng commented Nov 15, 2019

@sorantis What kind of correlation are you thinking? By looking at the ec2 log example, there will be the instanceId field that can be directly link back to ec2 metrics from Metricbeat.

I will start the investigation work around cloudwatch logs after I get the permissions I need from infra team.

@sorantis
Copy link

@kaiyan-sheng something that could tie AWS logs to metrics so that the View Logs would link to something meaningful. I believe the instance id could be it. @simianhacker wdyt?

@simianhacker simianhacker changed the title [Metrics UI] Add AWS EC2 Metricset to Inventory Models [Metrics UI] Add AWS Metricsets to Inventory Models Nov 20, 2019
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@simianhacker simianhacker added Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.6.0 v8.0.0 labels Dec 10, 2019
@elasticmachine
Copy link
Contributor

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

@simianhacker simianhacker marked this pull request as ready for review December 10, 2019 18:12
@simianhacker simianhacker requested a review from a team as a code owner December 10, 2019 18:12

import { TSVBMetricModelCreator, TSVBMetricModel } from '../../../types';

export const awsEC2CpuUtilization: TSVBMetricModelCreator = (
Copy link
Contributor

Choose a reason for hiding this comment

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

What about creating some util funcs for these modelCreators. For example:

const createAWSEC2Model = (indexPattern: string, timeField: string, series: any) => {
    return {
      requires: ['aws.ec2'],
      .....
      series
    }
}
createAWSEC2Model([
    {
      id: 'write',
      split_mode: 'everything',
      metrics: [
        {
          field: 'aws.ec2.diskio.write.bytes_per_sec',
          id: 'avg-write',
          type: 'avg',
        },
      ],
    },
    {
      id: 'read',
      split_mode: 'everything',
      metrics: [
        {
          field: 'aws.ec2.diskio.read.bytes_per_sec',
          id: 'avg-read',
          type: 'avg',
        },
        {
          id: 'calculation-rate',
          type: 'calculation',
          variables: [{ id: 'rate-var', name: 'rate', field: 'avg-read' }],
          script: 'params.rate * -1',
        },
      ],
    },
  ]);

Doing that could save about 70 lines of code in this PR alone.

Copy link
Member Author

Choose a reason for hiding this comment

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

That would work... I was also thinking for all the basic ones where it's just an avg/max/min we could just create a function that takes the field name. I'm sure that would reduce things down some too.

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.

Looks great! Lots of code, but I think that might just be the nature of what we're trying to build. Couple of tiny questions.

@@ -24,8 +26,14 @@ export const calculateMetricInterval = async (
framework: KibanaFramework,
requestContext: RequestHandlerContext,
options: Options,
modules: string[]
modules: string[],
nodeType?: InfraNodeType // TODO: check that this type still makes sense
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

History

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

@simianhacker simianhacker merged commit 617c8d5 into elastic:master Dec 12, 2019
simianhacker added a commit to simianhacker/kibana that referenced this pull request Dec 12, 2019
* Adding initial code for EC2

* Removing obsolute files; Adding EC2;

* Removing currentTimerange and replacing it with currentTime; Timerange will now be calcuated on the server

* Fixing AWS.s3 with Metrics Explorer

* Auto calculating timerange and interval based on metricset.period

* Adding S3 metricset

* Inital addition of RDS metrics

* Adding SQS and fixing a few things

* Fixing typescript error

* Adding RDS; Adjusting fields for S3; adding new formatter

* Return 60 seconds by detault

* Fixing types

* Removing i18n

* Fixing tests

* Fixing translations

* Fixes from merge

* Removing IDX from code not covered by elastic#52354

* fixing tests

* Adding controls for crossliking; consolidating display name

* remove obsolete import

* Adding drop_last_bucket_support to TSVB models

* Changing type

* Fixing value per type

* remvoing obsolete translation

* Removing duplicate lines

* Removing icons from switcher

* Reducing boilerplate in Toolbar Items

* Changing file name
simianhacker added a commit that referenced this pull request Dec 13, 2019
* Adding initial code for EC2

* Removing obsolute files; Adding EC2;

* Removing currentTimerange and replacing it with currentTime; Timerange will now be calcuated on the server

* Fixing AWS.s3 with Metrics Explorer

* Auto calculating timerange and interval based on metricset.period

* Adding S3 metricset

* Inital addition of RDS metrics

* Adding SQS and fixing a few things

* Fixing typescript error

* Adding RDS; Adjusting fields for S3; adding new formatter

* Return 60 seconds by detault

* Fixing types

* Removing i18n

* Fixing tests

* Fixing translations

* Fixes from merge

* Removing IDX from code not covered by #52354

* fixing tests

* Adding controls for crossliking; consolidating display name

* remove obsolete import

* Adding drop_last_bucket_support to TSVB models

* Changing type

* Fixing value per type

* remvoing obsolete translation

* Removing duplicate lines

* Removing icons from switcher

* Reducing boilerplate in Toolbar Items

* Changing file name
timductive pushed a commit to timductive/kibana that referenced this pull request Dec 16, 2019
* Adding initial code for EC2

* Removing obsolute files; Adding EC2;

* Removing currentTimerange and replacing it with currentTime; Timerange will now be calcuated on the server

* Fixing AWS.s3 with Metrics Explorer

* Auto calculating timerange and interval based on metricset.period

* Adding S3 metricset

* Inital addition of RDS metrics

* Adding SQS and fixing a few things

* Fixing typescript error

* Adding RDS; Adjusting fields for S3; adding new formatter

* Return 60 seconds by detault

* Fixing types

* Removing i18n

* Fixing tests

* Fixing translations

* Fixes from merge

* Removing IDX from code not covered by elastic#52354

* fixing tests

* Adding controls for crossliking; consolidating display name

* remove obsolete import

* Adding drop_last_bucket_support to TSVB models

* Changing type

* Fixing value per type

* remvoing obsolete translation

* Removing duplicate lines

* Removing icons from switcher

* Reducing boilerplate in Toolbar Items

* Changing file name
@simianhacker simianhacker deleted the aws-ec2 branch April 17, 2024 15:15
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.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants