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

[Monitor Query] move to tracing 1.0.0 #21260

Merged
merged 18 commits into from
Jun 8, 2022

Conversation

KarishmaGhiya
Copy link
Contributor

@KarishmaGhiya KarishmaGhiya commented Apr 6, 2022

Fixes #21245

Packages impacted by this PR

@azure/monitor-query

Issues associated with this PR

Describe the problem that is addressed by this PR

Upgrading tracing to 1.0.0 for monitor query and setting up tracing for monitor query APIs.

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Are there test cases added in this PR? (If not, why?)

Provide a list of related PRs (if any)

Command used to generate this PR:**(Applicable only to SDK release request PRs)

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)

@ghost ghost added the Monitor Monitor, Monitor Ingestion, Monitor Query label Apr 6, 2022
@azure-sdk
Copy link
Collaborator

azure-sdk commented Apr 6, 2022

API change check for @azure/monitor-query

API changes have been detected in @azure/monitor-query. You can review API changes here

API changes

- export interface ListMetricNamespacesOptions {
+ export interface ListMetricNamespacesOptions extends OperationOptions {

namespace: "Microsoft.Monitor",
packagePrefix: "Azure.Monitor.Query",
packageName: "@azure/monitor-query",
Copy link
Member

Choose a reason for hiding this comment

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

We can add the package version here is as well

packageVersion: SDK_VERSION // from constants.ts

// maxPageSize: 2,
// continuationToken: null
// }),
// client.listMetricNames("resourceUri")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unsure about the accurate way of testing the list methods with the supportsTracing . I put the error in the comment above cc: @maorleger @xirzec

Copy link
Member

Choose a reason for hiding this comment

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

I think if you call next it should work. byPage itself is not an async function and doesn't make any calls. next starts fetching data

@KarishmaGhiya KarishmaGhiya marked this pull request as ready for review April 8, 2022 20:21
Copy link
Member

@maorleger maorleger left a comment

Choose a reason for hiding this comment

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

🚀 A few nits but LGTM tracing-wise. Thank you!

@@ -123,10 +130,10 @@ export class MetricsQueryClient {
resourceUri: string,
options: ListMetricDefinitionsOptions = {}
): AsyncIterableIterator<Array<MetricDefinition>> {
const segmentResponse = await this._definitionsClient.metricDefinitions.list(
const segmentResponse = await tracingClient.withSpan("MetricsQueryClient.listSegmentOfMetricDefinitions",options, async (updatedOptions) => await this._definitionsClient.metricDefinitions.list(
Copy link
Member

Choose a reason for hiding this comment

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

I'm surprised prettier didn't format this? Or maybe it did and that's why build is failing I haven't checked...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed the formatting

options
),
client.queryBatch([
{
Copy link
Member

Choose a reason for hiding this comment

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

Nit: since we ignore any and all errors anyway, maybe it makes sense to just make this the smallest possible batch that sends a request. For example does client.queryBatch([]) send a request to the server? Having all of this in here adds noise otherwise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reduced it to one query.

@KarishmaGhiya KarishmaGhiya enabled auto-merge (squash) April 12, 2022 21:57
@KarishmaGhiya KarishmaGhiya enabled auto-merge (squash) April 12, 2022 21:58
@KarishmaGhiya
Copy link
Contributor Author

/azp run js - monitor - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-monitor-query

@xirzec
Copy link
Member

xirzec commented May 28, 2022

I think we might have to merge master to get changes from #21967

@mpodwysocki can you review this PR when you get a chance?

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

Copy link
Contributor

@mpodwysocki mpodwysocki left a comment

Choose a reason for hiding this comment

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

LGTM

@KarishmaGhiya KarishmaGhiya merged commit f36d6b5 into Azure:main Jun 8, 2022
@KarishmaGhiya KarishmaGhiya deleted the tracing-monitor-query branch June 8, 2022 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Monitor Monitor, Monitor Ingestion, Monitor Query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Monitor Query] Update the package to use core-tracing 1.0
5 participants