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

Add GetClientElapsedTime to CosmosDiagnostics #1268

Merged
merged 25 commits into from
Mar 16, 2020

Conversation

j82w
Copy link
Contributor

@j82w j82w commented Mar 10, 2020

Pull Request Template

Description

This is adding GetElapsedClientLatency to CosmosDiagnostics.

  1. The elapsed client latency is useful for users to determine if they need to log the diagnostics.
  2. Fixed bug where request options was not being sent in Database.ReadStreamAsync() and Database.DeleteStreamAsync()

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Closing issues

closes #1218

public abstract class CosmosDiagnostics
{
        public abstract TimeSpan GetClientElapsedTime();

        public abstract override string ToString();
    }	  
}

@j82w j82w added bug Something isn't working feature-request New feature or request Diagnostics Issues around diagnostics and troubleshooting labels Mar 10, 2020
@j82w j82w self-assigned this Mar 10, 2020
@kirankumarkolli
Copy link
Member

#458 update description to the scope of the change.

@kirankumarkolli
Copy link
Member

Batch diagnostics: Diagnostics duplication should solve it no?

@kirankumarkolli
Copy link
Member

Pulling in ClientReqeustId inside might actually confuse CX that its actually sent uses E2E and might be source of future CRI's.

If its for application tracing/correlation, then application can trace it explicitly (yes its more work but straightforward).

@j82w j82w changed the title Add UserClientRequestId and GetElapsedClientLatency to CosmosDiagnostics Add GetElapsedClientLatency to CosmosDiagnostics Mar 11, 2020
/// <summary>
/// Contains the cosmos diagnostic information for the current request to Azure Cosmos DB service.
/// </summary>
public abstract class CosmosDiagnostics
{
/// <summary>
/// This represent the current elapsed latency of the request.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request [](start = 62, length = 7)

request: qualify it very explicitly that its E2E elapsed time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the updated text

public abstract string UserAgent { get; protected set; }

internal abstract CosmosDiagnostics Diagnostics { get; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why internal if the class in internal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes it easier to read. You don't have to scroll to the top to see if the class is internal.

@j82w j82w force-pushed the users/jawilley/diagnostics/properties branch from 39c8c5d to 6c98165 Compare March 13, 2020 14:08
namespace Microsoft.Azure.Cosmos
{
using System;

/// <summary>
/// Contains the cosmos diagnostic information for the current request to Azure Cosmos DB service.
/// </summary>
public abstract class CosmosDiagnostics
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is the envelope meant to expose additional diagnostics information for customers as well that are currently only available in the opaque diagnostics string? Like ActivityIds related to the current request etc.?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the public contract. Then we have a separate implementation class.

…ture it is easier to add GetNetworkElapsedTime or other time factors users may want.
@j82w j82w changed the title Add GetElapsedClientLatency to CosmosDiagnostics Add GetClientElapsedTime to CosmosDiagnostics Mar 16, 2020
@j82w j82w merged commit 4bcc82d into master Mar 16, 2020
@j82w j82w deleted the users/jawilley/diagnostics/properties branch March 16, 2020 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Diagnostics Issues around diagnostics and troubleshooting feature-request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add client request latency to CosmosDiagnostics
4 participants