Do Azure Diagnostics run in Azure staging slot?
Asked Answered
A

2

4

When collecting Azure diagnostic data, does the staging slot also send diagnostic data to the WadPerformanceCounters Table?

If so, how can I turn this off? Or how can I differentiate between staging/production when reading the diagnostics.

I don't want to display data about our website assuming it's all production when in fact part of it is the staging slot.

Ankylosis answered 7/1, 2013 at 19:1 Comment(0)
A
3

Yes - Windows Azure diagnostics runs in the Production and Staging slots. The only real difference between these two slots is the DNS name.

As for enabling diagnostics, there is a good starting point at http://msdn.microsoft.com/en-us/library/gg433048.aspx. This provides links to a lot of info on Windows Azure diagnostics.

I don't believe there is a way in the diagnostics table data (WadPerformanceCountersTable, for example) to distinguish between Production and Staging slots. You might be able to filter based off the RowKey value, which I believe contains the deploymentID and that would be different between Production and Staging.

You could also use a different storage account for Production and Staging slots. It'd be a fairly quick update of the .cscfg that could be done at run time.

Auxiliaries answered 7/1, 2013 at 19:22 Comment(4)
That's what I would have thought as well. Staging == Production, otherwise Staging has little value. Using DeploymentId is the key to this whole thing, although I was under the impression that deployment id changes each time you deploy. However, as you can see in my answer, I was able to query the WadPerformanceCountersTable using my staging slot deployment id. There is absolutely no Staging data stored. As to WHY it isn't, I have no idea.Ankylosis
I am going to make sure my staging and production slots are the same version. My earlier comment may be incorrect due to this oversight. I will get back shortly.Ankylosis
Verified. My staging version was out of date. Also, it looks like deployment id is constant so I can use that. Thank you.Ankylosis
So now both my Staging and Production sites are storing diagnostic information in the same WadPerformanceCountersTable. I am also using the autoscaler. Will the autoscaler be able to tell the difference between different deployments?Ankylosis
D
3

When collecting Azure diagnostic data, does the staging slot also send diagnostic data to the WadPerformanceCounters Table?

Yes, they do end up in the same table.

Each deployment gets its unique deployment identifier which can be found on the dashboard for particular instance (production or staging)

DeploymentId Dashboard

Sample WadPerformanceCountersTable table

DeploymentId Table


In order to find logs related to specific deployment (staging or production) you can filter the table by deployment identifier e.g.

DeploymentId eq '1a2c09bea1234bc1b5e6edb99993ab21' 

If you have too many entries for a single deployment identifier, you reduce number of entries by adding, say, time attribute (all entries with DeploymentId '1a2c09bea1234bc1b5e6edb99993ab21' logged after midnight 5 January 2013) e.g.

DeploymentId eq '1a2c09bea1234bc1b5e6edb99993ab21' and Timestamp gt datetime'2013-01-05T00:00:00Z'

Please note that this is not very optimal way of filtering Azure Table Storage (as pointed out by Kiwi and Gaurav.

Any query which will not include PartitionKey will result in full table scan. Since PartitionKey in WAD tables represent a date/time value, I would recommend using that instead of Timestamp. You may find Effective way of fetching diagnostics data post very useful.

That should help you finding out entries per environment (staging vs. production) and particular deployment.

Dislimn answered 7/1, 2013 at 22:55 Comment(3)
+1 Because this is also a useful answer due the imagery. Quick note though, only PartitionKey and RowKey are indexed so querying without specifying one of them can be very costly. (Particularly with a table which grows as quickly as WadPerformanceCountersTable).Ankylosis
One word of caution on Tom's comment (and adding to Kiwi's comment): Any query which will not include PartitionKey will result in full table scan. Since PartitionKey in WAD tables represent a date/time value, I would recommend using that instead of Timestamp. You may find this post useful: gauravmantri.com/2012/02/17/…Ozieozkum
Very good point guys! I did not want to deviate much from the subject of showing difference between staging and production entries. But definitely will clarify my answer and incorporate your comments.Dislimn

© 2022 - 2024 — McMap. All rights reserved.