Skip to content

Commit

Permalink
Adding functionality for dd_trace_rate_limit for get_tracer_config() (
Browse files Browse the repository at this point in the history
  • Loading branch information
mhlidd authored Oct 7, 2024
1 parent 8a90924 commit 0ee29a4
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public GetTraceConfigResult config() {
Method isDebugEnabled = configClass.getMethod("isDebugEnabled");
Method getLogLevel = configClass.getMethod("getLogLevel");
Method getAgentUrl = configClass.getMethod("getAgentUrl");
Method getTraceRateLimit = configClass.getMethod("getTraceRateLimit");

Method isTraceOtelEnabled = instrumenterConfigClass.getMethod("isTraceOtelEnabled");

Expand All @@ -72,6 +73,11 @@ public GetTraceConfigResult config() {
configMap.put("dd_trace_sample_rate", String.valueOf((Double)sampleRate));
}

Object rateLimit = getTraceRateLimit.invoke(configObject);
if (rateLimit instanceof Integer) {
configMap.put("dd_trace_rate_limit", Integer.toString((int)rateLimit));
}

Object globalTags = getGlobalTags.invoke(configObject);
if (globalTags != null) {
String result = ((Map<String, String>)globalTags).entrySet()
Expand Down

0 comments on commit 0ee29a4

Please sign in to comment.