Weedosaurus
Weedosaurus

Reputation: 164

Logs for Retry of DataLakeClienteOptions

I'm using Data Lake Storage with retry options. My service is connected to appinsights and it uses a Azure Function. Is there a way to query for retries of Data Lake Storage? Does it log automatically? Or do I have to make a custom event?

It doesn't provide much, but here's my example of DataLakeClientOptions:

private static DataLakeClientOptions CreateRetryPoliciesOptions()
    {
        var options = new DataLakeClientOptions
        {
            Retry =
            {
                MaxRetries = 3,
                Delay = TimeSpan.FromSeconds(5),
                Mode = RetryMode.Fixed,
                NetworkTimeout = TimeSpan.FromSeconds(120)
            }
        };

        return options;
    }

Upvotes: 0

Views: 51

Answers (1)

Suresh Chikkam
Suresh Chikkam

Reputation: 3332

Is there a way to query for retries of Data Lake Storage? Does it log automatically? Or do I have to make a custom event?

  • Azure Data Lake Storage (ADLS) does not automatically log retry attempts at a detailed level by default.

You are creating a local variable options and then assigns the configured DataLakeClientOptions to it. Return statement it returns the options variable.

Follow the below code:

private static DataLakeClientOptions CreateRetryPoliciesOptions()
{
    return new DataLakeClientOptions
    {
        Retry =
        {
            MaxRetries = 3,
            Delay = TimeSpan.FromSeconds(5),
            Mode = RetryMode.Fixed,
            NetworkTimeout = TimeSpan.FromSeconds(120)
        }
    };
}
  • Eliminate unnecessary local variable, then it directly returns the DataLakeClientOptions object without creating a local variable and instantiate the object, which reduces the need for a separate variable.

Function working well.

enter image description here

To test the function, I have sent POST request to the function URL.

enter image description here

Custom events traced.

enter image description here

Upvotes: 1

Related Questions