-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
[App Insights/Operational Insights] New Data Plane API versions, bug fixes, and cleanup #3084
Conversation
AutoRest linter results for SDK Related Validation Errors/WarningsThese errors are reported by the SDK team's validation tools, reachout to ADX Swagger Reviewers directly for any questions or concerns. File: specification/applicationinsights/data-plane/readme.md
|
AutoRest linter results for ARM Related Validation Errors/WarningsThese errors are reported by the ARM team's validation tools, reachout to ARM RP API Review directly for any questions or concerns. File: specification/applicationinsights/data-plane/readme.md
|
Automation for azure-libraries-for-javaNothing to generate for azure-libraries-for-java |
Automation for azure-sdk-for-nodeNothing to generate for azure-sdk-for-node |
Change Summary
|
Automation for azure-sdk-for-pythonA PR has been created for you: |
Automation for azure-sdk-for-goA PR has been created for you: |
Howdy @alexeldeib, sorry about the delay here! I'll have a review in by EOD. |
@marstr Any update here? I realize this is a non-trivial batch of changes, I tried to ease the review effort with the summary. Realistically I could have broken this into a few smaller PRs...20/20 hindsight and all 👓 Let me know if I can do any clean up that would make review easier. |
Ah sorry @alexeldeib, just dropping balls over here! I'll start reviewing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing egregious really, and if you decide to ignore my comments, I'll approve once you acknowledge them.
In terms of the CI, there is a linter rule that's failing, but it is an ARM specific rule that is not applicable to you. It is your decision if you implement the "operations" endpoint.
"paths": { | ||
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/components/{applicationName}/query": { | ||
"post": { | ||
"operationId": "Query_Post", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be more conventional to have this be "Query_Create", similar to how we name PUTs as "CreateOrUpdate".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still a read operation, but maybe something else that doesn't convey a write op? Or else I'd probably prefer to leave it as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Query_Execute
?
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"version": "2018-04-20", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see here and in your summarizing comment, that you seem to be moving to date strings for your API Version instead of a SemVer-like version string. Given that this is a data-plane library, you're free to use whichever you like, so it surprises me a little that you'd switch. Do you have documentation available that'll help folks navigate the different version formats?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're actually keeping both, I realize this is a bit funky. We're data plane but accessible via both ARM and a direct endpoint. For the direct endpoint (e.g. api.loganalytics.io), we use our own versioning (e.g. "v1"). In parallel we offer versions using Azure-style date string accessible via management.azure.com.
Generally these are very close/almost identical to their direct counterparts except where parameters differ, e.g. taking the Azure resource ID vs. taking a service-specific GUID. We doc the URL syntax (with versions) for both. Besides the URLs, the only difference is that the direct endpoint supports substantially larger payloads than ARM's limits (which matters, since we often return large DB query results).
}, | ||
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/components/{applicationName}/metrics/metadata": { | ||
"get": { | ||
"operationId": "GetMetricsMetadata", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that you broke out "Query" into its own operation group, I'd recommend doing the same for Metric and Event. That would mean that you'd have:
Metric_GetMetadata
Metric_Get
Event_List
Event_Get
Event_GetMetadata
(optionally with the OData Suffix as well, based on your judgement.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great -- I was hoping to do some cleanup here but had only played around with /query. Can you elaborate on how this impacts things downstream from swagger? From what I can tell this is used primarily for grouping operations in docs and (maybe in some of the?) SDKs? Still exploring how all the pieces fit together 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, for sure! The main difference as you suspect, is about group operations together. In addition to doc generation impacts, the AutoRest modeler actually assigns each operation group its own client. For example, you can see in the Go SDK for the Compute there are separate clients for interacting with VirtualMachines and interacting with a VM Image.
Getting the balance right of not making people new-up clients for everything, but also keeping operations discoverable is a bit of an art. You're really the only one who can tell me if it makes sense to interact with Queries, Metrics, and Events at the same time, or if there's always separation there. 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm...So I grouped the operations up and generated the C# and Python SDKs for comparison. I see how the operations group but It looks like they don't get a new client? Using the compute example, here's the C# version. I think for our purposes one client makes sense anyway, but I couldn't replicate what the Go SDK you pointed out was doing in another language -- wanted to clarify the expected behavior?
"name": "workspaces", | ||
"description": "Comma separated workspace IDs to include in cross-workspace queries.", | ||
"in": "query", | ||
"collectionFormat": "csv", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're at a refactoring with breaking changes, have you thought of making this a JSON array instead of a CSV list? I know that goes beyond Swagger changes, but I believe it'd improve the user experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For GET it's a csv in the query string, for POST it's a JSON array in the body. I think that makes sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah that totally makes sense! Sorry, I should've looked closer.
"paths": { | ||
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/query": { | ||
"post": { | ||
"operationId": "Query_Post", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as in the other API Version, I'd imagine this should be Query_Create
.
Automation for azure-sdk-for-rubyNothing to generate for azure-sdk-for-ruby |
Besides the operation groupings, let me know if you see anything remaining that sticks out. I'm also curious about the SDK treatment in the readme. I've been working to tie in with the Python and Nodejs SDKs. I saw you added treatment for Go and OperationalInsights also got Java treatment at some point. I guess i'm trying to ask a process clarification question -- I plan to continue adding SDK support where there are gaps still for these two RPs, but I don't want to step on any toes or duplicate work with SDK teams. For example, are there any known areas I should ignore for now because other teams hook into them, or places I should focus on fleshing out due to a lack of usage by others? Based on your reply, I might fill in some more SDK generation bits in the readme (e.g., App Insights Java, nodejs and typescript for both). Other than that from my end this looks pretty much good to go! |
I don't think you can step on any toes here! As for the other changes you're talking about, they seem like a good candidate for future PRs. |
Let me know if you're ready to merge :) |
Awesome -- ready to merge on my end! 👍 |
Clean up a few not used fields
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-version
in the path should match theapi-version
in the spec).Quality of Swagger