question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CallActivityWithRetryAsync ability to impact logging behavior

See original GitHub issue

Let’s suppose that I have an acivity that I expect to fail pretty often because it’s relying on a “not so great” API. Now calling that activity I leverage the CallActivityWithRetryAsync method to make sure my orchestration is more likely to execute properly. However each failed attempt is logging everything as errors which clutters my telemetry with “exceptions”. In that scenario I’d like to be able to provide a callback that handles logging, it’d be up to my code to determine whether or not to log the failed attempts and if yes, at which level. That callback definition could be on the RetryOptions object, a property like public Action<Exception, int, bool, ILogger> HandleLogging {get;set;} (the exception happening, the number of attempts, is it the last attempt or not based on the options, logger to leverage)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:17
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
calloncampbellcommented, Jan 22, 2021

I like this feature request

1reaction
cgillumcommented, Jan 23, 2019

Thanks for the suggestion. The idea seems reasonable to me.

The challenge is that while we can control logging done by the Durable extension, we don’t have control over the logging behavior of the Functions runtime. This means someone would have to change both the extension and the host to make this scenario work the way you want. It’s probably doable, but I think we’d need to get a good number of votes for this capability or rely on an externally contributed PR since I expect it will be difficult to prioritize.

Let me know if you think there is a compromise that could result in a simpler fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Making Sense of Azure Durable Functions
The function body logs the information about the incoming message. ... The stop-replay behavior of durable orchestrators causes the single ...
Read more >
Handling errors in Durable Functions (Azure Functions)
Learn how to handle errors in the Durable Functions extension for Azure Functions.
Read more >
Azure Function App Interviewer Questions : ChatGPT ...
The try-catch block in the orchestrator function catches the exception and allows you to handle it in a centralized way, such as logging...
Read more >
Why does Azure Function retry mechanism making more ...
What I was thinking at the beginning of my answer was because of this: The function app retry policy is independent of any...
Read more >
Azure Durable Functions' CallActivityWithRetryAsync does ...
The activity function adds "Activity function 'SomeActivityFunc' failed: " to the message. So either create a custom exception type to be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found