From cbbf97ac125f94892741e8365ba9f621486995d7 Mon Sep 17 00:00:00 2001 From: Alexander Dejanovski Date: Wed, 11 Oct 2023 09:15:34 +0200 Subject: [PATCH] address review comments --- .../cluster-scoped/kustomization.yaml | 2 ++ config/cass-operator/ns-scoped/kustomization.yaml | 2 ++ docs/content/en/tasks/monitor/vector/_index.md | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config/cass-operator/cluster-scoped/kustomization.yaml b/config/cass-operator/cluster-scoped/kustomization.yaml index 7d1e7ddd1..e1be4ca2d 100644 --- a/config/cass-operator/cluster-scoped/kustomization.yaml +++ b/config/cass-operator/cluster-scoped/kustomization.yaml @@ -7,6 +7,8 @@ resources: components: - ../../components/cass-operator-image-config +# TODO: remove these image changes before release so that they don't pull a dev release of cass-operator. +# This is required when a new feature of cass-operator is needed that is not yet released. images: - name: k8ssandra/cass-operator newTag: v1.18.0-dev.34e2ae6-20231002 \ No newline at end of file diff --git a/config/cass-operator/ns-scoped/kustomization.yaml b/config/cass-operator/ns-scoped/kustomization.yaml index 44ce7a292..137baddbc 100644 --- a/config/cass-operator/ns-scoped/kustomization.yaml +++ b/config/cass-operator/ns-scoped/kustomization.yaml @@ -7,6 +7,8 @@ resources: components: - ../../components/cass-operator-image-config +# TODO: remove these image changes before release so that they don't pull a dev release of cass-operator. +# This is required when a new feature of cass-operator is needed that is not yet released. images: - name: k8ssandra/cass-operator newTag: v1.18.0-dev.34e2ae6-20231002 \ No newline at end of file diff --git a/docs/content/en/tasks/monitor/vector/_index.md b/docs/content/en/tasks/monitor/vector/_index.md index 5ff19a309..c93713aab 100644 --- a/docs/content/en/tasks/monitor/vector/_index.md +++ b/docs/content/en/tasks/monitor/vector/_index.md @@ -49,11 +49,18 @@ condition_pattern = "^(INFO|WARN|ERROR|DEBUG|TRACE|FATAL)" mode = "halt_before" timeout_ms = 10000 +[transforms.parse_cassandra_log] +type = "remap" +inputs = [ "systemlog" ] +source = ''' +del(.source_type) +. |= parse_groks!(.message, patterns: [ + "%{LOGLEVEL:loglevel}\\s+\\[(?((.+)))\\]\\s+%{TIMESTAMP_ISO8601:timestamp}\\s+%{JAVACLASS:class}:%{NUMBER:line}\\s+-\\s+(?(.+\\n?)+)", [sources.cassandra_metrics_raw] type = "prometheus_scrape" -endpoints = [ "http://localhost:9103" ] -scrape_interval_secs = 30 +endpoints = [ "http://localhost:{{ .ScrapePort }}" ] +scrape_interval_secs = {{ .ScrapeInterval }} [transforms.cassandra_metrics] type = "remap" @@ -99,6 +106,9 @@ They can be used as input in custom components added through configuration. `systemlog` input is defined as the default source for Cassandra logs. +We provide the `parse_cassandra_log` transform out of the box because it's likely to be a common need for users who ship the logs to a remote system such as Grafana Loki; however by default we don't use it and will be filtered out unless it's referenced by a custom transform/sink. +This transform will parse the Cassandra logs and extract the log level, thread, timestamp, class, line and message fields. It will also remove the `source_type` field which is added by the `systemlog` source. + ## Custom Vector configuration To customize the Vector configuration, you can add [sources](https://vector.dev/docs/reference/configuration/sources/), [transforms](https://vector.dev/docs/reference/configuration/transforms/) and [sinks](https://vector.dev/docs/reference/configuration/sinks/) in a semi-structured way under `.spec.cassandra.telemetry.vector.components`, `.spec.reaper.telemetry.vector.components` and `.spec.stargate.telemetry.vector.components`: