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

Revert "Tracing: Adds ITrace as the default tracing implementation for CosmosDiagnostics" #2203

Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ namespace Microsoft.Azure.Cosmos
{
using System;
using System.Globalization;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.Cosmos.Tracing;
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Collections;

Expand Down Expand Up @@ -48,7 +49,7 @@ public abstract ValueTask<string> GetUserAuthorizationTokenAsync(
string requestVerb,
INameValueCollection headers,
AuthorizationTokenType tokenType,
ITrace trace);
CosmosDiagnosticsContext diagnosticsContext);

public abstract void TraceUnauthorized(
DocumentClientException dce,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace Microsoft.Azure.Cosmos
using System;
using System.Globalization;
using System.Net;
using System.Net.Http;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.Cosmos.Core.Trace;
using Microsoft.Azure.Cosmos.Tracing;
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Collections;

Expand Down Expand Up @@ -94,7 +94,7 @@ public override ValueTask<string> GetUserAuthorizationTokenAsync(
string requestVerb,
INameValueCollection headers,
AuthorizationTokenType tokenType,
ITrace trace)
CosmosDiagnosticsContext diagnosticsContext)
{
// this is masterkey authZ
headers[HttpConstants.HttpHeaders.XDate] = DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Microsoft.Azure.Cosmos
{
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Azure.Cosmos.Core.Trace;
using Microsoft.Azure.Cosmos.Tracing;
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Collections;

Expand Down Expand Up @@ -44,7 +44,7 @@ public override ValueTask<string> GetUserAuthorizationTokenAsync(
string requestVerb,
INameValueCollection headers,
AuthorizationTokenType tokenType,
ITrace trace)
CosmosDiagnosticsContext diagnosticsContext)
{
// If the input auth token is a resource token, then use it as a bearer-token.
return this.urlEncodedAuthKeyResourceTokenValueTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Microsoft.Azure.Cosmos
using System.Threading.Tasks;
using global::Azure.Core;
using Microsoft.Azure.Cosmos.Core.Trace;
using Microsoft.Azure.Cosmos.Tracing;
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Collections;

Expand Down Expand Up @@ -39,7 +38,7 @@ public AuthorizationTokenProviderTokenCredential(
AuthorizationTokenType tokenType)
{
string token = AuthorizationTokenProviderTokenCredential.GenerateAadAuthorizationSignature(
await this.tokenCredentialCache.GetTokenAsync(NoOpTrace.Singleton));
await this.tokenCredentialCache.GetTokenAsync(EmptyCosmosDiagnosticsContext.Singleton));
return (token, default);
}

Expand All @@ -49,10 +48,10 @@ public override async ValueTask<string> GetUserAuthorizationTokenAsync(
string requestVerb,
INameValueCollection headers,
AuthorizationTokenType tokenType,
ITrace trace)
CosmosDiagnosticsContext diagnosticsContext)
{
return AuthorizationTokenProviderTokenCredential.GenerateAadAuthorizationSignature(
await this.tokenCredentialCache.GetTokenAsync(trace));
await this.tokenCredentialCache.GetTokenAsync(diagnosticsContext));
}

public override async ValueTask AddAuthorizationHeaderAsync(
Expand All @@ -62,7 +61,7 @@ public override async ValueTask AddAuthorizationHeaderAsync(
AuthorizationTokenType tokenType)
{
string token = AuthorizationTokenProviderTokenCredential.GenerateAadAuthorizationSignature(
await this.tokenCredentialCache.GetTokenAsync(NoOpTrace.Singleton));
await this.tokenCredentialCache.GetTokenAsync(EmptyCosmosDiagnosticsContext.Singleton));

headersCollection.Add(HttpConstants.HttpHeaders.Authorization, token);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Microsoft.Azure.Cosmos
{
using System.Threading.Tasks;
using Microsoft.Azure.Cosmos.Tracing;
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Collections;

Expand All @@ -24,6 +23,6 @@ ValueTask<string> GetUserAuthorizationTokenAsync(
string requestVerb,
INameValueCollection headers,
AuthorizationTokenType tokenType,
ITrace trace);
CosmosDiagnosticsContext diagnosticsContext);
}
}
Loading