0
votes

I have a Rails application and I want to start tracking some metrics and events. I must track this information using Microsoft Azure, so I found a the gem AppInsights-Ruby developed by Microsoft itself.

I got my instrumentation_key and did what the README says but I can't see any information on the Azure portal.

I thought it could be a problem with the queues so I filled up the queue with

2000.times {|x| tc.track_metric 'My metric', x }
6000.times {|x| tc.track_event 'My event' }

But again, there is no metrics or events on the Azure portal.

Does anybody used this gem? Am I missing something?

2
while not an exact duplicate, (different language) this is a very similar issue, where to see metrics: stackoverflow.com/questions/28294308/…John Gardner
Actually the issue is not where to see them. It is why they are not accepted. I found that I got a 400 response with Not a valid JSON object body, that is weird because it is generated by the gem and it is a valid JSON.emancu

2 Answers

1
votes

There is potentially a JSON issue in v0.3.0 of this gem. After investigating we saw that the return information from the API said our JSON was invalid (but the JSON was created by the gem.)

v0.5.0 changes how it uses JSON and that seemed to have resolved the issue.

The v0.5.0 changes are here

0
votes

where are you looking for them?

when you use track_metric, the metrics by themselves don't show up as "events", you have to use track_event (or others) to send events.

metrics like this should, though, show up in metrics explorer. (open your overview page, find the "metrics explorer" part, click it, and then in the edit blade scroll to the bottom, there should be a "Custom Metrics" section, and your metrics should show up there.

If you attach the metrics in a track_[event|pageview|request|exception|trace], then you'll see those events in the diagnostic search list and the metrics will appear as event properties, in the properties blade.

If you don't see them at all on the portal, try using something like fiddler to watch the outbound requests, and see if you see data going to dc.services.visualstudio.com, where the data is collected. Those requests/responses should indicate if data is successfully being transmitted.