Skip to content

in_process_exporter_metrics: Expire metrics for dead processes#11760

Open
piwai wants to merge 2 commits intofluent:masterfrom
piwai:fix-issue-9547
Open

in_process_exporter_metrics: Expire metrics for dead processes#11760
piwai wants to merge 2 commits intofluent:masterfrom
piwai:fix-issue-9547

Conversation

@piwai
Copy link
Copy Markdown
Contributor

@piwai piwai commented Apr 29, 2026

This add a generic expiration mechanism in cmetrics with cmt_expire(), based on a timestamp. This avoids publishing prometheus metrics for process which are not running anymore on the host.
Uses timestamp based comparison, and removes any metrics with timestamp older than the last collection.

Fixes #9547

Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • [N/A] Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • Bug Fixes

    • Purges stale process and thread metrics when entities are not observed during a scan, improving metric accuracy.
    • Prevents unsafe deletions when activity detection is incomplete.
  • Improvements

    • Adds a timestamp-based metric expiration mechanism to enable safe cleanup of orphaned label-sets.
    • More reliable gated purging to remove orphaned metrics only after tracking is complete.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 79d80b17-30e0-412d-b844-18a3841744ea

📥 Commits

Reviewing files that changed from the base of the PR and between 2f523c4 and 40a4296.

📒 Files selected for processing (3)
  • lib/cmetrics/include/cmetrics/cmetrics.h
  • lib/cmetrics/src/cmetrics.c
  • plugins/in_process_exporter_metrics/pe_process.c
✅ Files skipped from review due to trivial changes (1)
  • plugins/in_process_exporter_metrics/pe_process.c
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/cmetrics/include/cmetrics/cmetrics.h
  • lib/cmetrics/src/cmetrics.c

📝 Walkthrough

Walkthrough

Adds a cmetrics API to expire stale dynamic label-set metrics by timestamp and invokes it from the process exporter plugin after each /proc scan to remove metrics for processes/threads not observed during that collection pass.

Changes

Cmetrics: expiration API

Layer / File(s) Summary
Headers / API
lib/cmetrics/include/cmetrics/cmetrics.h
Declares int cmt_expire(struct cmt *cmt, uint64_t min_timestamp);.
Core Implementation
lib/cmetrics/src/cmetrics.c, .../cmt_map.h, .../cmt_metric.h
Implements cmt_expire and helper cmt_expire_map, iterating all metric maps (counters, gauges, summaries, histograms, exp_histograms, untypeds) and removing struct cmt_metric entries with timestamp < min_timestamp; returns total purged count.
Tests / Documentation
(none in this diff)
No tests or docs updated.

Process exporter: expire after scan

Layer / File(s) Summary
Scan timestamp capture / comment
plugins/in_process_exporter_metrics/pe_process.c
After finishing the /proc scan and destroying procfs_list, adds comment and retains the scan timestamp variable ts used for expiration semantics.
Wiring / Integration
plugins/in_process_exporter_metrics/pe_process.c
Calls cmt_expire(ctx->cmt, ts) to purge metric label-sets older than the current collection timestamp.
Tests / Documentation
(none in this diff)
No tests or docs updated.

Sequence Diagram(s)

sequenceDiagram
    participant Scanner as Process Scanner (plugin)
    participant Cmetrics as Cmetrics Library
    participant Metrics as Dynamic Metric Entries

    rect rgba(200,200,255,0.5)
    Scanner->>Scanner: scan /proc, record scan timestamp (ts)
    end

    rect rgba(200,255,200,0.5)
    Scanner->>Cmetrics: call cmt_expire(ctx->cmt, ts)
    end

    rect rgba(255,200,200,0.5)
    Cmetrics->>Metrics: iterate metric collections (counters,gauges,...)
    Cmetrics->>Metrics: remove entries with timestamp < ts
    Cmetrics-->>Scanner: return purge count
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • edsiper
  • cosmo0920

Poem

🐰 I hopped through proc and marked the day,

