Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add metrics (part 1) #1298

Merged
merged 7 commits into from
May 23, 2023
Merged

feat: add metrics (part 1) #1298

merged 7 commits into from
May 23, 2023

Conversation

arithmetic1728
Copy link
Contributor

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

google/auth/metrics.py Outdated Show resolved Hide resolved
google/auth/metrics.py Show resolved Hide resolved
tests/test_metrics.py Outdated Show resolved Hide resolved
Copy link
Contributor

@wangyutongg wangyutongg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arithmetic1728 arithmetic1728 added the automerge Merge the pull request once unit tests and other checks pass. label May 23, 2023
@gcf-merge-on-green gcf-merge-on-green bot merged commit 246dd07 into main May 23, 2023
@gcf-merge-on-green gcf-merge-on-green bot deleted the metric1 branch May 23, 2023 21:22
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label May 23, 2023
This was referenced May 23, 2023
gcf-merge-on-green bot pushed a commit that referenced this pull request May 25, 2023
This PR adds `x-goog-api-client` header to
- access token and id token refresh requests, for compute engine credentials / user credentials / service account credentials / impersonated credentials
- reauth start and continue requests
- metadata server ping requests

Previous PRs:
Part 1: #1298 
Part 2: #1303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants