Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sc-119944] add logging query to monitor #98

Merged
merged 4 commits into from
Jan 27, 2025

Conversation

sophia-hanley
Copy link
Contributor

@sophia-hanley sophia-hanley commented Jan 16, 2025

@sophia-hanley sophia-hanley force-pushed the sophia/update-logging-monitor-query branch from 925c6cf to 3e26bb4 Compare January 16, 2025 21:14
@sophia-hanley sophia-hanley changed the title add logging query to monitor [sc-119944] add logging query to monitor Jan 16, 2025
@sophia-hanley sophia-hanley marked this pull request as ready for review January 16, 2025 21:22
@sophia-hanley sophia-hanley requested a review from a team as a code owner January 16, 2025 21:22
@sophia-hanley
Copy link
Contributor Author

@sophia-hanley sophia-hanley force-pushed the sophia/update-logging-monitor-query branch 3 times, most recently from 7ac25a8 to c29b210 Compare January 23, 2025 22:52
@sophia-hanley sophia-hanley force-pushed the sophia/update-logging-monitor-query branch from c29b210 to 7296d0d Compare January 23, 2025 23:42
CHANGELOG.md Outdated
@@ -2,6 +2,9 @@

## Unreleased

## 1.6.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we typically set the version as part of releasing, depending on what changes. since this is a new feature, we will want to bump the minor.

Suggested change
## 1.6.3

CHANGELOG.md Outdated
@@ -2,6 +2,9 @@

## Unreleased

## 1.6.3
- Implemented support for logging query in the `monitorv1` resource.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Implemented support for logging query in the `monitorv1` resource.
Added:
- Implemented support for logging query in the `chronosphere_monitor` resource.

@@ -55,3 +55,59 @@ resource "chronosphere_monitor" "monitor_with_signal" {
}
}
}

resource "chronosphere_monitor" "monitor_with_logging_query" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer if this was in a new directory, examples/monitor-logging, as the goal isn't to test monitor with signals but logging queries

Comment on lines 67 to 112
signal_grouping {
label_names = ["kubernetes_namespace"]
}
series_conditions {
condition {
severity = "warn"
value = 20
op = "GT"
}

override {
label_matcher {
name = "app"
type = "EXACT_MATCHER_TYPE"
value = "dbmon"
}

condition {
severity = "critical"
value = 1.0
op = "GT"
sustain = "60s"
resolve_sustain = "30s"
}
}
}

labels = {
"team" = "my team"
}
annotations = {
"runbook" = "go/runbook"
}

schedule {
timezone = "UTC"

dynamic "range" {
for_each = toset(["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"])
content {
day = range.key
start = "07:00"
end = "20:00"
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strip down the monitor to a minimal config since goal is to test logging queries

Suggested change
signal_grouping {
label_names = ["kubernetes_namespace"]
}
series_conditions {
condition {
severity = "warn"
value = 20
op = "GT"
}
override {
label_matcher {
name = "app"
type = "EXACT_MATCHER_TYPE"
value = "dbmon"
}
condition {
severity = "critical"
value = 1.0
op = "GT"
sustain = "60s"
resolve_sustain = "30s"
}
}
}
labels = {
"team" = "my team"
}
annotations = {
"runbook" = "go/runbook"
}
schedule {
timezone = "UTC"
dynamic "range" {
for_each = toset(["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"])
content {
day = range.key
start = "07:00"
end = "20:00"
}
}
}
series_conditions {
condition {
severity = "warn"
value = 20
op = "GT"
}
}

@sophia-hanley sophia-hanley force-pushed the sophia/update-logging-monitor-query branch 3 times, most recently from e4ba72a to e5f2c43 Compare January 24, 2025 22:48
@sophia-hanley sophia-hanley force-pushed the sophia/update-logging-monitor-query branch 2 times, most recently from 8837c4c to 724e4aa Compare January 27, 2025 20:57
@sophia-hanley sophia-hanley force-pushed the sophia/update-logging-monitor-query branch from 724e4aa to 6070677 Compare January 27, 2025 21:12
@sophia-hanley sophia-hanley merged commit b25feef into main Jan 27, 2025
2 checks passed
@sophia-hanley sophia-hanley deleted the sophia/update-logging-monitor-query branch January 27, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants