googleapis / google-auth-library-python

Google Auth Python Library
https://googleapis.dev/python/google-auth/latest/
Apache License 2.0
778 stars 307 forks source link

feat: add metrics (part 1) #1298

Closed arithmetic1728 closed 1 year ago

arithmetic1728 commented 1 year ago

This PR: (1) list the metrics values needed (2) add the _metric_header_for_usage method to the base credential class, which is used by the before_request method to add the metrics header for token usage. Children credentials classes can override this method for token usage metrics.

internal doc: go/googleapis-auth-metric-design