Skip to content

Commit 3452251

Browse files
authored
Add FUNCTIONS_WORKER_RUNTIME (#233)
1 parent 45ea794 commit 3452251

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Telemetry/TelemetryCommonProperties.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ public class TelemetryCommonProperties
1414
private readonly string _productVersion;
1515
private readonly string _azureFunctionsEnvironment;
1616
private readonly bool _hasWebsiteInstanceId;
17+
private readonly string _functionsWorkerRuntime;
1718

1819
public TelemetryCommonProperties(string productVersion, TelemetryClient telemetryClient, IConfiguration config)
1920
{
2021
this._productVersion = productVersion;
2122
this._userLevelCacheWriter = new UserLevelCacheWriter(telemetryClient);
2223
this._azureFunctionsEnvironment = config.GetValue(AZURE_FUNCTIONS_ENVIRONMENT_KEY, "");
2324
this._hasWebsiteInstanceId = config.GetValue(WEBSITE_INSTANCE_ID_KEY, "") != "";
25+
this._functionsWorkerRuntime = config.GetValue(FUNCTIONS_WORKER_RUNTIME_KEY, "");
2426
}
2527

2628
private readonly UserLevelCacheWriter _userLevelCacheWriter;
@@ -30,9 +32,11 @@ public TelemetryCommonProperties(string productVersion, TelemetryClient telemetr
3032
private const string MachineId = "MachineId";
3133
private const string AzureFunctionsEnvironment = "AzureFunctionsEnvironment";
3234
private const string HasWebsiteInstanceId = "HasWebsiteInstanceId";
35+
private const string FunctionsWorkerRuntime = "FunctionsWorkerRuntime";
3336

3437
private const string AZURE_FUNCTIONS_ENVIRONMENT_KEY = "AZURE_FUNCTIONS_ENVIRONMENT";
3538
private const string WEBSITE_INSTANCE_ID_KEY = "WEBSITE_INSTANCE_ID";
39+
private const string FUNCTIONS_WORKER_RUNTIME_KEY = "FUNCTIONS_WORKER_RUNTIME";
3640

3741
public Dictionary<string, string> GetTelemetryCommonProperties()
3842
{
@@ -42,7 +46,8 @@ public Dictionary<string, string> GetTelemetryCommonProperties()
4246
{ProductVersion, this._productVersion},
4347
{MachineId, this.GetMachineId()},
4448
{AzureFunctionsEnvironment, this._azureFunctionsEnvironment},
45-
{HasWebsiteInstanceId, this._hasWebsiteInstanceId.ToString()}
49+
{HasWebsiteInstanceId, this._hasWebsiteInstanceId.ToString()},
50+
{FunctionsWorkerRuntime, this._functionsWorkerRuntime}
4651
};
4752
}
4853

0 commit comments

Comments
 (0)