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

feat: --mq-traces in support bundle operation #103

Merged
merged 11 commits into from
Nov 17, 2023

Conversation

digimaun
Copy link
Member

  • This PR introduces the optional --mq-traces flag to az iot ops support create-bundle.
  • This is a convenience/shortcut, as the stats command supports both fetching traces by --trace-ids or --trace-dir.
  • Also smooths out some tcp socket byte handling.

@digimaun digimaun marked this pull request as ready for review November 16, 2023 22:11
@digimaun digimaun requested a review from c-ryan-k November 16, 2023 22:11
for namespace in namespaces:
try:
traces = get_traces(namespace=namespace, trace_ids=["!support_bundle!"])
if traces:
Copy link
Member

Choose a reason for hiding this comment

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

nit - now that get_traces can return either a list of dicts or a list of tuples, do we need to typecheck its return value? Might even just be here, as the other reference to it is a straight return get_traces(...

Copy link
Member Author

Choose a reason for hiding this comment

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

Added test coverage for the return value in the stats tests area.

If the wrong type gets returned, and the later accessing code here causes an exception it should get caught, and also, we have a backup exception handler at the support bundle runner level.

Copy link
Member Author

@digimaun digimaun Nov 17, 2023

Choose a reason for hiding this comment

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

Also thinking about the type check it would per list item since the outer most type is either list or None. I kind of like the exception handle to provide a hint of something going wrong. We can consider making it a warning to show outside of --debug.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's discuss in subsequent PR.

@digimaun digimaun merged commit c96e1a0 into Azure:dev Nov 17, 2023
13 checks passed
@digimaun digimaun deleted the trace_in_support_bundle branch November 17, 2023 01:01
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.

2 participants