Skip to content

Commit

Permalink
filter: Add more flag to distinguish searching targets
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Feb 20, 2024
1 parent 46d88ac commit 3f0776f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/cmetrics/cmt_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
#include <cmetrics/cmetrics.h>
#include <cmetrics/cmt_cat.h>

#define CMT_FILTER_EXCLUDE (1 << 1)
#define CMT_FILTER_PREFIX (1 << 2)
#define CMT_FILTER_SUBSTRING (1 << 3)
#define CMT_FILTER_EXCLUDE (1 << 1)
#define CMT_FILTER_PREFIX (1 << 2)
#define CMT_FILTER_SUBSTRING (1 << 3)
#define CMT_FILTER_REGEX_SEARCH_LABELS (1 << 4)

#define CMT_FILTER_SUCCESS 0
#define CMT_FILTER_INVALID_ARGUMENT -1
Expand Down
1 change: 1 addition & 0 deletions src/cmt_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ int cmt_filter(struct cmt *dst, struct cmt *src,
return CMT_FILTER_FAILED_OPERATION;
}

/* On callback mode, labels are not searched by default. */
if (label_key != NULL || (compare_ctx != NULL && compare != NULL)) {
ret = filter_context_label_key(dst, src, label_key, compare_ctx, compare, flags);
}
Expand Down

0 comments on commit 3f0776f

Please sign in to comment.