Skip to content

Commit

Permalink
Add tracing spans to azquery (#21986)
Browse files Browse the repository at this point in the history
* Add tracing spans to azquery

* fix moduleName const

* remove vestigial setting
  • Loading branch information
jhendrixMSFT authored Nov 15, 2023
1 parent 5df5a71 commit 4acec80
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions sdk/monitor/azquery/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs Fixed

### Other Changes
* Enabled spans for distributed tracing.

## 1.1.0 (2023-05-09)

Expand Down
2 changes: 1 addition & 1 deletion sdk/monitor/azquery/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
``` yaml
title: Logs Query Client
clear-output-folder: false
export-clients: true
go: true
input-file:
- https://github.com/Azure/azure-rest-api-specs/blob/72427ef3ff5875bd8409ef112ef5e6f3cf2b8795/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/2022-10-27/OperationalInsights.json
Expand All @@ -13,6 +12,7 @@ openapi-type: "data-plane"
output-folder: ../azquery
security: "AADToken"
use: "@autorest/[email protected]"
inject-spans: true
version: "^3.0.0"

directive:
Expand Down
4 changes: 2 additions & 2 deletions sdk/monitor/azquery/custom_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewLogsClient(credential azcore.TokenCredential, options *LogsClientOptions
}

authPolicy := runtime.NewBearerTokenPolicy(credential, []string{c.Audience + "/.default"}, nil)
azcoreClient, err := azcore.NewClient("azquery.LogsClient", version, runtime.PipelineOptions{PerRetry: []policy.Policy{authPolicy}}, &options.ClientOptions)
azcoreClient, err := azcore.NewClient(moduleName, version, runtime.PipelineOptions{PerRetry: []policy.Policy{authPolicy}}, &options.ClientOptions)
if err != nil {
return nil, err
}
Expand All @@ -67,7 +67,7 @@ func NewMetricsClient(credential azcore.TokenCredential, options *MetricsClientO
}

authPolicy := runtime.NewBearerTokenPolicy(credential, []string{c.Audience + "/.default"}, nil)
azcoreClient, err := azcore.NewClient("azquery.MetricsClient", version, runtime.PipelineOptions{PerRetry: []policy.Policy{authPolicy}}, &options.ClientOptions)
azcoreClient, err := azcore.NewClient(moduleName, version, runtime.PipelineOptions{PerRetry: []policy.Policy{authPolicy}}, &options.ClientOptions)
if err != nil {
return nil, err
}
Expand Down
6 changes: 6 additions & 0 deletions sdk/monitor/azquery/logs_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions sdk/monitor/azquery/metrics_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/monitor/azquery/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
package azquery

const (
moduleName = "azquery"
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/monitor/azquery"
version = "v1.1.1"
)

0 comments on commit 4acec80

Please sign in to comment.