diff --git a/src/Momento.Sdk/Internal/ControlGrpcManager.cs b/src/Momento.Sdk/Internal/ControlGrpcManager.cs index 77e4016c..c8e3134b 100644 --- a/src/Momento.Sdk/Internal/ControlGrpcManager.cs +++ b/src/Momento.Sdk/Internal/ControlGrpcManager.cs @@ -12,13 +12,14 @@ internal sealed class ControlGrpcManager : IDisposable { private readonly GrpcChannel channel; public ScsControl.ScsControlClient Client { get; } - private readonly string version = "csharp:" + GetAssembly(typeof(Momento.Sdk.Responses.CacheGetResponse)).GetName().Version.ToString(); + private readonly string version = "dotnet:" + GetAssembly(typeof(Momento.Sdk.Responses.CacheGetResponse)).GetName().Version.ToString(); + private readonly string runtimeVersion = "dotnet:" + System.Environment.Version; public ControlGrpcManager(string authToken, string endpoint) { var uri = $"https://{endpoint}"; this.channel = GrpcChannel.ForAddress(uri, new GrpcChannelOptions() { Credentials = ChannelCredentials.SecureSsl }); - List
headers = new List
{ new Header(name: Header.AuthorizationKey, value: authToken), new Header(name: Header.AgentKey, value: version) }; + List
headers = new List
{ new Header(name: Header.AuthorizationKey, value: authToken), new Header(name: Header.AgentKey, value: version), new Header(name: Header.RuntimeVersionKey, value: runtimeVersion) }; CallInvoker invoker = channel.Intercept(new HeaderInterceptor(headers)); Client = new ScsControl.ScsControlClient(invoker); } diff --git a/src/Momento.Sdk/Internal/DataGrpcManager.cs b/src/Momento.Sdk/Internal/DataGrpcManager.cs index f2d13a19..244d8fb2 100644 --- a/src/Momento.Sdk/Internal/DataGrpcManager.cs +++ b/src/Momento.Sdk/Internal/DataGrpcManager.cs @@ -13,13 +13,14 @@ public class DataGrpcManager : IDisposable private readonly GrpcChannel channel; public Scs.ScsClient Client { get; } - private readonly string version = "csharp:" + GetAssembly(typeof(Momento.Sdk.Responses.CacheGetResponse)).GetName().Version.ToString(); + private readonly string version = "dotnet:" + GetAssembly(typeof(Momento.Sdk.Responses.CacheGetResponse)).GetName().Version.ToString(); + private readonly string runtimeVersion = "dotnet:" + System.Environment.Version; internal DataGrpcManager(string authToken, string host) { var url = $"https://{host}"; this.channel = GrpcChannel.ForAddress(url, new GrpcChannelOptions() { Credentials = ChannelCredentials.SecureSsl }); - List
headers = new List
{ new Header(name: Header.AuthorizationKey, value: authToken), new Header(name: Header.AgentKey, value: version) }; + List
headers = new List
{ new Header(name: Header.AuthorizationKey, value: authToken), new Header(name: Header.AgentKey, value: version), new Header(name: Header.RuntimeVersionKey, value: runtimeVersion) }; CallInvoker invoker = this.channel.Intercept(new HeaderInterceptor(headers)); Client = new Scs.ScsClient(invoker); } diff --git a/src/Momento.Sdk/Internal/HeaderInterceptor.cs b/src/Momento.Sdk/Internal/HeaderInterceptor.cs index 2e5ed606..2ea09050 100644 --- a/src/Momento.Sdk/Internal/HeaderInterceptor.cs +++ b/src/Momento.Sdk/Internal/HeaderInterceptor.cs @@ -10,7 +10,8 @@ class Header { public const string AuthorizationKey = "Authorization"; public const string AgentKey = "Agent"; - public readonly List onceOnlyHeaders = new List { Header.AgentKey }; + public const string RuntimeVersionKey = "Runtime_Version"; + public readonly List onceOnlyHeaders = new List { Header.AgentKey, Header.RuntimeVersionKey }; public string Name; public string Value; public Header(String name, String value)