Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
425 stars 182 forks source link

ReceiverRuntimeMetric no longer available on EventHubTrigger #1135

Open pihai opened 2 years ago

pihai commented 2 years ago

As shown in this post with the previous version it was possible to inject a PartitionContext with runtime metrics populated into an Event Hub triggered function.

The only thing needed was to add a PartitionContext parameter to the function and a little bit of configuration in the hosts.json:

public static async Task Run(
    [EventHubTrigger("HubName", 
    Connection = "EventHubConnectionStringSettingName", 
    ConsumerGroup = "Consumer-Group-If-Applicable")]
    EventData[] messageBatch,
    PartitionContext partitionContext) {}
{
    "version":  "2.0",
    "extensions": {
        "eventHubs": {
            "eventProcessorOptions": {
                "enableReceiverRuntimeMetric": true
            }
        }
    }
}

I struggled to find a replacement for this in the new .NET isolated-process model. The only information I found was the following issue which shows how to add the partition context: https://github.com/Azure/azure-functions-dotnet-worker/issues/544

However, it does not include the runtime information of the partition. Is this somehow possible?

pferrot commented 1 year ago

I am facing the same issue with my Node.js Azure Function. Any way to retrieve the "runtime information" from my javascript code?

pihai commented 4 months ago

Any news on this?