Skip to content

Adls data plane task add debug functionality #5573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rahuldutta90
Copy link
Contributor

@rahuldutta90 rahuldutta90 commented Feb 17, 2018

Description

Add debug functionality to ADLS dataplane cmdlets

Checklist

Copy link
Member

@cormacpayne cormacpayne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rahuldutta90 a few comments to take a look at

* Get-AzureRMDataLakeStoreItemContent - Fixed the tail behavior for contents greater than 4MB
* Set-AzureRMDataLakeStoreItemExpiry - Introduced new parameter set SetRelativeExpiry for setting relative expiration time
* Remove-AzureRmDataLakeStoreItem (https://github.com/Azure/azure-powershell/blob/adls-data-plane/src/ResourceManager/DataLakeStore/documentation/upcoming-breaking-changes.md) - Deprecated parameter Clean.
* Add Debug functionality to Datalake store dataplane cmdlets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rahuldutta90 you can revert the changes made to the ReleaseNotes -- we will update this metadata when we release this module again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cormacpayne Reverted it.

static DataLakeStoreFileSystemClient()
{
// ConfigurationItemFactory.Default.Targets.RegisterDefinition("AdlsLogger", typeof(AdlsLoggerTarget));
Target.Register<Microsoft.Azure.Commands.DataLakeStore.Models.AdlsLoggerTarget>("AdlsLogger"); //generic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rahuldutta90 what is the purpose of this target in NLog?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cormacpayne NLog is used by the ADLS dataplane sdk to log debug messages. We can create a custom target which basically queues the debug data to the ConcurrentQueue (the one available to this powershell framework) for debug messages. So whenever we use our nlog framework to write debug message all of them will get queued in the concurrent queue. I have put some more comments in the target class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#region Constructors

static DataLakeStoreFileSystemClient()
{
// ConfigurationItemFactory.Default.Targets.RegisterDefinition("AdlsLogger", typeof(AdlsLoggerTarget));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rahuldutta90 nit: would you mind removing this line if it's going to be commented-out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cormacpayne Removed. Thanks for catching it.

@@ -68,6 +77,22 @@ public DataLakeStoreFileSystemClient(IAzureContext context)
ServicePointManager.UseNagleAlgorithm = false;
}

public DataLakeStoreFileSystemClient(IAzureContext context, DataLakeStoreFileSystemCmdletBase cmdlet) : this(context)
{

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rahuldutta90 nit: please remove this blank line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cormacpayne Removed it.


* Add debug functionality

## Version 5.1.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you want to change the order of this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markcowl Addressed it.

fileTarget.Layout = "${message}";

var rule = new LoggingRule("adls.dotnet.*", NLog.LogLevel.Debug, fileTarget);
_adlsLoggerConfig.LoggingRules.Add(rule);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you describe what this actually logs? We want to make sure that request method and headers and response status and headers are included

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markcowl This is the debug line NLog posts:

2018-02-16 09:23:59.1720|DEBUG|adls.dotnet.WebTransport|HTTPRequest,Succeeded,cReqId:cc6758eb-656f-4bd7-b589-67165664e899.0,lat:6496,err,Reqlen:0,Resplen:0,token_ns:2,sReqId:2551abc6-ed04-4a99-b71f-264da768cf7d,path:/NewFile,qp:op=CREATE&overwrite=True&leaseid=30038d32-172f-4054-ac08-359421c24282&filesessionid=30038d32-172f-4054-ac08-359421c24282&CreateParent=True&write=true&syncFlag=DATA&api-version=2017-08-01

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markcowl For failure case only we have the httpstatus in response like here we have InternalServorError:
2018-02-14 20:02:48.5660|DEBUG|adls.dotnet.WebTransport|HTTPRequest,failed,cReqId:e1dc5c6d-a9c1-4202-8d99-7e6c00d19f8d.0,lat:723,errInternalServerError: RuntimeException,Reqlen:15,Resplen:0,token_ns:0,sReqId:a2ed5f89-f8a7-42e6-af1c-187806135668,path:/Test/dir1/testConcurrentAppendParallel_15,qp:op=CONCURRENTAPPEND&appendMode=autocreate&api-version=2017-08-01

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have been using the SDK for a while in both Java and .Net. For both of these, we have looked at what customers typically need in order to troubleshoot errors, and that is what we log in our logs. This is what customers have been using to troubleshoot large systems, like Hadoop - provides a good balance between readable and analyzable data, and the huge volume of logs that some of our runs can generate (e.g., recursive ACL setting or large data upload). i.e., this is the best balance (so far) we have found between volume of data and usefulness of data to be able to troubleshoot.

@maddieclayton
Copy link
Contributor

@rahuldutta90 Please fix the merge conflicts that have arisen.

@cormacpayne
Copy link
Member

@rahuldutta90 Hey Rahul, what's the status of this PR? I know that we were looking to re-format the debug log, as well as pull in the latest changes from the preview branch.

@rahuldutta90
Copy link
Contributor Author

@cormacpayne I am in process of making the changes in SDK. Once it is released, I will integrate that version with this PR.

@markcowl
Copy link
Member

@cormacpayne cormacpayne dismissed markcowl’s stale review March 20, 2018 15:41

Approved offline

@cormacpayne cormacpayne merged commit 26239e0 into adls-data-plane Mar 20, 2018
@markcowl markcowl deleted the adls-data-plane-task-addDebugFunctionality branch May 1, 2018 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants