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

[Instrumentation.AWS] Update aws activitysourcename #535

Closed
Show file tree
Hide file tree
Changes from 3 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
6 changes: 6 additions & 0 deletions src/OpenTelemetry.Contrib.Instrumentation.AWS/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog - OpenTelemetry.Contrib.Instrumentation.AWS

## Unreleased

* Update the `ActivitySource` name to the assembly name:
Copy link
Member

Choose a reason for hiding this comment

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

might be a breaking change, since this package is already stable.

Copy link
Member Author

Choose a reason for hiding this comment

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

might be a breaking change, since this package is already stable.

Does it make sense to remove the unreleased section?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can I get an update on this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is a breaking change, you should wait for the 2.0.x release to make this change. This change shouldn't go into 1.x.x versions.

Copy link
Member Author

Choose a reason for hiding this comment

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

There was a decision to remove ".Contrib" from all packages. Only AWS packages do not follow this change as mentioned in this comment

`OpenTelemetry.Instrumentation.AWS`
[#535](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/535)

## 1.0.1

Released 2021-Feb-24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ namespace OpenTelemetry.Contrib.Instrumentation.AWS.Implementation
{
internal class AWSTracingPipelineHandler : PipelineHandler
{
internal const string ActivitySourceName = "Amazon.AWS.AWSClientInstrumentation";

private static readonly AWSXRayPropagator AwsPropagator = new AWSXRayPropagator();
private static readonly Action<IDictionary<string, string>, string, string> Setter = (carrier, name, value) =>
{
carrier[name] = value;
};

private static readonly ActivitySource AWSSDKActivitySource = new ActivitySource(ActivitySourceName);
private static readonly ActivitySource AWSSDKActivitySource = new ActivitySource(Utils.ActivitySourceName);

private readonly AWSClientInstrumentationOptions options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ namespace OpenTelemetry.Contrib.Instrumentation.AWS.Implementation
{
internal class Utils
{
internal static string ActivitySourceName =
Copy link
Member

@Oberon00 Oberon00 Aug 29, 2022

Choose a reason for hiding this comment

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

Looking at how this played out with Instrumentation.AwsLambda so far (#534, #590 (comment), #593) I think we should either:

  • Rename the whole package instead of patching the activity source name (disruptive but consistent); or
  • Leave everything as-is

typeof(AWSTracingPipelineHandler).Assembly.GetName().Name.Replace(".Contrib", string.Empty);

internal static object GetTagValue(Activity activity, string tagName)
{
foreach (KeyValuePair<string, object> tag in activity.TagObjects)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static TracerProviderBuilder AddAWSInstrumentation(
configure?.Invoke(awsClientOptions);

new AWSClientsInstrumentation(awsClientOptions);
builder.AddSource("Amazon.AWS.AWSClientInstrumentation");
builder.AddSource(Utils.ActivitySourceName);
return builder;
}
}
Expand Down