Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit cdf0c11

Browse files
Copilothallipr
andcommitted
Address PR feedback: fix JsonSourceGenerationContext duplicate, remove default server name, remove launchSettings, update telemetry constants and property names, clean up InternalsVisibleTo, remove dotnet-install.sh
Co-authored-by: hallipr <[email protected]>
1 parent 2f04604 commit cdf0c11

File tree

8 files changed

+21
-1910
lines changed

8 files changed

+21
-1910
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
namespace AzureMcp.Core.Services.Telemetry;
5+
6+
internal static class AzureTelemetryConstants
7+
{
8+
/// <summary>
9+
/// Azure-specific telemetry tag names.
10+
/// </summary>
11+
internal class TagName
12+
{
13+
public const string ResourceHash = "AzResourceHash";
14+
public const string SubscriptionGuid = "AzSubscriptionGuid";
15+
}
16+
}

core/src/Microsoft.Mcp.Core/AssemblyInfo.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,4 @@
55

66
[assembly: InternalsVisibleTo("Microsoft.Mcp.Core.UnitTests")]
77
[assembly: InternalsVisibleTo("Microsoft.Mcp.Core.LiveTests")]
8-
[assembly: InternalsVisibleTo("Microsoft.Mcp.Tests")]
9-
[assembly: InternalsVisibleTo("AzureMcp.Core.UnitTests")]
10-
[assembly: InternalsVisibleTo("AzureMcp.Core.LiveTests")]
11-
[assembly: InternalsVisibleTo("AzureMcp.Tests")]
128
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]

core/src/Microsoft.Mcp.Core/Commands/JsonSourceGenerationContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ namespace Microsoft.Mcp.Core;
1111
[JsonSerializable(typeof(JsonElement))]
1212
[JsonSerializable(typeof(List<string>))]
1313
[JsonSerializable(typeof(List<JsonNode>))]
14-
[JsonSerializable(typeof(List<JsonNode>))]
1514
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
1615
internal partial class JsonSourceGenerationContext : JsonSerializerContext
1716
{

core/src/Microsoft.Mcp.Core/Configuration/McpServerConfiguration.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ namespace Microsoft.Mcp.Core.Configuration;
55

66
public sealed class McpServerConfiguration
77
{
8-
public const string DefaultName = "Microsoft.Mcp.Server";
9-
10-
public string Name { get; set; } = DefaultName;
8+
public string Name { get; set; } = string.Empty;
119
public string? Version { get; set; }
1210
public string? UserAgent { get; set; }
13-
public bool EnableTelemetry { get; set; } = true;
11+
public bool IsTelemetryEnabled { get; set; } = true;
1412
}

core/src/Microsoft.Mcp.Core/Properties/launchSettings.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

core/src/Microsoft.Mcp.Core/Services/Telemetry/TelemetryConstants.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ internal static class TelemetryConstants
1010
/// </summary>
1111
internal class TagName
1212
{
13-
public const string McpVersion = "Version";
13+
public const string ProductVersion = "ProductVersion";
1414
public const string ClientName = "ClientName";
1515
public const string ClientVersion = "ClientVersion";
1616
public const string DevDeviceId = "DevDeviceId";
1717
public const string ErrorDetails = "ErrorDetails";
1818
public const string EventId = "EventId";
1919
public const string MacAddressHash = "MacAddressHash";
20-
public const string ResourceHash = "ResourceHash";
21-
public const string SubscriptionGuid = "SubscriptionGuid";
2220
public const string ToolName = "ToolName";
2321
}
2422

core/src/Microsoft.Mcp.Core/Services/Telemetry/TelemetryService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ internal class TelemetryService : ITelemetryService
2323

2424
public TelemetryService(IMachineInformationProvider informationProvider, IOptions<McpServerConfiguration> options)
2525
{
26-
_isEnabled = options.Value.EnableTelemetry;
26+
_isEnabled = options.Value.IsTelemetryEnabled;
2727
_tagsList = new List<KeyValuePair<string, object?>>()
2828
{
29-
new(TagName.McpVersion, options.Value.Version),
29+
new(TagName.ProductVersion, options.Value.Version),
3030
};
3131

3232
Parent = new ActivitySource(options.Value.Name, options.Value.Version, _tagsList);

0 commit comments

Comments
 (0)