Annotate New Relic transactions with request User Agent

RESOLVED FIXED

Status

Tree Management
Treeherder: Infrastructure
P3
normal
RESOLVED FIXED
8 months ago
8 months ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

(Blocks: 1 bug)

Details

Attachments

(1 attachment)

(Assignee)

Description

8 months ago
Earlier I was trying to track down which tool is making requests to the deprecated ArtifactViewSet.list() endpoint (which has only returned HTTP 405s for some time), however was unable to do so, since the User Agent isn't visible in Insights (even though it appears in the errors panel and slow transactions view).

I previously reported this to New Relic (https://support.newrelic.com/tickets/172627/edit), who said they've entered a feature request, but for now if we want the user agent there, we'll have to add it as a custom attribute, to make it report for all requests and not just slow/failing ones.

Comment 1

8 months ago
Created attachment 8855752 [details] [review]
[treeherder] mozilla:newrelic-user-agent > mozilla:master

Comment 2

8 months ago
Commits pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/80492905ba46f5815572f862f8d83e6f82508936
Bug 1354484 - Rename whitenoise_custom.py to middleware.py

Since we're about to add more Treeherder-specific middleware. Also moves
it outside of `config/` to a more usual location for Django projects.

https://github.com/mozilla/treeherder/commit/a88108fa195addc33871a983223ff50873ffc16e
Bug 1354484 - Report request User Agent to New Relic

This is required since the New Relic Python agent only submits the User
Agent to APM (which only handles certain transactions) and not also to
Insights:
https://support.newrelic.com/tickets/172627

The attributes of requests are documented here:
https://docs.djangoproject.com/en/1.10/ref/request-response/#django.http.HttpRequest.META
(Assignee)

Comment 3

8 months ago
Confirmed working:
https://insights.newrelic.com/accounts/677903/explorer/events?eventType=Transaction&duration=604800000&facet=user_agent
Status: NEW → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.