Skip to content

Commit f071667

Browse files
authored
Merge pull request #362 from holmes1412/master
Trace : make RPCTraceOpenTelemetry default path modifiable
2 parents c5d27e0 + c86bb26 commit f071667

5 files changed

Lines changed: 23 additions & 3 deletions

File tree

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rules_proto_toolchains()
1818

1919
git_repository(
2020
name = "workflow",
21-
commit = "3a8c14ce6bf328978d8dca3b3bb29bf5fd02a122",
21+
commit = "b08ebcd02e11ea59f158ac34d4b9f4f226d6f326",
2222
remote = "https://github.com/sogou/workflow.git")
2323

2424
new_git_repository(

src/module/rpc_trace_filter.cc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,29 @@ RPCTraceOpenTelemetry::RPCTraceOpenTelemetry(const std::string& url) :
346346
}
347347

348348
RPCTraceOpenTelemetry::RPCTraceOpenTelemetry(const std::string& url,
349+
const std::string& path) :
350+
RPCFilter(RPCModuleTypeTrace),
351+
url(url + path),
352+
redirect_max(OTLP_HTTP_REDIRECT_MAX),
353+
retry_max(OTLP_HTTP_RETRY_MAX),
354+
filter_policy(SPANS_PER_SECOND_DEFAULT,
355+
RPC_REPORT_THREHOLD_DEFAULT,
356+
RPC_REPORT_INTERVAL_DEFAULT),
357+
report_status(false),
358+
report_span_count(0)
359+
{
360+
this->report_req = new TracesData;
361+
}
362+
363+
RPCTraceOpenTelemetry::RPCTraceOpenTelemetry(const std::string& url,
364+
const std::string& path,
349365
int redirect_max,
350366
int retry_max,
351367
size_t spans_per_second,
352368
size_t report_threshold,
353369
size_t report_interval) :
354370
RPCFilter(RPCModuleTypeTrace),
355-
url(url + OTLP_TRACES_PATH),
371+
url(url + path),
356372
redirect_max(redirect_max),
357373
retry_max(retry_max),
358374
filter_policy(spans_per_second, report_threshold, report_interval),

src/module/rpc_trace_filter.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ class RPCTraceOpenTelemetry : public RPCFilter
277277
public:
278278
RPCTraceOpenTelemetry(const std::string& url);
279279

280+
RPCTraceOpenTelemetry(const std::string& url, const std::string& path);
281+
280282
RPCTraceOpenTelemetry(const std::string& url,
283+
const std::string& path,
281284
int redirect_max,
282285
int retry_max,
283286
size_t spans_per_second,

src/rpc_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ struct RPCServerParams : public WFServerParams
5353
{
5454
RPCServerParams() :
5555
WFServerParams({
56+
/* .transport_type = */ TT_TCP,
5657
/* .max_connections = */ 2000,
5758
/* .peer_response_timeout = */ 10 * 1000,
5859
/* .receive_timeout = */ -1,

0 commit comments

Comments
 (0)