whiskers twitching at each fleeting thread,
swept old footprints silently away,
counted only those still warm and fed,
nibbled a carrot, then slept in my bed.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'in_process_exporter_metrics: Expire metrics for dead processes' directly describes the main change in the PR.
Linked Issues check ✅ Passed The PR implements the primary objective from issue #9547 by adding timestamp-based metric expiration via cmt_expire() to remove stale process metrics.
Out of Scope Changes check ✅ Passed All code changes are directly related to implementing the metric expiration mechanism: the public API declaration, the implementation, and the integration into process collection.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@piwai
Copy link
Copy Markdown
Contributor Author

piwai commented Apr 29, 2026

Here's the request valgrind log
(EDIT: updated after rework)
valgrind-new.log

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99f12369f0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread plugins/in_process_exporter_metrics/pe_process.c Outdated
Comment thread plugins/in_process_exporter_metrics/pe_process.c Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/in_process_exporter_metrics/pe_process.c`:
- Around line 946-967: The purge_stale_metrics function currently checks only
PID/TID via get_metric_label_value against active_ids, which allows stale series
to survive on ID reuse; update purge_stale_metrics to build a collision-free key
for each metric (for example by concatenating the full label tuple or PID/TID
plus process start time) and use that key when querying flb_hash_table_get
instead of the single id_val so the exact emitted identity is checked before
calling cmt_map_metric_destroy; apply the same change to the equivalent logic
referenced around the other purge block (the similar code at the later section)
so both places use the full-label or start-time-based key.
- Line 524: flb_hash_table_add calls that populate
active_tids/active_pids/active_fds must not be ignored — check each
flb_hash_table_add return value and treat a failure as a fatal error for this
collection pass: on add failure, log a descriptive error (including the
tid/pid/fd value), set a flag like index_complete = false (or return an error
code) and skip the end-of-pass purge; alternatively return early from the
collection function so purge code does not run. Update every insertion site that
uses flb_hash_table_add (references: active_tids, active_pids, active_fds) to
perform this check and ensure the purge path is gated by index_complete or
skipped when an insertion failed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c226035-2a3c-4f70-b7f7-44e2c70a3119

📥 Commits

Reviewing files that changed from the base of the PR and between 230eb3c and 99f1236.

📒 Files selected for processing (1)
  • plugins/in_process_exporter_metrics/pe_process.c

Comment thread plugins/in_process_exporter_metrics/pe_process.c Outdated
Comment thread plugins/in_process_exporter_metrics/pe_process.c Outdated
@edsiper
Copy link
Copy Markdown
Member

edsiper commented Apr 30, 2026

@piwai thanks for this contribution. Pls check the reviews provided by the Ai agent

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
plugins/in_process_exporter_metrics/pe_process.c (1)

526-533: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

name:id is still not a collision-free liveness key.

The purge now matches on name + pid/tid, but several maps distinguish series by more than that (ppid for process series, threadname for thread series). If an ID is reused for another process/thread with the same name before the next scrape, the lookup still hits and the old ppid/threadname series survives. That means stale series can still accumulate under reuse-heavy workloads.

Please purge against the exact emitted identity for each map, or another collision-free identity such as start time.

Also applies to: 955-983, 1099-1106, 1267-1286

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/in_process_exporter_metrics/pe_process.c` around lines 526 - 533, The
current liveness key built in the active_tids purge (created via
flb_sds_create(name) + ":" + tid_str and added with
flb_hash_table_add(active_tids, active_key, ...)) is not collision-free because
it omits other identity fields (e.g., ppid for process maps, threadname for
thread maps); update the key construction wherever you see this pattern (the
active_key + flb_hash_table_add calls in this file) to include the exact emitted
identity used when the series is created—either append ppid or threadname (or
the process start time) to the key so the purge matches the full emitted
identity, and apply the same fix to the other similar blocks that build
active_key before calling flb_hash_table_add.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/in_process_exporter_metrics/pe_process.c`:
- Around line 1244-1247: When process_thread_update(ctx, ts, pid_str, name,
active_tids, &active_index_complete) returns -1 you must mark the active-index
gate invalid so the purge doesn't remove live thread metrics; update the caller
to set active_index_complete = false (or otherwise invalidate the purge gate)
immediately in the error branch where ret == -1. Apply the same change to the
other failing path referenced (the similar block around the 1265-1289 range) so
both failure paths for process_thread_update() invalidate active_index_complete
when thread enumeration fails.

---

Duplicate comments:
In `@plugins/in_process_exporter_metrics/pe_process.c`:
- Around line 526-533: The current liveness key built in the active_tids purge
(created via flb_sds_create(name) + ":" + tid_str and added with
flb_hash_table_add(active_tids, active_key, ...)) is not collision-free because
it omits other identity fields (e.g., ppid for process maps, threadname for
thread maps); update the key construction wherever you see this pattern (the
active_key + flb_hash_table_add calls in this file) to include the exact emitted
identity used when the series is created—either append ppid or threadname (or
the process start time) to the key so the purge matches the full emitted
identity, and apply the same fix to the other similar blocks that build
active_key before calling flb_hash_table_add.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6fb43019-e2d2-4ca2-b95c-1fa47e7631c9

📥 Commits

Reviewing files that changed from the base of the PR and between 99f1236 and 2703513.

📒 Files selected for processing (1)
  • plugins/in_process_exporter_metrics/pe_process.c

Comment thread plugins/in_process_exporter_metrics/pe_process.c Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/in_process_exporter_metrics/pe_process.c`:
- Around line 526-533: The SDS key construction code using flb_sds_create and
flb_sds_cat_safe must check for allocation/appending failure before calling
flb_sds_len or flb_hash_table_add; update the block that builds active_key to
validate that flb_sds_create returned non-NULL and that each flb_sds_cat_safe
succeeded, and if any step fails set *active_index_complete = FLB_FALSE, avoid
calling flb_sds_len or flb_hash_table_add with a NULL key, free/destroy any
partially created SDS via flb_sds_destroy if non-NULL, and return/continue as
appropriate; apply the same defensive checks to the other SDS key construction
sites (the analogous blocks around lines 976-983 and 1099-1106) to prevent NULL
dereference in flb_sds_len or hash operations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fbc9fa0c-f17d-49f5-8780-04c410d91e63

