newrelic / nr1-cloud-optimize

NR1 Cloud Optimize allows you to Identify right-sizing opportunities and potential savings of your AWS, GCP, and Azure instances across your cloud environment.
https://discuss.newrelic.com/t/cloud-optimizer-nerdpack/82936
Apache License 2.0
50 stars 37 forks source link

Remove JSON value from matchedInstance key #23

Closed StephenGoodall closed 4 years ago

StephenGoodall commented 4 years ago

Replace matchedInstance JSON with a simple value to make CSV export readable Fixes https://github.com/newrelic/nr1-cloud-optimize/issues/22

Kav91 commented 4 years ago

Thanks @StephenGoodall good catch, I think we should take the few useful pieces of information from the matched instance object and place it into the table rather then remove it all.

It contains useful information about the instance that the user should look at moving too.

StephenGoodall commented 4 years ago

@Kav91 would that be in separate columns, or just a few values in that single column?

Let me know which values/fields and format you prefer and I can take a look tomorrow and update this PR

Cheers

Kav91 commented 4 years ago

@StephenGoodall we should do separate columns so it remains easy to sort.

We should definitely have the instance type, instance category, and the associated price, and name them accordingly to avoid overlapping other keys. eg. matchedInstanceType, matchedInstancePrice

I'm up for any suggestions if you find any other useful attributes in there as well.

StephenGoodall commented 4 years ago

@Kav91 This seems to be what comes back as the object:

{
  "category": "Memory optimized",
  "type": "r5a.xlarge",
  "onDemandPrice": 0.254,
  "spotPrice": [
    {
      "zone": "eu-west-1b",
      "price": 0.0756
    },
    {
      "zone": "eu-west-1c",
      "price": 0.0756
    },
    {
      "zone": "eu-west-1a",
      "price": 0.254
    }
  ],
  "cpusPerVm": 4,
  "memPerVm": 32,
  "gpusPerVm": 0,
  "ntwPerf": "10 Gigabit",
  "ntwPerfCategory": "high",
  "zones": null,
  "attributes": {
    "cpu": "4",
    "instanceTypeCategory": "Memory optimized",
    "memory": "32",
    "networkPerfCategory": "high",
    "currentGen": true,
    "cloud": "amazon"
  }
}

Should we just use the on-demand price? Or do we need to show each AZ's spot price too? I would say On-Demand makes more sense when making comparisons as it's more "fixed"

Using these keys (as you recommended): matchedInstanceType matchedInstanceCategory matchedInstancePrice

Kav91 commented 4 years ago

@StephenGoodall thanks for the update, lgtm will merge 👍

devfreddy commented 4 years ago

:tada: This PR is included in version 1.1.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: