-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client Telemetry: Adds new public APIs (#4056)
* Revert "[Internal] Client Telemetry: Refactors code for collectors (#4037)" This reverts commit e2311a9. * Revert "Revert "[Internal] Client Telemetry: Refactors code for collectors (#4037)"" This reverts commit f04234b. * firdst draft * initialize object * null handle * update contracts * compilation charges * fix tests * public API changes * add docs * contract updated * fixed tests * by default switch of te;emetry in sdk * fix tests * fix assertion * incorporate review comments * fetaure flag fix in script * switch case * add test * fix tests * fix test * fixed run.sh * minor changes * code refactor * changed default values and fix tests
- Loading branch information
1 parent
b03df6b
commit 72e96fa
Showing
33 changed files
with
501 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
//------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
//------------------------------------------------------------ | ||
|
||
namespace Microsoft.Azure.Cosmos | ||
{ | ||
/// <summary> | ||
/// Telemetry Options for Cosmos Client to enable/disable telemetry and distributed tracing along with corresponding threshold values. | ||
/// </summary> | ||
#if PREVIEW | ||
public | ||
#else | ||
internal | ||
#endif | ||
class CosmosClientTelemetryOptions | ||
{ | ||
/// <summary> | ||
/// Disable sending telemetry to service, <see cref="Microsoft.Azure.Cosmos.CosmosThresholdOptions"/> is not applicable to this as of now. | ||
/// </summary> | ||
/// <remarks>This option will disable sending telemetry to service.even it is opt-in from portal.</remarks> | ||
/// <value>true</value> | ||
#if PREVIEW | ||
public | ||
#else | ||
internal | ||
#endif | ||
bool DisableSendingMetricsToService { get; set; } = true; | ||
|
||
/// <summary> | ||
/// This method enable/disable generation of operation level <see cref="System.Diagnostics.Activity"/> if listener is subscribed to the Source Name "Azure.Cosmos.Operation". | ||
/// </summary> | ||
/// <value>false</value> | ||
/// <remarks> Please Refer https://opentelemetry.io/docs/instrumentation/net/exporters/ to know more about open telemetry exporters</remarks> | ||
#if PREVIEW | ||
public | ||
#else | ||
internal | ||
#endif | ||
bool DisableDistributedTracing { get; set; } = | ||
#if PREVIEW | ||
false; | ||
#else | ||
true; | ||
#endif | ||
|
||
/// <summary> | ||
/// Threshold values for Distributed Tracing. | ||
/// These values decides whether to generate operation level <see cref="System.Diagnostics.Tracing.EventSource"/> with request diagnostics or not. | ||
/// </summary> | ||
#if PREVIEW | ||
public | ||
#else | ||
internal | ||
#endif | ||
CosmosThresholdOptions CosmosThresholdOptions { get; set; } = new CosmosThresholdOptions(); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
//------------------------------------------------------------ | ||
|
||
namespace Microsoft.Azure.Cosmos | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// Threshold values for Distributed Tracing | ||
/// </summary> | ||
#if PREVIEW | ||
public | ||
#else | ||
internal | ||
#endif | ||
class CosmosThresholdOptions | ||
{ | ||
/// <summary> | ||
/// Latency Threshold for non point operations i.e. Query | ||
/// </summary> | ||
/// <value>500 ms</value> | ||
public TimeSpan NonPointOperationLatencyThreshold { get; set; } = TimeSpan.FromSeconds(3); | ||
|
||
/// <summary> | ||
/// Latency Threshold for point operations i.e operation other than Query | ||
/// </summary> | ||
/// <value>100 ms</value> | ||
public TimeSpan PointOperationLatencyThreshold { get; set; } = TimeSpan.FromSeconds(1); | ||
} | ||
} |
Oops, something went wrong.