Skip to content

X-SaaSus-Trace-Id 自動引継機能の追加#110

Open
takahujikeita wants to merge 1 commit into
mainfrom
add_x_saasus_trace_id
Open

X-SaaSus-Trace-Id 自動引継機能の追加#110
takahujikeita wants to merge 1 commit into
mainfrom
add_x_saasus_trace_id

Conversation

@takahujikeita

@takahujikeita takahujikeita commented May 21, 2026

Copy link
Copy Markdown

概要

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() の実装と同じパターンに従っています。

- 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>
@takahujikeita takahujikeita changed the title Add X-SaaSus-Trace-Id auto-propagation feature X-SaaSus-Trace-Id 自動引継機能の追加 May 21, 2026
@SasakiTakatsugu SasakiTakatsugu requested a review from Copilot June 10, 2026 07:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 xSaaSusTraceId field to each module *ApiClient wrapper.
  • Added a setXSaaSusTraceId(...) setter to configure the trace ID on the client.
  • Updated execute() to attach X-SaaSus-Trace-Id to 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;
}
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.

2 participants