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

Create tracing spans to cover the SDK operations #3352

Conversation

muhammad-othman
Copy link
Member

Description

Created new tracing spans in the following places:

  • Service Operations.
  • Credentials retrieval.
  • Compression.
  • Http Requests.

Motivation and Context

https://sim.amazon.com/issues/DOTNET-7519

Testing

Created a hacked OTel provider, ran same requests and checked the output in the console and visualized these traces in observability tools, here are some examples:

  • Full tracing timeline
    image

  • PutObject attributes:
    image

  • GetObject attributes:
    image

  • DynamoDB.UpdateItem
    image

  • DynamoDB.DescribeTableRequest with exception attributes:
    image
    image

Screenshots (if appropriate)

Types of changes

  • 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 change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

}
finally
{
executionContext.RequestContext.Metrics.StopEvent(Metric.ClientExecuteTime);
this.LogMetrics(executionContext);
span.Dispose();
}
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I intentionally left out adding traces for AWS_APM_API (.NET Framework 3.5) because we plan to remove it in v4 and including it would introduce unnecessary complexity to store the spans and retrieve them in the InvokeCallback, which will not be needed in the newer versions.
Additionally, none of our customers will benefit from it as OTel is not supported for .NET Framework versions older than 4.6.2.

/// <param name="spanKind">Optional type of span to create.</param>
/// <param name="parentContext">Optional parent context for the span.</param>
/// <returns>A <see cref="TraceSpan"/> instance representing the created span.</returns>
public static TraceSpan CreateSpanHelper(
Copy link
Member

Choose a reason for hiding this comment

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

Adding the Helper suffix is redundant because you are in a class of utilities. It also makes me think it returns back an object that has helper methods for creating spans. I would remove the Helper suffix.

@muhammad-othman muhammad-othman force-pushed the muhamoth/DOTNET-7519-Observability-Create-tracing-spans branch from 7701da6 to 8569b06 Compare June 26, 2024 02:48
@muhammad-othman muhammad-othman merged commit c614f0b into DOTNET-7462-Observability-for-the-NET-SDK Jun 27, 2024
1 check passed
@muhammad-othman muhammad-othman deleted the muhamoth/DOTNET-7519-Observability-Create-tracing-spans branch June 27, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants