Commit 0f39fdb
luk384090-cloud
feat(headers): add SDK tracking headers to all DashScope requests
Every outbound DashScope request now carries three new headers:
- x-dashscope-sdk-client: identifies the SDK ("java-sdk")
- x-dashscope-sdk-version: current SDK version (from Version.version)
- x-dashscope-sdk-session-id: a process-level UUID, generated once at
class load and reused for the lifetime of the JVM
These headers are set before user-supplied customHeaders are merged, so
callers can override any of them if needed. Setting the environment
variable DASHSCOPE_DISABLE_SDK_HEADERS=1 (or true) opts out entirely.
Both HTTP (buildHttpHeaders) and WebSocket (buildWebSocketHeaders)
paths are covered, so all API calls — including Generation,
MultiModalConversation, image/video synthesis, TTS, etc. — will
automatically include the tracking metadata.1 parent 1849cfe commit 0f39fdb
1 file changed
Lines changed: 3 additions & 5 deletions
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
45 | | - | |
46 | | - | |
| 43 | + | |
| 44 | + | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
| |||
0 commit comments