Skip to content

Commit

Permalink
Marked charts exposed when labels change
Browse files Browse the repository at this point in the history
  • Loading branch information
stelfrag authored and tkatsoulas committed Oct 30, 2023
1 parent 240f9e7 commit 750ca8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions collectors/systemd-journal.plugin/systemd-journal.c
Expand Up @@ -647,7 +647,7 @@ static bool netdata_systemd_filtering_by_journal(sd_journal *j, FACETS *facets,
size_t failures = 0;
size_t filters_added = 0;

SD_JOURNAL_FOREACH_FIELD(j, field) {
SD_JOURNAL_FOREACH_FIELD(j, field) { // for each key
bool interesting;

if(fqs->data_only)
Expand All @@ -660,7 +660,7 @@ static bool netdata_systemd_filtering_by_journal(sd_journal *j, FACETS *facets,
bool added_this_key = false;
size_t added_values = 0;

SD_JOURNAL_FOREACH_UNIQUE(j, data, data_length) {
SD_JOURNAL_FOREACH_UNIQUE(j, data, data_length) { // for each value of the key
const char *key, *value;
size_t key_length, value_length;

Expand All @@ -673,19 +673,24 @@ static bool netdata_systemd_filtering_by_journal(sd_journal *j, FACETS *facets,
continue;

if(added_keys && !added_this_key) {
if(sd_journal_add_conjunction(j) < 0)
if(sd_journal_add_conjunction(j) < 0) // key AND key AND key
failures++;

added_this_key = true;
added_keys++;
}
else if(added_values)
if(sd_journal_add_disjunction(j) < 0)
if(sd_journal_add_disjunction(j) < 0) // value OR value OR value
failures++;

if(sd_journal_add_match(j, data, data_length) < 0)
failures++;

if(!added_keys) {
added_keys++;
added_this_key = true;
}

added_values++;
filters_added++;
}
Expand Down
1 change: 1 addition & 0 deletions database/rrdset.c
Expand Up @@ -389,6 +389,7 @@ static void rrdset_react_callback(const DICTIONARY_ITEM *item __maybe_unused, vo
}
rrdset_flag_set(st, RRDSET_FLAG_METADATA_UPDATE);
rrdhost_flag_set(st->rrdhost, RRDHOST_FLAG_METADATA_UPDATE);
rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
}

rrdcontext_updated_rrdset(st);
Expand Down

0 comments on commit 750ca8e

Please sign in to comment.