File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src/implementation/Client Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { Settings } from "../../../utils/Settings.util";
20
20
import { Logger } from "../../../logger/Logger" ;
21
21
import GRPCClientSidecar from "./sidecar" ;
22
22
import DaprClient from "../DaprClient" ;
23
+ import { SDK_VERSION } from "../../../version" ;
23
24
24
25
export default class GRPCClient implements IClient {
25
26
private isInitialized : boolean ;
@@ -69,7 +70,9 @@ export default class GRPCClient implements IClient {
69
70
}
70
71
71
72
private generateClient ( host : string , port : string , credentials : grpc . ChannelCredentials ) : GrpcDaprClient {
72
- const client = new GrpcDaprClient ( `${ host } :${ port } ` , credentials ) ;
73
+ const client = new GrpcDaprClient ( `${ host } :${ port } ` , credentials , {
74
+ "grpc.primary_user_agent" : "dapr-sdk-js/v" + SDK_VERSION ,
75
+ } ) ;
73
76
return client ;
74
77
}
75
78
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { Settings } from "../../../utils/Settings.util";
21
21
import { THTTPExecuteParams } from "../../../types/http/THTTPExecuteParams.type" ;
22
22
import { Logger } from "../../../logger/Logger" ;
23
23
import HTTPClientSidecar from "./sidecar" ;
24
+ import { SDK_VERSION } from "../../../version" ;
24
25
25
26
export default class HTTPClient implements IClient {
26
27
private isInitialized : boolean ;
@@ -157,6 +158,8 @@ export default class HTTPClient implements IClient {
157
158
params . headers [ "dapr-api-token" ] = this . options . daprApiToken ;
158
159
}
159
160
161
+ params . headers [ "user-agent" ] = `dapr-sdk-js/v${ SDK_VERSION } http/1` ;
162
+
160
163
if ( ! params ?. method ) {
161
164
params . method = "GET" ;
162
165
}
You can’t perform that action at this time.
0 commit comments