📥 Commits

Reviewing files that changed from the base of the PR and between 2703513 and 5088c86.

📒 Files selected for processing (1)
  • plugins/in_process_exporter_metrics/pe_process.c

Comment thread plugins/in_process_exporter_metrics/pe_process.c Outdated
Copy link
Copy Markdown
Contributor

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

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

This is really interesting and prominent idea!
But we don't want to touch the internal structure of cmetrics from Fluent Bit's plugins as much as possible. So, could you try to implement this kind of feature inside of cmetrics if possible?
We're also seeking an opportunity to purge stale metrics in some ways but currently not succeeded yet.

@piwai
Copy link
Copy Markdown
Contributor Author

piwai commented Apr 30, 2026

@cosmo0920 thanks a lot for the review!
Just to be sure I've understood correctly, and to avoid other rounds of rework, the new implementation could be something like: removing the purge_stale_metric() function in ne_process, and having a more generic function in lib/cmetrics/ like "cmt_expire()", which would manipulate the cmetrics structs and maybe have some kind of callback parameter for the expiration criteria, which would need to be implemented per module (e.g for ne_process would be checking if they are still alive)?
Other question, do you have any example of other locations were metrics are not expired?

@cosmo0920
Copy link
Copy Markdown
Contributor

cosmo0920 commented May 1, 2026

Just to be sure I've understood correctly, and to avoid other rounds of rework, the new implementation could be something like: removing the purge_stale_metric() function in ne_process, and having a more generic function in lib/cmetrics/ like "cmt_expire()", which would manipulate the cmetrics structs and maybe have some kind of callback parameter for the expiration criteria, which would need to be implemented per module (e.g for ne_process would be checking if they are still alive)?

