Phase 1: Implement exact name filtering for service matching

Change service matching logic from contains-based to exact equality.
Services now match only if service_name == pattern exactly.
This is the first step in the systemd collector optimization plan.
This commit is contained in:
Christoffer Martinsson 2025-10-23 12:22:26 +02:00
parent 7bb5c1cf84
commit 616fad2c5d

View File

@ -253,7 +253,7 @@ impl SystemdCollector {
// Check if this service matches our filter patterns
for pattern in service_name_filters {
if service_name.contains(pattern) || pattern.contains(service_name) {
if service_name == pattern {
debug!(
"INCLUDING service '{}' because it matches pattern '{}'",
service_name, pattern