From 322436a6495ab6ddca375bb0340074509bdc8ea3 Mon Sep 17 00:00:00 2001 From: Jean-Yves NOLEN Date: Thu, 4 Jul 2024 13:47:49 +0200 Subject: [PATCH] feat: Add Sending Queue Option for OpenSearch Signed-off-by: Jean-Yves NOLEN --- .../feature_opensearch-sending-queue.yaml | 27 +++++++++++++++++++ exporter/opensearchexporter/README.md | 3 +++ exporter/opensearchexporter/config.go | 1 + exporter/opensearchexporter/factory.go | 2 ++ 4 files changed, 33 insertions(+) create mode 100644 .chloggen/feature_opensearch-sending-queue.yaml diff --git a/.chloggen/feature_opensearch-sending-queue.yaml b/.chloggen/feature_opensearch-sending-queue.yaml new file mode 100644 index 000000000000..aced3a4a7d26 --- /dev/null +++ b/.chloggen/feature_opensearch-sending-queue.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: opensearchexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Add Sending Queue to enable persistent queue in case of upstream failure" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [33919] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/exporter/opensearchexporter/README.md b/exporter/opensearchexporter/README.md index 9ac629f609a4..e11980e6cc64 100644 --- a/exporter/opensearchexporter/README.md +++ b/exporter/opensearchexporter/README.md @@ -39,6 +39,9 @@ Supports standard TLS settings as part of HTTP settings. See [TLS Configuration/ ### Retry Options - `retry_on_failure`: See [retry_on_failure](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md) +### Sending Queue Options +- `sending_queue`: See [sending_queue](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md) + ### Timeout Options - `timeout` : See [timeout](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md) diff --git a/exporter/opensearchexporter/config.go b/exporter/opensearchexporter/config.go index c8546a6d407a..7de96173cca3 100644 --- a/exporter/opensearchexporter/config.go +++ b/exporter/opensearchexporter/config.go @@ -30,6 +30,7 @@ const ( type Config struct { confighttp.ClientConfig `mapstructure:"http"` configretry.BackOffConfig `mapstructure:"retry_on_failure"` + exporterhelper.QueueSettings `mapstructure:"sending_queue"` exporterhelper.TimeoutSettings `mapstructure:",squash"` MappingsSettings `mapstructure:"mapping"` diff --git a/exporter/opensearchexporter/factory.go b/exporter/opensearchexporter/factory.go index a10073ca04ae..4a0b066d7e4b 100644 --- a/exporter/opensearchexporter/factory.go +++ b/exporter/opensearchexporter/factory.go @@ -53,6 +53,7 @@ func createTracesExporter(ctx context.Context, exporterhelper.WithStart(te.Start), exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), exporterhelper.WithRetry(c.BackOffConfig), + exporterhelper.WithQueue(c.QueueSettings), exporterhelper.WithTimeout(c.TimeoutSettings)) } @@ -70,5 +71,6 @@ func createLogsExporter(ctx context.Context, exporterhelper.WithStart(le.Start), exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: true}), exporterhelper.WithRetry(c.BackOffConfig), + exporterhelper.WithQueue(c.QueueSettings), exporterhelper.WithTimeout(c.TimeoutSettings)) }