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

Allow proxy for client telemetry #29022

Merged
merged 17 commits into from
May 26, 2022

Conversation

xinlian12
Copy link
Member

@xinlian12 xinlian12 commented May 23, 2022

Description

Fix issue: #29023. Customer would like to ONLY enable proxy for their clientTelemetry requests. But currently, clientTelemetryRequests and gatewayRequests are sharing the same HttpClient which makes it impossible. So in this PR, internally we separate the httpclients and allow customer to config the proxy through System property.

Example code:

 System.setProperty(
                        "COSMOS.CLIENT_TELEMETRY_PROXY_OPTIONS_CONFIG",
                       "{\"type\":\"HTTP\", \"host\": \"localhost\", \"port\": 8080}");

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-cosmos

Copy link
Member

@kushagraThapar kushagraThapar left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, with a new implementation config that will be used just for ClientTelemetry.
However, one thing to think about our Metric Registry exposure for certain customers, where do you think that information can go?
Basically these 2 issues: #29025
#29026

@xinlian12
Copy link
Member Author

xinlian12 commented May 23, 2022

Overall looks good to me, with a new implementation config that will be used just for ClientTelemetry.
However, one thing to think about our Metric Registry exposure for certain customers, where do you think that information can go?
Basically these 2 issues: #29025
#29026

Good point, The name should definitely change then. ClientTelemetryConnectionConfig -> ClientTelemetryConfig

@xinlian12
Copy link
Member Author

/azp run java - cosmos

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

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

LGTM - except for the test comment (please revert all the places where you use withClientTelemetryEnabled(false) - this is the default - those changes shouldn't be necessary.

@joshfree joshfree added the Client This issue points to a problem in the data-plane of the library. label May 25, 2022
@xinlian12
Copy link
Member Author

/azp run java - cosmos

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xinlian12
Copy link
Member Author

/azp run java - cosmos

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kushagraThapar kushagraThapar merged commit 99a587f into Azure:main May 26, 2022
anushkasingh16 pushed a commit to anushkasingh16/azure-sdk-for-java that referenced this pull request Jun 6, 2022
* update comments

* allowClientTelemetryRequestToGoThroughProxy

* resolve feedback

* clear

* update changelog

* fix tests

* fix spotbug issue

* fix tests

* resolve comments

* resolve comments

* add the tests change back

* resolve comments

Co-authored-by: annie-mac <[email protected]>
Co-authored-by: annie-mac <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants