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

Add "(GPN: gcsfuse-<client-identifier>)" to useragent #1111

Merged
merged 2 commits into from
May 16, 2023
Merged

Conversation

ashmeenkaur
Copy link
Collaborator

@ashmeenkaur ashmeenkaur commented May 11, 2023

Description

Added GPN:gcsfuse- to user agent.
Removed redundant client identifier(appname or metadata image type env variable) from user agent if it has been appended to GPN.

Possible Scenarios and changes:

  1. When both GCSFUSE_METADATA_IMAGE_TYPE environment variable and app-name flag are set
    • GCSFUSE_METADATA_IMAGE_TYPE=DLC app-name=myapp
    • Old UserAgent = gcsfuse/0.42.3 (Go version go1.19.5) myapp DLC,gzip(gfe)
    • New UserAgent =gcsfuse/0.42.3 (Go version go1.19.5) myapp (GPN:gcsfuse-DLC),gzip(gfe)
  2. When both GCSFUSE_METADATA_IMAGE_TYPE environment variable and app-name flag are unset
    • GCSFUSE_METADATA_IMAGE_TYPE="" app-name=""
    • Old UserAgent = gcsfuse/0.42.3 (Go version go1.19.5),gzip(gfe)
    • New UserAgent =gcsfuse/0.42.3 (Go version go1.19.5) (GPN:gcsfuse),gzip(gfe)
  3. When GCSFUSE_METADATA_IMAGE_TYPE is set and app-name is unset
    • GCSFUSE_METADATA_IMAGE_TYPE=DLC app-name=""
    • Old UserAgent = gcsfuse/0.42.3 (Go version go1.19.5) DLC,gzip(gfe)
    • New UserAgent =gcsfuse/0.42.3 (Go version go1.19.5) (GPN:gcsfuse-DLC),gzip(gfe)
  4. When GCSFUSE_METADATA_IMAGE_TYPE is unset and app-name is set
    • GCSFUSE_METADATA_IMAGE_TYPE="" app-name=myapp
    • Old UserAgent = gcsfuse/0.42.3 (Go version go1.19.5) myapp,gzip(gfe)
    • New UserAgent =gcsfuse/0.42.3 (Go version go1.19.5) (GPN:gcsfuse-myapp),gzip(gfe)

Link to the issue in case of a bug fix.

Testing details

  1. Manual - Manually verified that the user agent has GPN appended
  2. Unit tests - added
  3. Integration tests - NA

@ashmeenkaur ashmeenkaur requested review from sethiay and Tulsishah May 11, 2023 10:04
Copy link
Contributor

@sethiay sethiay left a comment

Choose a reason for hiding this comment

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

Please add examples of final user agent string in each of the 4 combinations possible with app-name and env variable in the Description of this PR.

main.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
internal/storage/storage_handle_test.go Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
… for partner data tracking." (#1109)"

This reverts commit e345118.

Changes to enable PDT
@ashmeenkaur ashmeenkaur merged commit d340f92 into master May 16, 2023
@ashmeenkaur ashmeenkaur deleted the enable_PDT branch August 30, 2023 22:54
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