From bc3e75833f207b73f2d4f4bdf2324ec056bacc6e Mon Sep 17 00:00:00 2001 From: BenB196 Date: Mon, 24 Feb 2025 14:14:14 -0500 Subject: [PATCH 1/3] feat: [mysql] add support for condition --- packages/mysql/changelog.yml | 5 +++++ .../error/agent/stream/stream.yml.hbs | 5 ++++- .../galera_status/agent/stream/stream.yml.hbs | 3 +++ .../performance/agent/stream/stream.yml.hbs | 3 +++ .../replica_status/agent/stream/stream.yml.hbs | 5 ++++- .../slowlog/agent/stream/stream.yml.hbs | 5 ++++- .../status/agent/stream/stream.yml.hbs | 3 +++ packages/mysql/manifest.yml | 16 +++++++++++++++- 8 files changed, 41 insertions(+), 4 deletions(-) diff --git a/packages/mysql/changelog.yml b/packages/mysql/changelog.yml index 93a6529440d..8193909158f 100644 --- a/packages/mysql/changelog.yml +++ b/packages/mysql/changelog.yml @@ -1,4 +1,9 @@ # newer versions go on top +- version: 1.27.0 + changes: + - description: Add ability to set condition for logs and metrics. + type: enhancement + link: https://github.com/elastic/integrations/pull/9704 - version: 1.26.0 changes: - description: Add support for Kibana `9.0.0`. diff --git a/packages/mysql/data_stream/error/agent/stream/stream.yml.hbs b/packages/mysql/data_stream/error/agent/stream/stream.yml.hbs index 81687ef37af..bd4782f34d8 100644 --- a/packages/mysql/data_stream/error/agent/stream/stream.yml.hbs +++ b/packages/mysql/data_stream/error/agent/stream/stream.yml.hbs @@ -22,4 +22,7 @@ processors: - add_locale: ~ {{#if processors}} {{processors}} -{{/if}} \ No newline at end of file +{{/if}} +{{#if condition}} +condition: {{ condition }} +{{/if}} diff --git a/packages/mysql/data_stream/galera_status/agent/stream/stream.yml.hbs b/packages/mysql/data_stream/galera_status/agent/stream/stream.yml.hbs index d7fcfc32840..193302a8516 100644 --- a/packages/mysql/data_stream/galera_status/agent/stream/stream.yml.hbs +++ b/packages/mysql/data_stream/galera_status/agent/stream/stream.yml.hbs @@ -20,3 +20,6 @@ username: {{username}} processors: {{processors}} {{/if}} +{{#if condition}} +condition: {{ condition }} +{{/if}} diff --git a/packages/mysql/data_stream/performance/agent/stream/stream.yml.hbs b/packages/mysql/data_stream/performance/agent/stream/stream.yml.hbs index fcf0f429e02..e751d6de1eb 100644 --- a/packages/mysql/data_stream/performance/agent/stream/stream.yml.hbs +++ b/packages/mysql/data_stream/performance/agent/stream/stream.yml.hbs @@ -20,3 +20,6 @@ username: {{username}} processors: {{processors}} {{/if}} +{{#if condition}} +condition: {{ condition }} +{{/if}} diff --git a/packages/mysql/data_stream/replica_status/agent/stream/stream.yml.hbs b/packages/mysql/data_stream/replica_status/agent/stream/stream.yml.hbs index df91b9da22e..d1d091e4560 100644 --- a/packages/mysql/data_stream/replica_status/agent/stream/stream.yml.hbs +++ b/packages/mysql/data_stream/replica_status/agent/stream/stream.yml.hbs @@ -18,4 +18,7 @@ processors: driver: "mysql" sql_queries: - query: {{replication_status_query}} - response_format: "table" \ No newline at end of file + response_format: "table" +{{#if condition}} +condition: {{ condition }} +{{/if}} diff --git a/packages/mysql/data_stream/slowlog/agent/stream/stream.yml.hbs b/packages/mysql/data_stream/slowlog/agent/stream/stream.yml.hbs index 985e9f2b43d..e849a68aa9a 100644 --- a/packages/mysql/data_stream/slowlog/agent/stream/stream.yml.hbs +++ b/packages/mysql/data_stream/slowlog/agent/stream/stream.yml.hbs @@ -22,4 +22,7 @@ processors: - add_locale: ~ {{#if processors}} {{processors}} -{{/if}} \ No newline at end of file +{{/if}} +{{#if condition}} +condition: {{ condition }} +{{/if}} diff --git a/packages/mysql/data_stream/status/agent/stream/stream.yml.hbs b/packages/mysql/data_stream/status/agent/stream/stream.yml.hbs index 67edd68d4bd..4cb9ba2fe5c 100644 --- a/packages/mysql/data_stream/status/agent/stream/stream.yml.hbs +++ b/packages/mysql/data_stream/status/agent/stream/stream.yml.hbs @@ -20,3 +20,6 @@ username: {{username}} processors: {{processors}} {{/if}} +{{#if condition}} +condition: {{ condition }} +{{/if}} diff --git a/packages/mysql/manifest.yml b/packages/mysql/manifest.yml index f2b088dff6f..8319ecd26bb 100644 --- a/packages/mysql/manifest.yml +++ b/packages/mysql/manifest.yml @@ -1,7 +1,7 @@ format_version: "3.0.2" name: mysql title: MySQL -version: "1.26.0" +version: "1.27.0" description: Collect logs and metrics from MySQL servers with Elastic Agent. type: integration categories: @@ -88,6 +88,13 @@ policy_templates: # yvgJ38BRsFOtkRuAGSf6ZUwTO8JJRRIFnpUzXflAnGivK9M13D5GEQMmIl6U9Pvk # sxSmbIUfc2SGJGCJD4I= # -----END CERTIFICATE----- + - name: condition + title: Condition + description: Condition to filter when to collect this input. See [Dynamic Input Configuration](https://www.elastic.co/guide/en/fleet/current/dynamic-input-configuration.html) for details. + type: text + multi: false + required: false + show_user: false - type: sql/metrics title: Collect replica status metrics from MySQL hosts description: Collecting replica status metrics @@ -137,6 +144,13 @@ policy_templates: # yvgJ38BRsFOtkRuAGSf6ZUwTO8JJRRIFnpUzXflAnGivK9M13D5GEQMmIl6U9Pvk # sxSmbIUfc2SGJGCJD4I= # -----END CERTIFICATE----- + - name: condition + title: Condition + description: Condition to filter when to collect this input. See [Dynamic Input Configuration](https://www.elastic.co/guide/en/fleet/current/dynamic-input-configuration.html) for details. + type: text + multi: false + required: false + show_user: false owner: github: elastic/obs-infraobs-integrations type: elastic From fe785ca3b22c2dedfeb0ea4e4cfb9a84e323d8a7 Mon Sep 17 00:00:00 2001 From: BenB196 <8277432+BenB196@users.noreply.github.com> Date: Tue, 25 Feb 2025 08:16:37 -0500 Subject: [PATCH 2/3] Update changelog.yml --- packages/mysql/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mysql/changelog.yml b/packages/mysql/changelog.yml index 8193909158f..18819bfb13d 100644 --- a/packages/mysql/changelog.yml +++ b/packages/mysql/changelog.yml @@ -1,7 +1,7 @@ # newer versions go on top - version: 1.27.0 changes: - - description: Add ability to set condition for logs and metrics. + - description: Add support for defining Conditions. type: enhancement link: https://github.com/elastic/integrations/pull/9704 - version: 1.26.0 From c17b4685825d1606eda93c00eb5d43ef98d53e2d Mon Sep 17 00:00:00 2001 From: Ishleen Kaur <102962586+ishleenk17@users.noreply.github.com> Date: Fri, 28 Feb 2025 16:17:42 +0530 Subject: [PATCH 3/3] Update packages/mysql/changelog.yml --- packages/mysql/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mysql/changelog.yml b/packages/mysql/changelog.yml index 18819bfb13d..c5a89046e08 100644 --- a/packages/mysql/changelog.yml +++ b/packages/mysql/changelog.yml @@ -3,7 +3,7 @@ changes: - description: Add support for defining Conditions. type: enhancement - link: https://github.com/elastic/integrations/pull/9704 + link: https://github.com/elastic/integrations/pull/12881 - version: 1.26.0 changes: - description: Add support for Kibana `9.0.0`.