From 97921cc21a10aa99a645be1c6590e12f1dc6f24a Mon Sep 17 00:00:00 2001 From: Mike Schiessl <77062930+MikeSchiessl@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:17:01 +0200 Subject: [PATCH] v1.8.1 (#68) ## v1.8.1 ||| |---|---| |Date|2024-08-28 |Kind| MINOR release |Author|mschiess@akamai.com --- bin/modules/UlsMonitoring.py | 9 ++++++--- bin/uls_config/global_config.py | 4 ++-- docs/CHANGELOG.md | 14 ++++++++++++-- .../kubernetes/helm/akamai-uls/Chart.yaml | 2 +- test/basic_test.bats | 2 +- test/positive_test.bats | 17 +++++++++++++++++ 6 files changed, 39 insertions(+), 9 deletions(-) diff --git a/bin/modules/UlsMonitoring.py b/bin/modules/UlsMonitoring.py index 5a1f4f3..981d556 100644 --- a/bin/modules/UlsMonitoring.py +++ b/bin/modules/UlsMonitoring.py @@ -165,13 +165,16 @@ def increase_message_count(self, bytes=0): self.window_messages_bytes += bytes # Also increase the prom counters - self.prom_overall_messages.inc() - self.prom_overall_bytes.inc(bytes) + if self.prometheues_enabled: + self.prom_overall_messages.inc() + self.prom_overall_bytes.inc(bytes) def increase_message_ingested(self): with self._metricLock: self.window_messages_ingested += 1 - self.prom_overall_messages_ingested.inc() + + if self.prometheues_enabled: + self.prom_overall_messages_ingested.inc() def get_message_count(self): diff --git a/bin/uls_config/global_config.py b/bin/uls_config/global_config.py index ad59977..a53626d 100644 --- a/bin/uls_config/global_config.py +++ b/bin/uls_config/global_config.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # Common global variables / constants -__version__ = "1.8.0-alpha" +__version__ = "1.8.0" __tool_name_long__ = "Akamai Unified Log Streamer" __tool_name_short__ = "ULS" @@ -118,7 +118,7 @@ callhome_timeout = "2" # Callhome Timeout in seconds # Prometheus Monitoring basics -prometheus_enabled = "False" # Do not eneable prometheues by default +prometheus_enabled = False # Do not eneable prometheues by default prometheus_port = 8000 # Default Prometheus port prometheus_addr = "127.0.0.1" # Default Prometheus bind address prometheus_certfile = None # Prometheus Cert file diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 0076cf9..d26b441 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,12 +1,22 @@ # Version History -## v1.8.0 +## v1.8.1 ||| |---|---| -|Date|2024-XX-XX +|Date|2024-08-28 |Kind| MINOR release |Author|mschiess@akamai.com +- **Bugfixes** + - Merged a missing fix from the development branch + +## v1.8.0 +||| +|---|---| +|Date|2024-08-27 +|Kind| MAJOR release +|Author|mschiess@akamai.com + - **Features** - Prometheus monitoring support added to allow smoother monitoring into third party (prometheus compatible) monitoring sytems. More information [here](MONITORING.md#prometheus) - CallHome (opt-out) function to enable the ULS team to collect anonymous statistics & usage information - more information [here](./FAQ.md#i-do-not-want-to-send-any-data-to-akamai) diff --git a/docs/examples/kubernetes/helm/akamai-uls/Chart.yaml b/docs/examples/kubernetes/helm/akamai-uls/Chart.yaml index 2811960..6413bd4 100644 --- a/docs/examples/kubernetes/helm/akamai-uls/Chart.yaml +++ b/docs/examples/kubernetes/helm/akamai-uls/Chart.yaml @@ -4,4 +4,4 @@ description: Akamai Universal Log Streamer Helm installation type: application version: 2.0.0 -appVersion: "1.7.5" +appVersion: "1.8.0" diff --git a/test/basic_test.bats b/test/basic_test.bats index 7da9620..b15ded0 100644 --- a/test/basic_test.bats +++ b/test/basic_test.bats @@ -40,7 +40,7 @@ current_version=$(cat docs/CHANGELOG.md | grep "##" | head -n 1 | sed 's/.* v//' @test "uls.py --loglevel debug" { run $uls_bin --loglevel debug - assert_output --partial "ULS D Logging initialized" + assert_output --partial "ULS DEBUG Logging initialized" [ "$status" -eq 1 ] } diff --git a/test/positive_test.bats b/test/positive_test.bats index 89912d4..84a05e7 100644 --- a/test/positive_test.bats +++ b/test/positive_test.bats @@ -276,6 +276,23 @@ load 'bats/bats-assert/load.bash' unset BATS_VAR } +## JSON LOGGING +@test "JSON Logging test - unmodified logline" { + run timeout 5 ${uls_bin} --section ${uls_section} --input etp --feed dns --output raw --loglevel debug --json-log + assert_output --partial '"log_level": "DEBUG", "component": "ULS", "message": "UlsMonitoring monitoring thread started..."' +} + +@test "JSON Logging test - modified logline" { + run timeout 5 ${uls_bin} --section ${uls_section} --input etp --feed dns --output raw --loglevel debug --json-log --ulslogformat '{"timestamp": "%(asctime)s", "log_level": "%(levelname)s", "component": "%(name)s", "message": "%(message)s", "ulsrocks": "yes"}' + assert_output --partial '"log_level": "DEBUG", "component": "ULS", "message": "UlsMonitoring monitoring thread started...", "ulsrocks": "yes"' +} + +## Prometheus +@test "PROMETHEUS - starting test" { + run timeout 5 ${uls_bin} --section ${uls_section} --input etp --feed dns --output raw --loglevel debug --prometheus + assert_output --partial 'DEBUG UlsMonitoring Prometheus monitoring started...' +} + ## HELM LINT @test "LINT the HELM CHART" { run helm lint docs/examples/kubernetes/helm/akamai-uls --strict