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

Tracing: Adds ITrace as the default tracing implementation for CosmosDiagnostics #2097

Merged
merged 58 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
12e90f1
wip
bchong95 Dec 19, 2020
cecd929
fixed source build breaks
bchong95 Dec 21, 2020
51bb7f4
lot of tests to work through
bchong95 Dec 21, 2020
d0931bc
fixed non diagnostic tests
bchong95 Dec 22, 2020
874ea72
started a baseline test for tracing
bchong95 Dec 22, 2020
d5f8785
got tests to build
bchong95 Dec 28, 2020
be16492
added baselines for tracing
bchong95 Dec 28, 2020
34a1741
merged
bchong95 Dec 28, 2020
ffe81f2
merged
bchong95 Jan 16, 2021
393e47f
fixed NRE
bchong95 Jan 16, 2021
6911bcd
need to investigate traces in master
bchong95 Jan 16, 2021
02d1ddc
fixed unit tests
bchong95 Jan 17, 2021
e93aabe
updated baselines
bchong95 Jan 17, 2021
25fe8cf
fixed more tests
bchong95 Jan 17, 2021
9060d95
updated benchmark
bchong95 Jan 17, 2021
beaf2bb
added production baselines
bchong95 Jan 17, 2021
6fdb1a8
merged with master
bchong95 Jan 22, 2021
abb7966
resolved iteration comments
bchong95 Jan 22, 2021
94b7979
returing root trace instead of leaf
bchong95 Jan 22, 2021
5528200
got the baselines to stablilize
bchong95 Jan 22, 2021
35751b0
added scenarios for public feed iterators
bchong95 Jan 23, 2021
57742f0
updated query metrics
bchong95 Jan 23, 2021
f3e72ab
fixed build errors
bchong95 Jan 23, 2021
381467b
converted diagnostics tests to baseline tests
bchong95 Jan 23, 2021
b5c9791
fixed some tests
bchong95 Jan 23, 2021
0a76ce6
fixed the tracing on retry paths
bchong95 Jan 23, 2021
e53eaca
fixed deadlock in synchronization context
bchong95 Jan 23, 2021
843bf49
updated baselines due to synchronization context
bchong95 Jan 24, 2021
9e4cf3d
resolved some iteration comments
bchong95 Jan 29, 2021
6945fed
merged
bchong95 Jan 29, 2021
d80d7c7
fixed traces for bulk
bchong95 Jan 29, 2021
8fd8be0
updated baselines
bchong95 Jan 29, 2021
d9e0c94
Merge branch 'master' into users/brchon/TracingRemoveCosmosDiagnostics
bchong95 Jan 29, 2021
f7925d8
fixed baselines (ITrace vs Diagnostics String)
bchong95 Jan 29, 2021
8a6457d
Merge branch 'users/brchon/TracingRemoveCosmosDiagnostics' of https:/…
bchong95 Jan 29, 2021
1d45748
updated benchmarks
bchong95 Jan 29, 2021
7c69223
added tracing for retry in batch
bchong95 Jan 29, 2021
7729b68
merged
bchong95 Feb 4, 2021
373b631
removed duplicate response stats
bchong95 Feb 4, 2021
5f5cb46
made user agent overrideable
bchong95 Feb 4, 2021
7a3ca15
added awaits to make sure the stopwatch times are inclusive of children
bchong95 Feb 4, 2021
c0c4e83
Merge branch 'master' into users/brchon/TracingRemoveCosmosDiagnostics
bchong95 Feb 4, 2021
cefbaf5
fixed build
bchong95 Feb 5, 2021
c8ae319
Merge branch 'users/brchon/TracingRemoveCosmosDiagnostics' of https:/…
bchong95 Feb 5, 2021
c873153
unknown first
bchong95 Feb 5, 2021
0dae774
merged
bchong95 Feb 5, 2021
06b2c46
fixed some tests
bchong95 Feb 5, 2021
1b89ccb
updated baselines
bchong95 Feb 5, 2021
9cb5b28
Merge branch 'master' into users/brchon/TracingRemoveCosmosDiagnostics
bchong95 Feb 5, 2021
a829b7c
updated benchmark
bchong95 Feb 5, 2021
8ce7720
Merge branch 'users/brchon/TracingRemoveCosmosDiagnostics' of https:/…
bchong95 Feb 5, 2021
bd8d89a
formattting
bchong95 Feb 5, 2021
eb1883d
relaxed tests
bchong95 Feb 6, 2021
e7ce575
Merge branch 'master' into users/brchon/TracingRemoveCosmosDiagnostics
sboshra Feb 6, 2021
ee71453
reverted contract file
bchong95 Feb 7, 2021
abf087a
Merge branch 'users/brchon/TracingRemoveCosmosDiagnostics' of https:/…
bchong95 Feb 7, 2021
f432883
actual rever
bchong95 Feb 7, 2021
18c6477
Merge branch 'master' into users/brchon/TracingRemoveCosmosDiagnostics
bchong95 Feb 8, 2021
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,9 +6,8 @@ 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;
bchong95 marked this conversation as resolved.
Show resolved Hide resolved
using Microsoft.Azure.Documents;
using Microsoft.Azure.Documents.Collections;

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

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,
CosmosDiagnosticsContext diagnosticsContext)
ITrace trace)
{
// 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,
CosmosDiagnosticsContext diagnosticsContext)
ITrace trace)
{
// 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,6 +9,7 @@ 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 @@ -38,7 +39,7 @@ public AuthorizationTokenProviderTokenCredential(
AuthorizationTokenType tokenType)
{
string token = AuthorizationTokenProviderTokenCredential.GenerateAadAuthorizationSignature(
await this.tokenCredentialCache.GetTokenAsync(EmptyCosmosDiagnosticsContext.Singleton));
await this.tokenCredentialCache.GetTokenAsync(NoOpTrace.Singleton));
return (token, default);
}

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

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

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

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