From 4f2b827f836db1b737f7ff2037af3d937a2a6b65 Mon Sep 17 00:00:00 2001 From: Sijo Kolenchery Date: Tue, 18 Apr 2023 16:42:45 +0200 Subject: [PATCH 1/4] Log telegraf logs to a file instead of STDERR Mainly to suppress telegraf related warnings and errors from customer logs, but still have them in a file for troubleshooting purposes. --- etc/telegraf/telegraf.toml.j2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/telegraf/telegraf.toml.j2 b/etc/telegraf/telegraf.toml.j2 index 874cdc5f6..2996d0d05 100644 --- a/etc/telegraf/telegraf.toml.j2 +++ b/etc/telegraf/telegraf.toml.j2 @@ -16,7 +16,10 @@ flush_jitter = "5s" precision = "" debug = {{ telegraf_debug_enabled }} - logfile = "" + logtarget = "file" + logfile = "/app/log/telegraf.log" + logfile_rotation_max_size = "10MB" + logfile_rotation_max_archives = 5 hostname = "{{ hostname }}" omit_hostname = false From 25d69aa5e73f7a3b65a9e2482bb0f47bb9eebba5 Mon Sep 17 00:00:00 2001 From: Sijo Kolenchery Date: Wed, 19 Apr 2023 09:09:48 +0200 Subject: [PATCH 2/4] Use filesize based rotation for telegraf file output With currently set(12h) time based file rotation, it results in files of 500MB. Better to keep the files for debugging lightweight. So setting the max filesize for rotation to 10MB which should still give us atleast last 4-5 hours of data. --- etc/telegraf/telegraf.toml.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/telegraf/telegraf.toml.j2 b/etc/telegraf/telegraf.toml.j2 index 2996d0d05..a400261a1 100644 --- a/etc/telegraf/telegraf.toml.j2 +++ b/etc/telegraf/telegraf.toml.j2 @@ -380,11 +380,11 @@ ## The file will be rotated after the time interval specified. When set ## to 0 no time based rotation is performed. - rotation_interval = "12h" + # rotation_interval = "12h" ## The logfile will be rotated when it becomes larger than the specified ## size. When set to 0 no size based rotation is performed. - # rotation_max_size = "0MB" + rotation_max_size = "10MB" ## Maximum number of rotated archives to keep, any older logs are deleted. ## If set to -1, no archives are removed. From 9a6c7cd95acfdfa69a8d1f442cec213c9b2b7706 Mon Sep 17 00:00:00 2001 From: Matheus Svolenski Date: Tue, 2 May 2023 09:19:39 -0300 Subject: [PATCH 3/4] fix regression while adding the health diagnosis on failure (#628) health["diagnosis"] is expected to return a string, but due to incorrect replacement, it started returning a tuple, which breaks other services that depend on this value. Co-authored-by: Matheus Svolenski --- buildpack/telemetry/metrics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildpack/telemetry/metrics.py b/buildpack/telemetry/metrics.py index 224ae25e6..f589dc5fb 100644 --- a/buildpack/telemetry/metrics.py +++ b/buildpack/telemetry/metrics.py @@ -352,8 +352,8 @@ def _inject_health(self, stats): else: health["health"] = translation["critical"] health["diagnosis"] = ( - "Health check failed unexpectedly: %s", - health_response.get_error(), + "Health check failed unexpectedly: " + f"{health_response.get_error()}" ) else: feedback = health_response.get_feedback() @@ -365,7 +365,7 @@ def _inject_health(self, stats): except Exception as exc: logging.warning("Metrics: Failed to get health status %s", str(exc)) health["health"] = translation["critical"] - health["diagnosis"] = "Health check failed unexpectedly: %s", exc + health["diagnosis"] = f"Health check failed unexpectedly: {exc}" return stats @staticmethod From cda2248ffc3f5dfe76d60adfb9c3a1036b4f004b Mon Sep 17 00:00:00 2001 From: Joey den Broeder Date: Wed, 3 May 2023 11:57:51 +0200 Subject: [PATCH 4/4] Bump Java versions Though this doesn't resolve in Python 3.10 testing, it's still a good addition --- dependencies.yml | 4 ++-- tests/unit/test_java_tls10_11.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.yml b/dependencies.yml index 4fc0c9578..a9e0583c9 100644 --- a/dependencies.yml +++ b/dependencies.yml @@ -49,8 +49,8 @@ dependencies: - jdk vendor: Adoptium version: - - "8": 8u332 - - "11": 11.0.16 + - "8": 8u372 + - "11": 11.0.18 logs: mendix-logfilter: artifact: logs/mendix-logfilter-{{version}}.tar.gz diff --git a/tests/unit/test_java_tls10_11.py b/tests/unit/test_java_tls10_11.py index 7acd140fb..45b66e1f0 100644 --- a/tests/unit/test_java_tls10_11.py +++ b/tests/unit/test_java_tls10_11.py @@ -90,7 +90,7 @@ def test_security_properties_file(self): MAJOR_VERSION_TEST_CASES = [ ("8", 8), ("1.8.0", 8), - ("8u332", 8), + ("8u372", 8), ("11", 11), ("11.0.15", 11), ("7", ""),