diff --git a/custom/src/main/java/co/elastic/otel/dynamicconfig/DynamicConfiguration.java b/custom/src/main/java/co/elastic/otel/dynamicconfig/DynamicConfiguration.java index 6ea573e4..5551001d 100644 --- a/custom/src/main/java/co/elastic/otel/dynamicconfig/DynamicConfiguration.java +++ b/custom/src/main/java/co/elastic/otel/dynamicconfig/DynamicConfiguration.java @@ -84,6 +84,30 @@ private void initSendingStates() { } } + /** Can be executed repeatedly regardless of the current state */ + public void setSendingSpans(boolean send) { + initSendingStates(); + if (recoverySendSpansState != null) { + BlockableSpanExporter.getInstance().setSendingSpans(send); + } + } + + /** Can be executed repeatedly regardless of the current state */ + public void setSendingMetrics(boolean send) { + initSendingStates(); + if (recoverySendMetricsState != null) { + BlockableMetricExporter.getInstance().setSendingMetrics(send); + } + } + + /** Can be executed repeatedly regardless of the current state */ + public void setSendingLogs(boolean send) { + initSendingStates(); + if (recoverySendLogsState != null) { + BlockableLogRecordExporter.getInstance().setSendingLogs(send); + } + } + /** Can be executed repeatedly even if sending is currently stopped */ public void stopAllSending() { initSendingStates();