-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Adls data plane task add debug functionality #5573
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) | |||
{ | |||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
@rahuldutta90 Please fix the merge conflicts that have arisen. |
@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 |
@cormacpayne I am in process of making the changes in SDK. Once it is released, I will integrate that version with this PR. |
Description
Add debug functionality to ADLS dataplane cmdlets
Checklist
CONTRIBUTING.md
platyPS
module