X-SaaSus-Trace-Id 自動引継機能の追加#110
Open
takahujikeita wants to merge 1 commit into
Open
Conversation
- Add xSaaSusTraceId field and setXSaaSusTraceId() setter to all API client classes - Inject X-SaaSus-Trace-Id header in all outbound SaaSus API requests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds automatic forwarding of the X-SaaSus-Trace-Id header across the SaaSus Java SDK’s module-level *ApiClient wrappers by storing a trace ID on each client instance and injecting it into outgoing requests inside execute().
Changes:
- Added an
xSaaSusTraceIdfield to each module*ApiClientwrapper. - Added a
setXSaaSusTraceId(...)setter to configure the trace ID on the client. - Updated
execute()to attachX-SaaSus-Trace-Idto all outgoing requests when configured.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/saasus/sdk/modules/PricingApiClient.java | Adds trace-id storage and injects X-SaaSus-Trace-Id in execute() for Pricing API calls. |
| src/main/java/saasus/sdk/modules/IntegrationApiClient.java | Adds trace-id storage and injects X-SaaSus-Trace-Id in execute() for Integration API calls. |
| src/main/java/saasus/sdk/modules/CommunicationApiClient.java | Adds trace-id storage and injects X-SaaSus-Trace-Id in execute() for Communication API calls. |
| src/main/java/saasus/sdk/modules/BillingApiClient.java | Adds trace-id storage and injects X-SaaSus-Trace-Id in execute() for Billing API calls. |
| src/main/java/saasus/sdk/modules/AwsMarketplaceClient.java | Adds trace-id storage and injects X-SaaSus-Trace-Id in execute() for AWS Marketplace API calls. |
| src/main/java/saasus/sdk/modules/AuthApiClient.java | Adds trace-id storage and injects X-SaaSus-Trace-Id in execute() for Auth API calls. |
| src/main/java/saasus/sdk/modules/ApiLogApiClient.java | Adds trace-id storage and injects X-SaaSus-Trace-Id in execute() for API Log API calls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+72
to
+77
| private String getXSaaSusTraceId() { | ||
| if (xSaaSusTraceId == null) { | ||
| return ""; | ||
| } | ||
| return xSaaSusTraceId; | ||
| } |
Comment on lines
+79
to
+81
| public void setXSaaSusTraceId(String xSaaSusTraceId) { | ||
| this.xSaaSusTraceId = xSaaSusTraceId; | ||
| } |
Comment on lines
+72
to
+77
| private String getXSaaSusTraceId() { | ||
| if (xSaaSusTraceId == null) { | ||
| return ""; | ||
| } | ||
| return xSaaSusTraceId; | ||
| } |
Comment on lines
+79
to
+81
| public void setXSaaSusTraceId(String xSaaSusTraceId) { | ||
| this.xSaaSusTraceId = xSaaSusTraceId; | ||
| } |
Comment on lines
+72
to
+77
| private String getXSaaSusTraceId() { | ||
| if (xSaaSusTraceId == null) { | ||
| return ""; | ||
| } | ||
| return xSaaSusTraceId; | ||
| } |
Comment on lines
+79
to
+81
| public void setXSaaSusTraceId(String xSaaSusTraceId) { | ||
| this.xSaaSusTraceId = xSaaSusTraceId; | ||
| } |
Comment on lines
+72
to
+77
| private String getXSaaSusTraceId() { | ||
| if (xSaaSusTraceId == null) { | ||
| return ""; | ||
| } | ||
| return xSaaSusTraceId; | ||
| } |
Comment on lines
+79
to
+81
| public void setXSaaSusTraceId(String xSaaSusTraceId) { | ||
| this.xSaaSusTraceId = xSaaSusTraceId; | ||
| } |
Comment on lines
+71
to
+76
| private String getXSaaSusTraceId() { | ||
| if (xSaaSusTraceId == null) { | ||
| return ""; | ||
| } | ||
| return xSaaSusTraceId; | ||
| } |
Comment on lines
+78
to
+80
| public void setXSaaSusTraceId(String xSaaSusTraceId) { | ||
| this.xSaaSusTraceId = xSaaSusTraceId; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
X-SaaSus-Trace-Idヘッダーの自動引継機能を実装しました。setXSaaSusTraceId()を各 API クライアントに対して呼び出すことで、X-SaaSus-Trace-Idヘッダーが全ての SaaSus API リクエストに転送されます。変更内容
src/main/java/saasus/sdk/modules/配下の全*ApiClient.java:xSaaSusTraceIdフィールドを追加setXSaaSusTraceId()セッターを追加execute()内でX-SaaSus-Trace-Idヘッダーを付与実装パターン
既存の
X-SaaSus-Referer/setXSaasusReferer()の実装と同じパターンに従っています。