From 7f901a0673141aec781e56e509379fc0510b90bd Mon Sep 17 00:00:00 2001 From: karel rehor Date: Fri, 6 Jun 2025 13:28:46 +0200 Subject: [PATCH 1/6] chore: remove refrences to Python2 in kapacitor anaomaly_detection. --- .../kapacitor/v1/guides/anomaly_detection.md | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/content/kapacitor/v1/guides/anomaly_detection.md b/content/kapacitor/v1/guides/anomaly_detection.md index 1009c943b..82da594c7 100644 --- a/content/kapacitor/v1/guides/anomaly_detection.md +++ b/content/kapacitor/v1/guides/anomaly_detection.md @@ -407,15 +407,15 @@ if __name__ == '__main__': agent.handler = h # Anything printed to STDERR from a UDF process gets captured into the Kapacitor logs. - print >> sys.stderr, "Starting agent for TTestHandler" + print("Starting agent for TTestHandler", file=sys.stderr) agent.start() agent.wait() - print >> sys.stderr, "Agent finished" + print("Agent finished", file=sys.stderr) ``` That was a lot, but now we are ready to configure Kapacitor to run our -code. Create a scratch dir for working through the rest of this +code. Make sure that `scipy` is installed (`$ pip3 install scipy`). Create a scratch dir for working through the rest of this guide: ```bash @@ -434,7 +434,7 @@ Add this snippet to your Kapacitor configuration file (typically located at `/et [udf.functions] [udf.functions.tTest] # Run python - prog = "/usr/bin/python2" + prog = "/usr/bin/python3" # Pass args to python # -u for unbuffered STDIN and STDOUT # and the path to the script @@ -468,7 +468,7 @@ correctly: service kapacitor restart ``` -Check the logs (`/var/log/kapacitor/`) to make sure you see a +Check the logs (`/var/log/kapacitor/` or `journalctl -f -n 256 -u kapacitor.service`) to make sure you see a *Listening for signals* line and that no errors occurred. If you don't see the line, it's because the UDF process is hung and not responding. It should be killed after a timeout, so give it a moment @@ -544,6 +544,20 @@ the Kapacitor task: kapacitor define print_temps -tick print_temps.tick ``` +Ensure that the task is enabled: + +```bash +kapacitor enable print_temps +``` + +And then... + +```bash +kapacitor list tasks +ID Type Status Executing Databases and Retention Policies +print_temps stream enabled true ["printer"."autogen"] +``` + ### Generating test data To simulate our printer for testing, we will write a simple Python @@ -557,7 +571,7 @@ to use real data for testing our TICKscript and UDF, but this is faster (and much cheaper than a 3D printer). ```python -#!/usr/bin/python2 +#!/usr/bin/env python from numpy import random from datetime import timedelta, datetime @@ -672,7 +686,11 @@ fake data so that we can easily iterate on the task: ```sh # Start the recording in the background kapacitor record stream -task print_temps -duration 24h -no-wait -# Grab the ID from the output and store it in a var +# Grab the ID and store it in a var +kapacitor list recordings +ID Type Status Size Date +7bd3ced5-5e95-4a67-a0e1-f00860b1af47 stream running 0 B 04 May 16 11:34 MDT + rid=7bd3ced5-5e95-4a67-a0e1-f00860b1af47 # Run our python script to generate data chmod +x ./printer_data.py From c98f6cfc954a2ffd902191b36f84c87e8c7cb5da Mon Sep 17 00:00:00 2001 From: karel rehor Date: Fri, 6 Jun 2025 13:30:46 +0200 Subject: [PATCH 2/6] chore: cleanup lint warning --- content/kapacitor/v1/guides/anomaly_detection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/kapacitor/v1/guides/anomaly_detection.md b/content/kapacitor/v1/guides/anomaly_detection.md index 82da594c7..373dccd27 100644 --- a/content/kapacitor/v1/guides/anomaly_detection.md +++ b/content/kapacitor/v1/guides/anomaly_detection.md @@ -469,7 +469,7 @@ service kapacitor restart ``` Check the logs (`/var/log/kapacitor/` or `journalctl -f -n 256 -u kapacitor.service`) to make sure you see a -*Listening for signals* line and that no errors occurred. If you +_Listening for signals_ line and that no errors occurred. If you don't see the line, it's because the UDF process is hung and not responding. It should be killed after a timeout, so give it a moment to stop properly. Once stopped, you can fix any errors and try again. From b5a931279ce26b25e9f9343f69fee46768da7db5 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 6 Jun 2025 09:27:08 -0500 Subject: [PATCH 3/6] Apply suggestions from code review --- content/kapacitor/v1/guides/anomaly_detection.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/kapacitor/v1/guides/anomaly_detection.md b/content/kapacitor/v1/guides/anomaly_detection.md index 373dccd27..1fc4ab856 100644 --- a/content/kapacitor/v1/guides/anomaly_detection.md +++ b/content/kapacitor/v1/guides/anomaly_detection.md @@ -550,7 +550,7 @@ Ensure that the task is enabled: kapacitor enable print_temps ``` -And then... +And then list the tasks: ```bash kapacitor list tasks @@ -686,7 +686,7 @@ fake data so that we can easily iterate on the task: ```sh # Start the recording in the background kapacitor record stream -task print_temps -duration 24h -no-wait -# Grab the ID and store it in a var +# Copy the ID and store it in a variable kapacitor list recordings ID Type Status Size Date 7bd3ced5-5e95-4a67-a0e1-f00860b1af47 stream running 0 B 04 May 16 11:34 MDT From 6de5de2edb1b99c78fc531fc44f6cc27b0cd5635 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 6 Jun 2025 09:32:05 -0500 Subject: [PATCH 4/6] update date format in telegraf release notes (#6127) --- content/telegraf/v1/release-notes.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/telegraf/v1/release-notes.md b/content/telegraf/v1/release-notes.md index 44925f7e0..a5cd55648 100644 --- a/content/telegraf/v1/release-notes.md +++ b/content/telegraf/v1/release-notes.md @@ -11,7 +11,7 @@ menu: weight: 60 --- -## v1.34.1 [2025-03-24] +## v1.34.1 {date="2025-03-24"} ### Bugfixes @@ -40,7 +40,7 @@ menu: - [#16653](https://github.com/influxdata/telegraf/pull/16653) `deps` Bump k8s.io/api from 0.32.1 to 0.32.3 - [#16659](https://github.com/influxdata/telegraf/pull/16659) `deps` Bump tj-actions/changed-files from v45 to v46.0.1 -## v1.34.0 [2025-03-10] +## v1.34.0 {date="2025-03-10"} ### New Plugins @@ -94,7 +94,7 @@ menu: - [#16575](https://github.com/influxdata/telegraf/pull/16575) `deps` Bump github.com/tidwall/wal from 1.1.7 to 1.1.8 - [#16578](https://github.com/influxdata/telegraf/pull/16578) `deps` Bump super-linter/super-linter from 7.2.1 to 7.3.0 -## v1.33.3 [2025-02-25] +## v1.33.3 {date="2025-02-25"} ### Important Changes @@ -128,7 +128,7 @@ menu: - [#16504](https://github.com/influxdata/telegraf/pull/16504) `deps` Bump golang.org/x/net from 0.34.0 to 0.35.0 - [#16512](https://github.com/influxdata/telegraf/pull/16512) `deps` Bump golangci-lint from v1.63.4 to v1.64.5 -## v1.33.2 [2025-02-10] +## v1.33.2 {date="2025-02-10"} ### Important Changes @@ -177,7 +177,7 @@ menu: - [#16482](https://github.com/influxdata/telegraf/pull/16482) `deps` Update Apache arrow from 0.0-20240716144821-cf5d7c7ec3cf to 18.1.0 - [#16423](https://github.com/influxdata/telegraf/pull/16423) `deps` Update ClickHouse SQL driver from 1.5.4 to to 2.30.1 -## v1.33.1 [2025-01-10] +## v1.33.1 {date="2025-01-10"} ### Important Changes From dad38c90d64d836b05361668a55d0367e411f0a6 Mon Sep 17 00:00:00 2001 From: karel-rehor Date: Fri, 6 Jun 2025 17:04:40 +0200 Subject: [PATCH 5/6] Update content/kapacitor/v1/guides/anomaly_detection.md Co-authored-by: Jason Stirnaman --- content/kapacitor/v1/guides/anomaly_detection.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/kapacitor/v1/guides/anomaly_detection.md b/content/kapacitor/v1/guides/anomaly_detection.md index 1fc4ab856..f1a91261d 100644 --- a/content/kapacitor/v1/guides/anomaly_detection.md +++ b/content/kapacitor/v1/guides/anomaly_detection.md @@ -686,11 +686,11 @@ fake data so that we can easily iterate on the task: ```sh # Start the recording in the background kapacitor record stream -task print_temps -duration 24h -no-wait -# Copy the ID and store it in a variable +# List recordings to find the ID kapacitor list recordings ID Type Status Size Date 7bd3ced5-5e95-4a67-a0e1-f00860b1af47 stream running 0 B 04 May 16 11:34 MDT - +# Copy the ID and store it in a variable rid=7bd3ced5-5e95-4a67-a0e1-f00860b1af47 # Run our python script to generate data chmod +x ./printer_data.py From d177f373f9c7c69735d2e69c57ab400e94b4e40d Mon Sep 17 00:00:00 2001 From: Adam S Date: Fri, 6 Jun 2025 08:22:21 -0700 Subject: [PATCH 6/6] Add influxdb namespace to identify version (#6044) Add influxdb namespace to identify current InfluxDB Clustered package version, which matches the influxdb namespace example used to apply the updated image. Co-authored-by: Scott Anderson --- content/influxdb3/clustered/admin/upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/influxdb3/clustered/admin/upgrade.md b/content/influxdb3/clustered/admin/upgrade.md index 06b15be66..26ad743ef 100644 --- a/content/influxdb3/clustered/admin/upgrade.md +++ b/content/influxdb3/clustered/admin/upgrade.md @@ -51,7 +51,7 @@ Use the following command to return the image Kubernetes uses to build your InfluxDB cluster: ```sh -kubectl get appinstances.kubecfg.dev influxdb -o jsonpath='{.spec.package.image}' +kubectl get appinstances.kubecfg.dev influxdb -n influxdb -o jsonpath='{.spec.package.image}' ``` The package version number is at the end of the returned string (after `influxdb:`):