Skip to content
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

Azure Debug logging does not contain timestamps #177

Closed
blomquisg opened this issue Nov 29, 2017 · 4 comments
Closed

Azure Debug logging does not contain timestamps #177

blomquisg opened this issue Nov 29, 2017 · 4 comments
Assignees

Comments

@blomquisg
Copy link
Member

Looking at the azure.log with Debug logging on, I see:

RestClient.get "https://nzaccazupdstasdiagdrh1.table.core.windows.net/WADMetricsPT1MP10DV2S20171116?$filter=PartitionKey%20eq%20%27:002Fsubscriptions:<redacted>resourceGroups:<redacted>providers:002FMicrosoft:002ECompute:002FvirtualMachines:002FAZUWDRH1CM4001%27%20and%20CounterName%20eq%20%27%5CPhysicalDisk(_Total)%5CDisk%20Read%20Bytes/sec%27%20and%20Timestamp%20ge%20datetime%272017-11-21T03:15:00Z%27%20and%20Timestamp%20le%20datetime%272017-11-21T04:12:48Z%27&$select=Timestamp,TIMESTAMP,Average", "Accept"=>"application/json;odata=fullmetadata", "Accept-Encoding"=>"gzip, deflate", "User-Agent"=>"rest-client/2.0.2 (linux-gnu x86_64) ruby/2.3.1p112", "auth-string"=>"true", "auth_string"=>"true", "authorization"=>"SharedKey <redacted>", "content-type"=>"", "x-ms-date"=>"Tue, 21 Nov 2017 04:13:12 GMT", "x-ms-version"=>"2016-05-31"
# => 200 OK | application/json 11558 bytes
RestClient.post "https://management.azure.com/subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.Storage/storageAccounts/<redacted>/listKeys?api-version=2017-10-01", "", "Accept"=>"application/json", "Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Bearer <redacted>", "Content-Length"=>"0", "Content-Type"=>"application/json", "User-Agent"=>"rest-client/2.0.2 (linux-gnu x86_64) ruby/2.3.1p112"
# => 200 OK | application/json 372 bytes

This is useful since it shows the size of the response in bytes. But, it would be even more helpful if it could also show the timing of each request/response. Or timestamps for each request/response.

I'm not sure if the logging configuration for RestClient can get that. But, I assume it can, because I believe it should be in the header info. It's just a matter of determining if RestClient surfaces that in their logging.

@djberg96
Copy link
Collaborator

Hm, I thought our logger did that. I'll look into it.

@djberg96
Copy link
Collaborator

I found this:

rest-client/rest-client#34

So, I think it can be altered with something like this under lib:

$azure_log.define_singleton_method(:<<, lambda{ |msg| log(level, msg.strip) })

Feels pretty hacky, but I don't see another way.

@djberg96
Copy link
Collaborator

Also see: ManageIQ/manageiq#16904

@djberg96
Copy link
Collaborator

@djberg96 djberg96 closed this as completed Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants