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

Provide script to retrieve quota metrics from IoT Hub #137

Open
mbraekman opened this issue Feb 22, 2021 · 4 comments · May be fixed by #353
Open

Provide script to retrieve quota metrics from IoT Hub #137

mbraekman opened this issue Feb 22, 2021 · 4 comments · May be fixed by #353
Labels
area:iot-hub All issues related to IoT Hub feature All issues related to new features
Milestone

Comments

@mbraekman
Copy link
Contributor

Is your feature request related to a problem? Please describe.
As part of the setup for alert-creations for IoT Hub, a script has been included which allows you to determine the current quota of messages.
As this could be useful outside of that specific use-case, would form a nice addition for a new module Arcus.Scripting.IoT.Hub

Describe the solution you'd like
The current version of the script can be found in the CoditEU/platform-operations-specialization-area repo at the following location:
/platform-operations-specialization-area/alerting/catalog/templates/iothub/determine-messagequota-used-threshold.ps1

This is to be updated to ensure it aligns with the current naming conventions as used across all Arcus.Scripting-modules, as well as implement the suggested changes (parameterization) from the source-repo.

For more context, see the mentioned repo.
Credits: @fgheysels

@mbraekman mbraekman added feature All issues related to new features area:iot-hub All issues related to IoT Hub labels Feb 22, 2021
@mbraekman mbraekman added this to the v0.5.0 milestone Feb 22, 2021
@mbraekman mbraekman modified the milestones: v0.5.0, v0.6.0 May 28, 2021
@stijnmoreels stijnmoreels modified the milestones: v0.7.0, v0.8 Aug 26, 2022
@stijnmoreels
Copy link
Member

Q: in what way is this different from: Get-AzIoTHubQuotaMetric?

@fgheysels
Copy link
Member

fgheysels commented Dec 13, 2022

The script in the Codit repo retrieves one specific quota metric of an IoT Hub (Total Messages), and applies a (specified) percentage to it. The result of that script can then be used when creating an alert on IoT Hub that is triggered when the daily amount of messages that you have received, is reaching the quota / limit of that iothub.

(The alert that I'm talking about, is also available in the repo that @mbraekman mentionned: https://github.com/Codit/platform-operations-practice/tree/main/alerting/catalog/templates/iothub)

@stijnmoreels
Copy link
Member

Ok, but we can still use the Get-AzIoTHubQuotaMetric here, and use the percentage parameter from the Codit repo.

@stijnmoreels
Copy link
Member

So, this would be enough, right?

$quotaMetric = Get-AzIotHubQuotaMetric -Name $IoTHubName -ResourceGroupName $ResourceGroupName
$result = [Math]::Round($quotaMetric.MaxValue * $QuotaPercentage)

@stijnmoreels stijnmoreels self-assigned this Dec 29, 2022
@stijnmoreels stijnmoreels linked a pull request Dec 30, 2022 that will close this issue
@stijnmoreels stijnmoreels removed their assignment Jan 10, 2023
@stijnmoreels stijnmoreels modified the milestones: v0.8.0, v0.9.0 Jan 10, 2023
@pim-simons pim-simons modified the milestones: v0.9.0, v1.0.0, v1.1.0 May 10, 2023
@stijnmoreels stijnmoreels modified the milestones: v1.1.0, v1.2.0 Jul 3, 2023
@pim-simons pim-simons modified the milestones: v1.2.0, v1.3.0 Nov 21, 2023
@stijnmoreels stijnmoreels modified the milestones: v1.3.0, v1.4.0 Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:iot-hub All issues related to IoT Hub feature All issues related to new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants