Skip to content

Commit

Permalink
AWS Lambda Tracer: Allow span creation logic to fall back to "UNKNOWN…
Browse files Browse the repository at this point in the history
…" for missing span name components (#1221)

* Test fix for lambda

* Changelog

* Fix link
  • Loading branch information
JcolemanNR authored Oct 3, 2022
1 parent 7563369 commit 4407b41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/AwsLambda/AwsLambdaWrapper/Helpers/ServiceHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ internal static ISpan CreateSpan(KeyValuePair<string, string> operationPair, str
/// <returns></returns>
internal static ISpan CreateSpan(string operationName, string component, string operation)
{
if (string.IsNullOrEmpty(operationName) || string.IsNullOrEmpty(component) || string.IsNullOrEmpty(operation))
{
Logger.Log("Could not create a span. Creating a span requires an operation name, component, and operation.", true, "ERROR");
return null;
}

operationName = string.IsNullOrEmpty(operationName) ? "UNKNOWN" : operationName;
component = string.IsNullOrEmpty(component) ? "UNKNOWN" : component;
operation = string.IsNullOrEmpty(operation) ? "UNKNOWN" : operation;

var span = GlobalTracer.Instance.BuildSpan(operationName).Start();
span.SetTag(Tags.SpanKind, Tags.SpanKindClient);
Expand Down
3 changes: 2 additions & 1 deletion src/AwsLambda/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### New Features
### Fixes
* Span creation logic has been updated to fall back to using `UNKNOWN` for any missing span name components. The previous behavior was to fail span creation. [#1211](https://github.com/newrelic/newrelic-dotnet-agent/pull/1221)

## [1.3.0] - 2021-07-21

Expand All @@ -27,7 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.0.0] - 2019-12-10

### New Features
* New SDK providing Open Tracing instrumentation for AWS Lambda. Refer to New Relic's AWS Lambda monitoring documentation to get started https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring.
* New SDK providing Open Tracing instrumentation for AWS Lambda. Refer to New Relic's AWS Lambda monitoring documentation to get started https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring/.

* **The New Relic AWS Lambda Agent for .NET is now Open Source** <br/>
* The New Relic AWS Lambda Agent for .NET is now open source! Now you can view the source code to help with troubleshooting, observe the project roadmap, and file issues directly in the repository. We are now using the [Apache 2 license](/LICENSE). See our [Contributing guide](/CONTRIBUTING.md) and [Code of Conduct](https://opensource.newrelic.com/code-of-conduct/) for details on contributing!
Expand Down

0 comments on commit 4407b41

Please sign in to comment.