Yup, implementing cmt_expire() or similar function to provide expiring metrics.

Other question, do you have any example of other locations were metrics are not expired?

We're also suffering for out of date issue of stale metrics in out_prometheus_remote_write or out_prometheus_expoter.
So, we really wanted to mitigate this issue.

@piwai
Copy link
Copy Markdown
Contributor Author

piwai commented May 4, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
lib/cmetrics/src/cmetrics.c (1)

185-249: ⚡ Quick win

Consider extracting the repeated inner-loop body into a static helper.

The purge-by-timestamp inner loop is copy-pasted verbatim six times; the only difference is which struct cmt_* type is unpacked from the outer list. Extracting it removes ~60 lines, eliminates any future drift if the expiry predicate changes (e.g., adding a callback or a minimum count guard), and makes cmt_expire itself much easier to read.

♻️ Proposed refactor

Add a static helper above cmt_expire:

static int expire_map_metrics(struct cmt_map *map, uint64_t min_timestamp)
{
    int count = 0;
    struct cfl_list *mhead;
    struct cfl_list *mtmp;
    struct cmt_metric *metric;

    cfl_list_foreach_safe(mhead, mtmp, &map->metrics) {
        metric = cfl_list_entry(mhead, struct cmt_metric, _head);
        if (cmt_metric_get_timestamp(metric) < min_timestamp) {
            cmt_map_metric_destroy(metric);
            count++;
        }
    }
    return count;
}

