Files
openobserve/deploy
udev 7cca606f16 feat: add metrics to count wal files in ingester (#7898)
### **PR Type**
Enhancement

other changes:
- change default of batch exporter to false
- update gitignore
___

### **Description**
- Add WAL file count gauge metric

- Implement and register collect_wal_metrics

- Invoke WAL metrics in job loop

- Disable batching exporter by default


___

### Diagram Walkthrough


```mermaid
flowchart LR
  WRITERS["In-memory writers"]
  IMMUTABLES["Rotated immutables"]
  COLLECT["collect_wal_metrics()"]
  METRIC["INGEST_WAL_FILES gauge"]
  JOB["job::update_wal_metrics()"]
  WRITERS -- "active WAL files" --> COLLECT
  IMMUTABLES -- "rotated WAL files" --> COLLECT
  COLLECT -- "set metric" --> METRIC
  JOB -- "calls" --> COLLECT
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>config.rs</strong><dd><code>Disable pipeline batch
exporter by default</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

src/config/src/config.rs

- Changed `ZO_PIPELINE_BATCH_ENABLED` default to false


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7898/files#diff-9aeee4a74c0520daa40f9b81c7016f5b6b3254375b968dd7598e745630980d62">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>metrics.rs</strong><dd><code>Add and register WAL files
metric</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/config/src/metrics.rs

<ul><li>Added <code>INGEST_WAL_FILES</code> gauge metric<br> <li>
Registered metric in registry</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7898/files#diff-950d37bdd77aa533539acd818a3fcdebd90ccb1f09acb5490b9c0f9b51cb2090">+15/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>immutable.rs</strong><dd><code>Expose get_key on
Immutable</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

src/ingester/src/immutable.rs

- Added `Immutable::get_key()` accessor


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7898/files#diff-eee941ce73df39e37edae4a98ba3ca679f2c61592ad3e5afa47eb7793c9b0410">+4/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>lib.rs</strong><dd><code>Expose collect_wal_metrics in
lib</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/ingester/src/lib.rs

- Re-exported `collect_wal_metrics` in public API


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7898/files#diff-603267e2f712eeb4bc46fdff981f1fad1f3a9d3b989a7db4b3c0984fc5b1ed43">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>writer.rs</strong><dd><code>Implement
collect_wal_metrics in writer</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/ingester/src/writer.rs

<ul><li>Implemented <code>collect_wal_metrics()</code> function<br> <li>
Counts active and rotated WAL files<br> <li> Updates
<code>INGEST_WAL_FILES</code> metric</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7898/files#diff-d1a9b1542cc2758afe4fa67abd454dd818718f4e1c7570303519af5a58d6301f">+38/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>metrics.rs</strong><dd><code>Integrate WAL metrics in
job loop</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/job/metrics.rs

<ul><li>Added <code>update_wal_metrics()</code> function<br> <li>
Invoked WAL metrics in job loop when ingester</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7898/files#diff-ca98d90d1293682c98c33a777a653cf3c1466f6297969ae94a359bb81abca4b1">+13/-0</a>&nbsp;
&nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___
2025-08-10 22:33:30 +05:30
..