Skip to content

Commit

Permalink
Update context.destination.address (#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
russcam authored Jun 4, 2021
1 parent 4dac7ac commit 0d1ba83
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Elastic.Apm.Azure.Storage/BlobUrl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal abstract class StorageUrl
protected StorageUrl(Uri url)
{
StorageAccountName = url.Host.Split(SplitDomain, 2)[0];
FullyQualifiedNamespace = url.GetLeftPart(UriPartial.Authority) + "/";
FullyQualifiedNamespace = url.Host;
}

public string StorageAccountName { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private void AssertSpan(string action, string resource)
span.Context.Destination.Should().NotBeNull();
var destination = span.Context.Destination;

destination.Address.Should().Be(_environment.StorageAccountConnectionStringProperties.FileUrl);
destination.Address.Should().Be(_environment.StorageAccountConnectionStringProperties.FileFullyQualifiedNamespace);
destination.Service.Name.Should().Be(AzureFileStorage.SubType);
destination.Service.Resource.Should().Be($"{AzureFileStorage.SubType}/{_environment.StorageAccountConnectionStringProperties.AccountName}");
destination.Service.Type.Should().Be(ApiConstants.TypeStorage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private void AssertSpan(string action, string queueName)
span.Context.Destination.Should().NotBeNull();
var destination = span.Context.Destination;

destination.Address.Should().Be(_environment.StorageAccountConnectionStringProperties.QueueUrl);
destination.Address.Should().Be(_environment.StorageAccountConnectionStringProperties.QueueFullyQualifiedNamespace);
destination.Service.Name.Should().Be(AzureQueueStorage.SubType);
destination.Service.Resource.Should().Be($"{AzureQueueStorage.SubType}/{queueName}");
destination.Service.Type.Should().Be(ApiConstants.TypeMessaging);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ public StorageAccountProperties(string defaultEndpointsProtocol, string accountN

public string DefaultEndpointsProtocol { get; }

public string QueueUrl => $"{DefaultEndpointsProtocol}://{AccountName}.queue.{EndpointSuffix}/";
public string QueueFullyQualifiedNamespace => $"{AccountName}.queue.{EndpointSuffix}";

public string BlobUrl => $"{DefaultEndpointsProtocol}://{AccountName}.blob.{EndpointSuffix}/";
public string BlobFullyQualifiedNamespace => $"{AccountName}.blob.{EndpointSuffix}";

public string FileUrl => $"{DefaultEndpointsProtocol}://{AccountName}.file.{EndpointSuffix}/";
public string FileFullyQualifiedNamespace => $"{AccountName}.file.{EndpointSuffix}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected void AssertSpan(string action, string resource, int count = 1)
span.Context.Destination.Should().NotBeNull();
var destination = span.Context.Destination;

destination.Address.Should().Be(Environment.StorageAccountConnectionStringProperties.BlobUrl);
destination.Address.Should().Be(Environment.StorageAccountConnectionStringProperties.BlobFullyQualifiedNamespace);
destination.Service.Name.Should().Be(AzureBlobStorage.SubType);
destination.Service.Resource.Should().Be($"{AzureBlobStorage.SubType}/{Environment.StorageAccountConnectionStringProperties.AccountName}");
destination.Service.Type.Should().Be(ApiConstants.TypeStorage);
Expand Down

0 comments on commit 0d1ba83

Please sign in to comment.