Then simplify cmt_expire:

 int cmt_expire(struct cmt *cmt, uint64_t min_timestamp)
 {
     int count = 0;
     struct cfl_list *head;
     struct cfl_list *tmp;
     struct cmt_counter *c;
     struct cmt_gauge *g;
     struct cmt_summary *s;
     struct cmt_histogram *h;
     struct cmt_exp_histogram *eh;
     struct cmt_untyped *u;
-    struct cfl_list *mhead;
-    struct cfl_list *mtmp;
-    struct cmt_metric *metric;

-    cfl_list_foreach_safe(head, tmp, &cmt->counters) {
-        c = cfl_list_entry(head, struct cmt_counter, _head);
-        cfl_list_foreach_safe(mhead, mtmp, &c->map->metrics) {
-            metric = cfl_list_entry(mhead, struct cmt_metric, _head);
-            if (cmt_metric_get_timestamp(metric) < min_timestamp) {
-                cmt_map_metric_destroy(metric);
-                count++;
-            }
-        }
-    }
-    /* ... repeated 5 more times ... */
+    cfl_list_foreach_safe(head, tmp, &cmt->counters) {
+        c = cfl_list_entry(head, struct cmt_counter, _head);
+        count += expire_map_metrics(c->map, min_timestamp);
+    }
+    cfl_list_foreach_safe(head, tmp, &cmt->gauges) {
+        g = cfl_list_entry(head, struct cmt_gauge, _head);
+        count += expire_map_metrics(g->map, min_timestamp);
+    }
+    cfl_list_foreach_safe(head, tmp, &cmt->summaries) {
+        s = cfl_list_entry(head, struct cmt_summary, _head);
+        count += expire_map_metrics(s->map, min_timestamp);
+    }
+    cfl_list_foreach_safe(head, tmp, &cmt->histograms) {
+        h = cfl_list_entry(head, struct cmt_histogram, _head);
+        count += expire_map_metrics(h->map, min_timestamp);
+    }
+    cfl_list_foreach_safe(head, tmp, &cmt->exp_histograms) {
+        eh = cfl_list_entry(head, struct cmt_exp_histogram, _head);
+        count += expire_map_metrics(eh->map, min_timestamp);
+    }
+    cfl_list_foreach_safe(head, tmp, &cmt->untypeds) {
+        u = cfl_list_entry(head, struct cmt_untyped, _head);
+        count += expire_map_metrics(u->map, min_timestamp);
+    }

     return count;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/cmetrics/src/cmetrics.c` around lines 185 - 249, The cmt_expire function
repeats the same inner loop for each metric map; add a static helper (e.g.,
expire_map_metrics) that takes struct cmt_map *map and uint64_t min_timestamp,
iterates map->metrics using cfl_list_foreach_safe, checks
cmt_metric_get_timestamp(metric) < min_timestamp, calls
cmt_map_metric_destroy(metric) and counts removals, returning the count; then
replace each duplicated inner loop in cmt_expire (for counters, gauges,
summaries, histograms, exp_histograms, untypeds) with a call to
expire_map_metrics(map, min_timestamp) and accumulate its return value into
count.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@lib/cmetrics/src/cmetrics.c`:
- Around line 185-249: The cmt_expire function repeats the same inner loop for
each metric map; add a static helper (e.g., expire_map_metrics) that takes
struct cmt_map *map and uint64_t min_timestamp, iterates map->metrics using
cfl_list_foreach_safe, checks cmt_metric_get_timestamp(metric) < min_timestamp,
calls cmt_map_metric_destroy(metric) and counts removals, returning the count;
then replace each duplicated inner loop in cmt_expire (for counters, gauges,
summaries, histograms, exp_histograms, untypeds) with a call to
expire_map_metrics(map, min_timestamp) and accumulate its return value into
count.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de6893b7-7d00-4c61-a1e6-b57abf67c6ff

📥 Commits

Reviewing files that changed from the base of the PR and between 0193ad4 and 2f523c4.

📒 Files selected for processing (3)
  • lib/cmetrics/include/cmetrics/cmetrics.h
  • lib/cmetrics/src/cmetrics.c
  • plugins/in_process_exporter_metrics/pe_process.c
✅ Files skipped from review due to trivial changes (1)
  • plugins/in_process_exporter_metrics/pe_process.c

piwai added 2 commits May 4, 2026 12:08
Signed-off-by: Pierre-Yves Rofes <3604235+piwai@users.noreply.github.com>
Signed-off-by: Pierre-Yves Rofes <3604235+piwai@users.noreply.github.com>
@piwai
Copy link
Copy Markdown
Contributor Author

piwai commented May 4, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@piwai
Copy link
Copy Markdown
Contributor Author

piwai commented May 4, 2026

@edsiper I reworked following @cosmo0920 suggestion, it's indeed much simpler and generic. I'm just using the collection timestamp as threshold to expire outdated metrics, so it can be added to other plugins as well.

@cosmo0920
Copy link
Copy Markdown
Contributor

cosmo0920 commented May 4, 2026

Unfortunately, cmetrics is maintained here: https://github.com/fluent/cmetrics

So, we need to address cmetrics issues there.

@piwai
Copy link
Copy Markdown
Contributor Author

piwai commented May 4, 2026

@cosmo0920 ah ok, well when browsing the cmetrics repository I just noticed fluent/cmetrics#246 which does almost exactly the same thing than I did, actually even more complete than mine with unit tests and all. Not sure how to proceed here, should we ping the author to try to update the branch and merge his PR first, then I can update this one with only the call to cmt_expire() in node_exporter plugin?

@cosmo0920
Copy link
Copy Markdown
Contributor

@cosmo0920 ah ok, well when browsing the cmetrics repository I just noticed fluent/cmetrics#246 which does almost exactly the same thing than I did, actually even more complete than mine with unit tests and all. Not sure how to proceed here, should we ping the author to try to update the branch and merge his PR first, then I can update this one with only the call to cmt_expire() in node_exporter plugin?

We can take over @pwhelan's work in cmetrics repository. In his work, it's also included unit testing in C so we also needed to add unit testing for expiring cmetics' metrics.

@pwhelan
Copy link
Copy Markdown
Contributor

pwhelan commented May 4, 2026

I rebased my PR and tests have passed. ping me if you need anything else to get it merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

process_exporter input plugin does not handle dead processes

4 participants