-/// This sampler will return the sampling result of the provided {@link #rootSampler}, unless the
+/// This sampler will return the sampling result of the provided rootSampler, unless the
/// sampling result contains the sampling decision , in which case, a
/// new sampling result will be returned that is functionally equivalent to the original, except that
/// it contains the sampling decision . This ensures that all
/// spans are recorded, with no change to sampling.
///
-/// The intended use case of this sampler is to provide a means of sending all spans to a
+/// The intended use case of this sampler is to provide a means of sending all spans to a
/// processor without having an impact on the sampling rate. This may be desirable if a user wishes
/// to count or otherwise measure all spans produced in a service, without incurring the cost of 100%
/// sampling.
diff --git a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AttributePropagatingSpanProcessorBuilder.cs b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AttributePropagatingSpanProcessorBuilder.cs
index 66159b6e..f6815970 100644
--- a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AttributePropagatingSpanProcessorBuilder.cs
+++ b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AttributePropagatingSpanProcessorBuilder.cs
@@ -25,11 +25,20 @@ private AttributePropagatingSpanProcessorBuilder()
{
}
+ ///
+ /// Creates a new AttributePropagatingSpanProcessorBuilder instance.
+ ///
+ /// A new builder instance.
public static AttributePropagatingSpanProcessorBuilder Create()
{
return new AttributePropagatingSpanProcessorBuilder();
}
+ ///
+ /// Sets the propagation data extractor function.
+ ///
+ /// Function to extract propagation data from activity.
+ /// This builder instance.
public AttributePropagatingSpanProcessorBuilder SetPropagationDataExtractor(Func propagationDataExtractor)
{
if (propagationDataExtractor == null)
@@ -41,6 +50,11 @@ public AttributePropagatingSpanProcessorBuilder SetPropagationDataExtractor(Func
return this;
}
+ ///
+ /// Sets the propagation data key.
+ ///
+ /// The key for propagation data.
+ /// This builder instance.
public AttributePropagatingSpanProcessorBuilder SetPropagationDataKey(string propagationDataKey)
{
if (propagationDataKey == null)
@@ -52,6 +66,11 @@ public AttributePropagatingSpanProcessorBuilder SetPropagationDataKey(string pro
return this;
}
+ ///
+ /// Sets the attribute keys to propagate.
+ ///
+ /// List of attribute keys to propagate.
+ /// This builder instance.
public AttributePropagatingSpanProcessorBuilder SetAttributesKeysToPropagate(List attributesKeysToPropagate)
{
if (attributesKeysToPropagate == null)
@@ -64,6 +83,10 @@ public AttributePropagatingSpanProcessorBuilder SetAttributesKeysToPropagate(Lis
return this;
}
+ ///
+ /// Builds the AttributePropagatingSpanProcessor.
+ ///
+ /// The configured processor.
public AttributePropagatingSpanProcessor Build()
{
return AttributePropagatingSpanProcessor
diff --git a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsBatchUnsampledSpanExportProcessor.cs b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsBatchUnsampledSpanExportProcessor.cs
index 08bdd192..1b72b5a8 100644
--- a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsBatchUnsampledSpanExportProcessor.cs
+++ b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsBatchUnsampledSpanExportProcessor.cs
@@ -42,4 +42,4 @@ public override void OnEnd(Activity data)
this.OnExport(data);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributeGenerator.cs b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributeGenerator.cs
index 683933dd..31a0dcc6 100644
--- a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributeGenerator.cs
+++ b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributeGenerator.cs
@@ -18,9 +18,9 @@ namespace AWS.Distro.OpenTelemetry.AutoInstrumentation;
///
/// AwsMetricAttributeGenerator generates very specific metric attributes based on low-cardinality
/// span and resource attributes. If such attributes are not present, we fallback to default values.
-/// The goal of these particular metric attributes is to get metrics for incoming and outgoing
+/// The goal of these particular metric attributes is to get metrics for incoming and outgoing
/// traffic for a service. Namely, and spans
-/// represent "incoming" traffic, { and spans
+/// represent "incoming" traffic, and spans
/// represent "outgoing" traffic, and spans are ignored.
///
internal class AwsMetricAttributeGenerator : IMetricAttributeGenerator
@@ -169,28 +169,28 @@ private static void SetEgressOperation(Activity span, ActivityTagsCollection att
/// instrumented span attributes, and are clear indications of customer intent. If AWS Remote
/// attributes are not present, the next highest priority span attribute is Peer Service, which is
/// also a reliable indicator of customer intent. If this is set, it will override
- /// AWS_REMOTE_SERVICE identified from any other span attribute, other than AWS Remote attributes.
+ /// AWS_REMOTE_SERVICE identified from any other span attribute, other than AWS Remote attributes.
///
/// After this, we look for the following low-cardinality span attributes that can be used to
- /// determine the remote metric attributes:
+ /// determine the remote metric attributes:
///
///
- /// - RPC
- ///
- DB
- ///
- FAAS
- ///
- Messaging
+ ///
- RPC
+ /// - DB
+ /// - FAAS
+ /// - Messaging
/// - GraphQL - Special case, if is present,
- /// we use it for RemoteOperation and set RemoteService to .
+ /// we use it for RemoteOperation and set RemoteService to .
///
///
/// In each case, these span attributes were selected from the OpenTelemetry trace semantic
- /// convention specifications as they adhere to the three following criteria:
+ /// convention specifications as they adhere to the three following criteria:
///
///
- /// - Attributes are meaningfully indicative of remote service/operation names.
+ ///
- Attributes are meaningfully indicative of remote service/operation names.
/// - Attributes are defined in the specification to be low cardinality, usually with a low-
- /// cardinality list of values.
- ///
- Attributes are confirmed to have low-cardinality values, based on code analysis.
+ /// cardinality list of values.
+ /// - Attributes are confirmed to have low-cardinality values, based on code analysis.
///
///
/// if the selected attributes are still producing the UnknownRemoteService or
diff --git a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributesSpanProcessor.cs b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributesSpanProcessor.cs
index fff56337..e9cc7817 100644
--- a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributesSpanProcessor.cs
+++ b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsMetricAttributesSpanProcessor.cs
@@ -78,16 +78,18 @@ private static Activity WrapSpanWithAttributes(Activity span, ActivityTagsCollec
return span;
}
+ ///
+ /// If the map has no items, no modifications are required. If there is one item, it means the
+ /// span either produces Service or Dependency metric attributes, and in either case we want to
+ /// modify the span with them. If there are two items, the span produces both Service and
+ /// Dependency metric attributes indicating the span is a local dependency root. The Service
+ /// Attributes must be a subset of the Dependency, with the exception of AttributeAWSSpanKind. The
+ /// knowledge that the span is a local root is more important that knowing that it is a
+ /// Dependency metric, so we take all the Dependency metrics but replace AttributeAWSSpanKind with
+ /// .
+ ///
private Activity AddMetricAttributes(Activity span)
{
- /// If the map has no items, no modifications are required. If there is one item, it means the
- /// span either produces Service or Dependency metric attributes, and in either case we want to
- /// modify the span with them. If there are two items, the span produces both Service and
- /// Dependency metric attributes indicating the span is a local dependency root. The Service
- /// Attributes must be a subset of the Dependency, with the exception of AttributeAWSSpanKind. The
- /// knowledge that the span is a local root is more important that knowing that it is a
- /// Dependency metric, so we take all the Dependency metrics but replace AttributeAWSSpanKind with
- /// .
Dictionary attributeMap =
this.generator.GenerateMetricAttributeMapFromSpan(span, this.resource);
ActivityTagsCollection attributes = new ActivityTagsCollection();
diff --git a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs
index bbe8523e..fc01a9dc 100644
--- a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs
+++ b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/AwsSpanProcessingUtil.cs
@@ -316,7 +316,7 @@ private static bool IsSqsReceiveMessageConsumerSpan(Activity span)
string? serviceName = (string?)span.GetTagItem(AttributeAWSServiceName);
return !string.IsNullOrEmpty(serviceName)
- && serviceName.Equals(SQSService)
+ && SQSService.Equals(serviceName)
&& ActivityKind.Consumer.Equals(spanKind)
&& spanActivitySource != null
&& spanActivitySource.Name.StartsWith(ActivitySourceName)
diff --git a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/MetricAttributeGenerator.cs b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/IMetricAttributeGenerator.cs
similarity index 94%
rename from src/AWS.Distro.OpenTelemetry.AutoInstrumentation/MetricAttributeGenerator.cs
rename to src/AWS.Distro.OpenTelemetry.AutoInstrumentation/IMetricAttributeGenerator.cs
index 9d8c543c..7f00ca2c 100644
--- a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/MetricAttributeGenerator.cs
+++ b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/IMetricAttributeGenerator.cs
@@ -10,7 +10,7 @@ namespace AWS.Distro.OpenTelemetry.AutoInstrumentation;
///
/// Metric attribute generator defines an interface for classes that can generate specific attributes
/// to be used by an to produce metrics and by
-/// to wrap the original span.
+/// AwsMetricAttributesSpanExporter to wrap the original span.
///
public interface IMetricAttributeGenerator
{
diff --git a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/LambdaWrapper.cs b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/LambdaWrapper.cs
index 252d93c0..e639ff20 100644
--- a/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/LambdaWrapper.cs
+++ b/src/AWS.Distro.OpenTelemetry.AutoInstrumentation/LambdaWrapper.cs
@@ -63,11 +63,11 @@ static LambdaWrapper()
/// The following are assumptions made about the lambda handler function parameters.
/// * Maximum Parameters: A .NET Lambda handler function can have up to two parameters.
/// * Parameter Order: If both parameters are used, the event input parameter must come first, followed by the ILambdaContext.
- /// * Return Types: The handler can return void, a specific type, or a Task/Task for asynchronous methods.
+ /// * Return Types: The handler can return void, a specific type, or a Task/Task[T] for asynchronous methods.
///
- ///