Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/DurableTask.Netherite.AzureFunctions/NetheriteProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public override bool TryGetScaleMonitor(
{
if (this.Service.TryGetScalingMonitor(out var monitor))
{
scaleMonitor = new ScaleMonitor(monitor);
scaleMonitor = new ScaleMonitor(monitor, functionId);
monitor.InformationTracer($"ScaleMonitor Constructed, Descriptor.Id={scaleMonitor.Descriptor.Id}");
return true;
}
Expand Down Expand Up @@ -159,10 +159,16 @@ class ScaleMonitor : IScaleMonitor<NetheriteScaleMetrics>
readonly DataContractSerializer serializer = new DataContractSerializer(typeof(ScalingMonitor.Metrics));
static Tuple<DateTime, NetheriteScaleMetrics> cachedMetrics;

public ScaleMonitor(ScalingMonitor scalingMonitor)
public ScaleMonitor(ScalingMonitor scalingMonitor, string functionId)
{
this.scalingMonitor = scalingMonitor;
this.descriptor = new ScaleMonitorDescriptor($"DurableTaskTrigger-Netherite-{this.scalingMonitor.TaskHubName}".ToLower());
var descriptorId = $"DurableTaskTrigger-Netherite-{this.scalingMonitor.TaskHubName}".ToLower();

#if NETCOREAPP3_1_OR_GREATER
this.descriptor = new ScaleMonitorDescriptor(descriptorId, functionId);
#else
this.descriptor = new ScaleMonitorDescriptor(descriptorId);
#endif
}

public ScaleMonitorDescriptor Descriptor => this.descriptor;
Expand Down