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

Fix azure-mgmt-monitor example code #29571

Closed
legdba opened this issue Mar 24, 2023 · 3 comments · May be fixed by MicrosoftDocs/azure-docs-sdk-python#1713
Closed

Fix azure-mgmt-monitor example code #29571

legdba opened this issue Mar 24, 2023 · 3 comments · May be fixed by MicrosoftDocs/azure-docs-sdk-python#1713
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Docs Mgmt This issue is related to a management-plane library. Monitor Monitor, Monitor Ingestion, Monitor Query needs-team-attention This issue needs attention from Azure service team or SDK team

Comments

@legdba
Copy link

legdba commented Mar 24, 2023

  • Package Name: azure-mgmt-monitor
  • Package Version: 5.0.1
  • Operating System: Ubuntu 22.04.2 LTS
  • Python Version: 3.10.6

Describe the bug
Sample code from documentation (https://learn.microsoft.com/en-us/python/api/overview/azure/monitoring?view=azure-python-previous&viewFallbackFrom=azure-python) does not work:

Traceback (most recent call last):
  File "./test", line 88, in <module>
    print("{} ({})".format(item.name.localized_value, item.unit.name))
AttributeError: 'str' object has no attribute 'name'

item.unit.name should be item.unit.

I also suggest updating the example to be a fully functional code, not just a snippet. As it is, it misses credentials.

To Reproduce
Steps to reproduce the behavior:

  1. Run Azure sample code

Expected behavior
Executes and returns value.

Screenshots
N/A

Additional context
N/A

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 24, 2023
@github-actions github-actions bot added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Mar 24, 2023
@mccoyp
Copy link
Member

mccoyp commented Mar 24, 2023

Hi @legdba, thank you for opening an issue! I'll tag some folks who should be able to help and we'll get back to you as soon as possible.

@mccoyp mccoyp added Monitor Monitor, Monitor Ingestion, Monitor Query Mgmt This issue is related to a management-plane library. CXP Attention and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Mar 24, 2023
@ghost ghost added the needs-team-attention This issue needs attention from Azure service team or SDK team label Mar 24, 2023
@ghost
Copy link

ghost commented Mar 24, 2023

Thank you for your feedback. This has been routed to the support team for assistance.

@mccoyp mccoyp added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 24, 2023
@SaurabhSharma-MSFT
Copy link
Member

@legdba The PR for the fix has been created and it will be merged soon. Thanks again for pointing this out, I am closing the issue based on this update, please let us know if there is something else that we can help you with.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Docs Mgmt This issue is related to a management-plane library. Monitor Monitor, Monitor Ingestion, Monitor Query needs-team-attention This issue needs attention from Azure service team or SDK team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants