diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 17aca375832..466cfa7e623 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -358,6 +358,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Added support for retry configuration in GCS input. {issue}11580[11580] {pull}41862[41862] - Improve S3 polling mode states registry when using list prefix option. {pull}41869[41869] - AWS S3 input registry cleanup for untracked s3 objects. {pull}41694[41694] +- The environment variable `BEATS_AZURE_EVENTHUB_INPUT_TRACING_ENABLED: true` enables internal logs tracer for the azure-eventhub input. {issue}41931[41931] {pull}41932[41932] *Auditbeat* diff --git a/x-pack/filebeat/docs/inputs/input-azure-eventhub.asciidoc b/x-pack/filebeat/docs/inputs/input-azure-eventhub.asciidoc index 81cfdc66d52..808c46b8333 100644 --- a/x-pack/filebeat/docs/inputs/input-azure-eventhub.asciidoc +++ b/x-pack/filebeat/docs/inputs/input-azure-eventhub.asciidoc @@ -13,7 +13,10 @@ Users can make use of the `azure-eventhub` input in order to read messages from The azure-eventhub input implementation is based on the the event processor host (EPH is intended to be run across multiple processes and machines while load balancing message consumers more on this here https://github.com/Azure/azure-event-hubs-go#event-processor-host, https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-event-processor-host). State such as leases on partitions and checkpoints in the event stream are shared between receivers using an Azure Storage container. For this reason, as a prerequisite to using this input, users will have to create or use an existing storage account. - +Users can enable internal logs tracing for this input by setting the environment +variable `BEATS_AZURE_EVENTHUB_INPUT_TRACING_ENABLED: true`. When enabled, +this input will log additional information to the logs. Additional information +includes partition ownership, blob lease information, and other internal state. Example configuration: diff --git a/x-pack/filebeat/input/azureeventhub/tracer.go b/x-pack/filebeat/input/azureeventhub/tracer.go index f998a548e37..8ba77af3b4d 100644 --- a/x-pack/filebeat/input/azureeventhub/tracer.go +++ b/x-pack/filebeat/input/azureeventhub/tracer.go @@ -8,6 +8,7 @@ package azureeventhub import ( "context" + "os" "github.com/devigned/tab" @@ -15,7 +16,12 @@ import ( ) func init() { - tab.Register(new(logsOnlyTracer)) + // Register the logs tracer only if the environment variable is + // set to avoid the overhead of the tracer in environments where + // it's not needed. + if os.Getenv("BEATS_AZURE_EVENTHUB_INPUT_TRACING_ENABLED") == "true" { + tab.Register(new(logsOnlyTracer)) + } } // logsOnlyTracer manages the creation of the required