Authentication Related Custom Attributes


This page includes notes related to  ARCH-182 - Getting issue details... STATUS .


NewRelic Built-in Attributes

traceId

Use traceId, which is a NewRelic provided field to track transaction calls made through various NewRelic apps.  This can be used further when  OPS-3353 - Getting issue details... STATUS  lands Distributed Tracing

SELECT appName, name, traceId from Transaction WHERE traceId = '7f695092a81bf3ad'

NewRelic Custom Attributes

oauth_*

See documentation for the oauth_* custom attributes documented on the Custom Attributes in New Relic page.

Additionally, you can see some of these attributes in use on the Authentication Dashboard in NewRelic Insights.

You can also find these attributess using the Data Explorer

  • Switch from their default of PageView to Transaction
  • Group By oauth_client_id
  • Filter by oauth_adapter
  • Examine other events captured in the samples, looking at request.uri and others is interesting while you try to build graphs

Here is an example query using multiple attributes:

SELECT oauth_adapter, request_client_name, appName from Transaction where oauth_adapter = 'dot' and request_client_name is not null SINCE 1 week ago

request_auth_type

Actual values seen in Production:

  • unauthenticated
  • jwt
  • bearer
  • basic
  • no-user
  • negotiate
  • ntlm
  • ssi
  • token
  • whm
  • session-or-unknown
SELECT uniques(request_auth_type) from Transaction SINCE 5 hours ago

request_user_agent

NewRelic has its own "request.headers.userAgent" field.  At this time, it seems that some transactions have a value for "request_user_agent", and others for "request.headers.userAgent", but not both.  This is true even for Python user agents.

SELECT request_user_agent, `request.headers.userAgent` from Transaction WHERE request_user_agent != `request.headers.userAgent` AND (request_user_agent is NOT NULL OR `request.headers.userAgent` IS NOT NULL)

request_client_name

The request_client_name is taken from the user agent string for calls made using edx-rest-api-client v1.8.2+.

Note that this will often return an app (such as prod-edx-ecommerce) but will default back to the hostname of the machine.

SELECT request_client_name FROM Transaction WHERE request_client_name IS NOT NULL AND request_client_name !='unknown_client_name'

request_referer

Seems to be working as expected.  Only appears on certain transactions.

SELECT request_referer from Transaction WHERE request_referer is not null

Update IDAs and NewRelic Applications

NewRelic Applications (RequestMetricsMiddleware)

  • prod-edx-analytics-api
  • prod-edx-insights
  • prod-edx-journals
  • prod-edx-credentials
  • prod-edx-discovery
  • prod-edx-ecommerce
  • prod-edx-edxapp-cms
  • prod-edx-edxapp-lms
  • prod-edx-notes

NewRelic Applications (Workers)

  • prod-edx-ecomworker  * not yet updated
  • prod-edx-edxapp-workers (updated with edx-platform)

NewRelic Applications (Skipped)

  • prod-edx-forum
  • prod-edx-mktg

Additional edx-rest-api-client Upgrades Possible

We need to determine when and if to update each of these.  It is moot if the user agent string isn't being updated correctly.

  • edx/bi-internal-reporting * not yet updated
  • edx/ecommerce-scripts * not yet updated
  • edx/ecommerce-worker * not yet updated
  • edx/tubular * not yet updated

IDA Updates Completed

For working with all IDAs, see  ARCH-193 - Getting issue details... STATUS  for a list of IDAs and example PRs.