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

update tracing for consistency #18076

Merged
merged 5 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk/identity/identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ Azure Service Fabric support hasn't been added on the initial version 2 of Ident
- Identity v2 also removes the `postLogoutRedirectUri` from the options to the constructor for `InteractiveBrowserCredential`. This option wasn't being used. Instead of using this option, use MSAL directly. For more information, see [Authenticating with the @azure/msal-browser Public Client](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-the-azuremsal-browser-public-client).
- In Identity v2, `VisualStudioCodeCredential` throws a `CredentialUnavailableError` unless the new [@azure/identity-vscode](https://www.npmjs.com/package/@azure/identity-vscode) plugin is used.

- Standardizing the tracing span names to be `<className>.<operationName>` over `<className>-<operationName>`
KarishmaGhiya marked this conversation as resolved.
Show resolved Hide resolved

#### Breaking Changes from 2.0.0-beta.4

- Removed the `allowMultiTenantAuthentication` option from all of the credentials. Multi-tenant authentication is now enabled by default. On Node.js, it can be disabled with the `AZURE_IDENTITY_DISABLE_MULTITENANTAUTH` environment variable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class AzureCliCredential implements TokenCredential {

let responseData = "";

const { span } = createSpan("AzureCliCredential-getToken", options);
const { span } = createSpan("AzureCliCredential.getToken", options);

try {
const obj = await cliCredentialInternals.getAzureCliAccessToken(resource, tenantId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class ChainedTokenCredential implements TokenCredential {
let successfulCredentialName = "";
const errors = [];

const { span, updatedOptions } = createSpan("ChainedTokenCredential-getToken", options);
const { span, updatedOptions } = createSpan("ChainedTokenCredential.getToken", options);

for (let i = 0; i < this._sources.length && token === null; i++) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ClientSecretCredential implements TokenCredential {
options?: GetTokenOptions
): Promise<AccessToken | null> {
const { span, updatedOptions: newOptions } = createSpan(
"ClientSecretCredential-getToken",
"ClientSecretCredential.getToken",
options
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class ManagedIdentityCredential implements TokenCredential {
): Promise<AccessToken> {
let result: AccessToken | null = null;

const { span, updatedOptions } = createSpan("ManagedIdentityCredential-getToken", options);
const { span, updatedOptions } = createSpan("ManagedIdentityCredential.getToken", options);

try {
// isEndpointAvailable can be true, false, or null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class UsernamePasswordCredential implements TokenCredential {
options?: GetTokenOptions
): Promise<AccessToken | null> {
const { span, updatedOptions: newOptions } = createSpan(
"UsernamePasswordCredential-getToken",
"UsernamePasswordCredential.getToken",
options
);
try {
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/identity/src/util/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { OperationOptions } from "@azure/core-client";
* @internal
*/
export const createSpan = createSpanFunction({
packagePrefix: "Azure.Identity",
packagePrefix: "",
namespace: "Microsoft.AAD"
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ describe("AzureApplicationCredential", function() {
},
children: [
{
name: "Azure.Identity.ChainedTokenCredential-getToken",
name: "ChainedTokenCredential.getToken",
children: [
{
name: "Azure.Identity.EnvironmentCredential.getToken",
name: "EnvironmentCredential.getToken",
children: [
{
name: "Azure.Identity.ClientSecretCredential.getToken",
name: "ClientSecretCredential.getToken",
children: []
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe("ClientCertificateCredential", function() {
},
children: [
{
name: "Azure.Identity.ClientCertificateCredential.getToken",
name: "ClientCertificateCredential.getToken",
children: []
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("ClientSecretCredential", function() {
},
children: [
{
name: "Azure.Identity.ClientSecretCredential.getToken",
name: "ClientSecretCredential.getToken",
children: []
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe("DeviceCodeCredential", function() {
},
children: [
{
name: "Azure.Identity.DeviceCodeCredential.getToken",
name: "DeviceCodeCredential.getToken",
children: []
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ describe("EnvironmentCredential", function() {
},
children: [
{
name: "Azure.Identity.EnvironmentCredential.getToken",
name: "EnvironmentCredential.getToken",
children: [
{
name: "Azure.Identity.ClientSecretCredential.getToken",
name: "ClientSecretCredential.getToken",
children: []
}
]
Expand Down Expand Up @@ -161,10 +161,10 @@ describe("EnvironmentCredential", function() {
},
children: [
{
name: "Azure.Identity.EnvironmentCredential.getToken",
name: "EnvironmentCredential.getToken",
children: [
{
name: "Azure.Identity.ClientCertificateCredential.getToken",
name: "ClientCertificateCredential.getToken",
children: []
}
]
Expand Down Expand Up @@ -197,10 +197,10 @@ describe("EnvironmentCredential", function() {
},
children: [
{
name: "Azure.Identity.EnvironmentCredential.getToken",
name: "EnvironmentCredential.getToken",
children: [
{
name: "Azure.Identity.UsernamePasswordCredential.getToken",
name: "UsernamePasswordCredential.getToken",
children: []
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe("UsernamePasswordCredential", function() {
},
children: [
{
name: "Azure.Identity.UsernamePasswordCredential.getToken",
name: "UsernamePasswordCredential.getToken",
children: []
}
]
Expand Down