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

Disable metrics and events in unsupported regions #36

Merged
merged 2 commits into from
Feb 16, 2017
Merged

Disable metrics and events in unsupported regions #36

merged 2 commits into from
Feb 16, 2017

Conversation

djberg96
Copy link
Collaborator

@djberg96 djberg96 commented Feb 9, 2017

This PR uses the SupportsFeatureMixin and the most recent azure-armrest gem to disable metrics and events collection in regions that are not supported.

Note that this requires the addition of :metrics to the support matrix. See ManageIQ/manageiq#13381

You will also have to update gems-pending-config to point to azure-armrest 0.6.0.

@djberg96
Copy link
Collaborator Author

djberg96 commented Feb 9, 2017

@miq-bot add_label wip

@miq-bot
Copy link
Member

miq-bot commented Feb 9, 2017

@djberg96 Cannot apply the following label because they are not recognized: wip

@miq-bot miq-bot added the wip label Feb 9, 2017
@djberg96
Copy link
Collaborator Author

Note to self: as per conversation with the UI folks, we may want to add a textual summary for the UI at app/helpers/ems_cloud_helper/textual_summary.rb (in the classic-ui repo).

@djberg96 djberg96 changed the title [WIP] Disable metrics and events in unsupported regions Disable metrics and events in unsupported regions Feb 14, 2017
@djberg96
Copy link
Collaborator Author

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Feb 14, 2017
@djberg96
Copy link
Collaborator Author

@bronaghs @durandom Please take a look. The event handling is very similar to the OpenStack approach. For metrics, I just put a check within the get_counters method which basically short circuits the issue until a more unified solution comes along.

Copy link
Member

@durandom durandom left a comment

Choose a reason for hiding this comment

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

Overall looks good and straight forward.

Personally I'd split this into 4 PRs

  • insights?
  • :timeline
  • metrics
  • supports specs for discovery, etc

This makes it easier to backport things in the future.

But not really important

@@ -1,3 +1,5 @@
require 'azure-armrest'
Copy link
Member

Choose a reason for hiding this comment

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

wont this already be required by connect ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was hitting some kind of weird load ordering issue that I couldn't nail down, which resulted in undefined constant errors.

@@ -183,6 +183,13 @@ def raw_metrics_for_counter(storage_conn, counter, start_time, end_time)
end

def get_counters(metrics_conn)
ems = target.ext_management_system

unless ems.supports_timeline?
Copy link
Member

Choose a reason for hiding this comment

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

would this be better ems.insights? to not conflate with timelines / events ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, probably. I will update.

Copy link

@bronaghs bronaghs left a comment

Choose a reason for hiding this comment

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

Just one question/suggestion, but this is great.

@@ -183,6 +183,13 @@ def raw_metrics_for_counter(storage_conn, counter, start_time, end_time)
end

def get_counters(metrics_conn)
ems = target.ext_management_system

unless ems.supports_timeline?

Choose a reason for hiding this comment

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

@djberg96 - I would probably move this to line 78 after we check for an EMS, this would keep the checks together and avoid calling methods if metrics isn't supported. Or is there a reason for placing this line here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll try it and report back.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bronaghs Ok, I've moved it as you suggested. Seems to work just as well there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bronaghs Upon further review it seems to cause test failures because of with_provider_connection which is called again later within the same method. I've moved it back for now.

Daniel Berger added 2 commits February 15, 2017 08:22
Update get_counter to skip counter collection if timeline isn't supported.

Added supports feature specs.

Initial commit.
@miq-bot
Copy link
Member

miq-bot commented Feb 15, 2017

Checked commits https://github.com/djberg96/manageiq-providers-azure/compare/98c982ddb15d0ac60e0a3b70761ab1bde61c9bd4~...8d18453d847ba408a5876e6c9482c95091f8288f with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
5 files checked, 0 offenses detected
Everything looks good. 🏆

Copy link
Member

@durandom durandom left a comment

Choose a reason for hiding this comment

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

👍 from me
@bronaghs do you want to merge?

@bronaghs bronaghs merged commit 9d26ce2 into ManageIQ:master Feb 16, 2017
@blomquisg blomquisg added this to the Sprint 55 Ending Feb 27, 2017 milestone Mar 2, 2017
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.

5 participants