Azure / Azure/azure-functions-dotnet-worker
ReceiverRuntimeMetric no longer available on EventHubTrigger
- Dominant language
- C#
- Stars
- 466
- Forks
- 215
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 7
Description
As shown in [this post](https://dylanm-asos.medium.com/azure-functions-event-hub-processing-8a3f39d2cd0f) 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`:
```csharp
public static async Task Run(
[EventHubTrigger("HubName",
Connection = "EventHubConnectionStringSettingName",
ConsumerGroup = "Consumer-Group-If-Applicable")]
EventData[] messageBatch,
PartitionContext partitionContext) {}
```
```json
{
"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?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.