Skip to content

Commit

Permalink
cleanup leftover RPC code (#45910)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyMothra committed Sep 11, 2024
1 parent 21ace85 commit 3a8a592
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>An OpenTelemetry .NET distro that exports to Azure Monitor</Description>
<AssemblyTitle>AzureMonitor OpenTelemetry ASP.NET Core Distro</AssemblyTitle>
Expand All @@ -23,10 +23,10 @@
<!-- Depending on monthly deliverables, we may switch between PackageReference or ProjectReference. Keeping both here to make the switch easier. -->

<!-- FOR PUBLIC RELEASES, MUST USE PackageReference. THIS REQUIRES A STAGGERED RELEASE IF SHIPPING A NEW EXPORTER. -->
<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" />
<!--<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" />-->

<!-- FOR LOCAL DEV, ProjectReference IS PREFERRED. -->
<!--<ProjectReference Include="..\..\Azure.Monitor.OpenTelemetry.Exporter\src\Azure.Monitor.OpenTelemetry.Exporter.csproj" />-->
<ProjectReference Include="..\..\Azure.Monitor.OpenTelemetry.Exporter\src\Azure.Monitor.OpenTelemetry.Exporter.csproj" />
</ItemGroup>

<!-- Shared sources from Azure.Core -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ internal static RemoteDependency ConvertToDependencyDocument(Activity activity)
remoteDependencyDocument.CommandName = messagingUrl;

break;
case OperationType.Rpc:
// remoteDependencyDocument.Name = activity.DisplayName;
// remoteDependencyDocument.CommandName = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeRpcService)?.ToString();
// remoteDependencyDocument.ResultCode = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeRpcStatus)?.ToString();
default:
// Unknown or Manual or Unexpected Dependency Type
remoteDependencyDocument.Name = activity.DisplayName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ internal static class SemanticConventions
public const string AttributeDbRedisDatabaseIndex = "db.redis.database_index";
public const string AttributeDbMongoDbCollection = "db.mongodb.collection";

public const string AttributeRpcSystem = "rpc.system";
public const string AttributeRpcService = "rpc.service";
public const string AttributeRpcMethod = "rpc.method";
public const string AttributeRpcGrpcStatusCode = "rpc.grpc.status_code";

public const string AttributeMessageType = "message.type";
public const string AttributeMessageId = "message.id";
public const string AttributeMessageCompressedSize = "message.compressed_size";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public RemoteDependencyData(int version, Activity activity, ref ActivityTagsProc
case OperationType.Db:
SetDbDependencyProperties(ref activityTagsProcessor.MappedTags);
break;
case OperationType.Rpc:
SetRpcDependencyProperties(ref activityTagsProcessor.MappedTags);
break;
case OperationType.Messaging:
SetMessagingDependencyProperties(activity, ref activityTagsProcessor.MappedTags);
break;
Expand Down Expand Up @@ -103,14 +100,6 @@ private void SetDbDependencyProperties(ref AzMonList dbTagObjects)
}
}

private void SetRpcDependencyProperties(ref AzMonList rpcTagObjects)
{
var rpcAttributeTagObjects = AzMonList.GetTagValues(ref rpcTagObjects, SemanticConventions.AttributeRpcService, SemanticConventions.AttributeRpcSystem, SemanticConventions.AttributeRpcStatus);
Data = rpcAttributeTagObjects[0]?.ToString().Truncate(SchemaConstants.RemoteDependencyData_Data_MaxLength);
Type = rpcAttributeTagObjects[1]?.ToString().Truncate(SchemaConstants.RemoteDependencyData_Type_MaxLength);
ResultCode = rpcAttributeTagObjects[2]?.ToString().Truncate(SchemaConstants.RemoteDependencyData_ResultCode_MaxLength);
}

private void SetMessagingDependencyProperties(Activity activity, ref AzMonList messagingTagObjects)
{
var (messagingUrl, target) = messagingTagObjects.GetMessagingUrlAndSourceOrTarget(activity.Kind);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ internal struct ActivityTagsProcessor
SemanticConventions.AttributeComponent,
"otel.status_code",

// required - RPC
// SemanticConventions.AttributeRpcService,
// SemanticConventions.AttributeRpcSystem,
// SemanticConventions.AttributeRpcStatus,
// SemanticConventions.AttributeEndpointAddress,

// required - Messaging
SemanticConventions.AttributeMessagingSystem,
SemanticConventions.AttributeMessagingDestinationName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,6 @@ internal static (string? DbName, string? DbTarget) GetDbDependencyTargetAndName(
var dbSystem = AzMonList.GetTagValue(ref tagObjects, SemanticConventions.AttributeDbSystem)?.ToString();
return AzMonListExtensions.s_dbSystems.Contains(dbSystem) ? "SQL" : dbSystem?.Truncate(SchemaConstants.RemoteDependencyData_Type_MaxLength);
}
case OperationType.Rpc:
{
return AzMonList.GetTagValue(ref tagObjects, SemanticConventions.AttributeRpcSystem)?.ToString();
}
case OperationType.Messaging:
{
return AzMonList.GetTagValue(ref tagObjects, SemanticConventions.AttributeMessagingSystem)?.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ internal static class SemanticConventions
public const string AttributeDbRedisDatabaseIndex = "db.redis.database_index";
public const string AttributeDbMongoDbCollection = "db.mongodb.collection";

public const string AttributeRpcMethod = "rpc.method";
public const string AttributeRpcStatus = "rpc.grpc.status_code";
public const string AttributeRpcService = "rpc.service";
public const string AttributeRpcSystem = "rpc.system";

public const string AttributeMessageType = "message.type";
public const string AttributeMessageId = "message.id";
public const string AttributeMessageCompressedSize = "message.compressed_size";
Expand Down

0 comments on commit 3a8a592

Please sign in to comment.