Skip to content

Update kv metrics and refactor glog init#325

Merged
lzxddz merged 2 commits intoeloqdata:mainfrom
lzxddz:update-kv-metrics
Nov 24, 2025
Merged

Update kv metrics and refactor glog init#325
lzxddz merged 2 commits intoeloqdata:mainfrom
lzxddz:update-kv-metrics

Conversation

@lzxddz
Copy link
Copy Markdown
Collaborator

@lzxddz lzxddz commented Nov 20, 2025

Summary by CodeRabbit

  • New Features

    • KV-level metrics flag added and enabled by default.
  • Chores

    • Central metrics collection disabled in multiple deployment configs; many per-metric toggles removed.
    • Added deployment parameters to disable logical session cache refresh and to disable TTL monitor in some configs.
    • Logging initialization and shutdown refined with improved formatting and destination handling.
    • CI scripts ensure a workspace directory exists and add workspace symlinks.

✏️ Tip: You can customize this high-level summary in your review settings.

@lzxddz lzxddz self-assigned this Nov 20, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Disabled per-metric telemetry in multiple eloqdoc configs; added public flag enableKVMetrics to EloqGlobalOptions and wired it into EloqKVEngine; replaced Google Logging init with a custom prefix/init and ensured proper shutdown; advanced the eloq store_handler submodule pointer; ensured CI workspace creation and symlink setup in scripts.

Changes

Cohort / File(s) Summary
Config files (metrics disabled / options removed)
concourse/artifact/ELOQDSS_ROCKSDB/eloqdoc.conf, concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc.conf, concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_a.conf, concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_b.conf, concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_c.conf
Set storage.*.metrics.enableMetrics true → false; removed per-metric toggles (enableMemoryUsage, collectMemoryUsageRound, enableCacheHitRate, enableTxMetrics, collectTxDurationRound, enableBusyRoundMetrics, busyRoundThreshold, enableRemoteRequestMetrics, enableLogServiceMetrics). One Cloud S3 conf added setParameter entries (disableLogicalSessionCacheRefresh: true, ttlMonitorEnabled: false).
Global options (new flag)
src/mongo/db/modules/eloq/src/eloq_global_options.h, src/mongo/db/modules/eloq/src/eloq_global_options.cpp
Added public field bool enableKVMetrics{true}; and parsing/handling for storage.eloq.metrics.enableKVMetrics; store logic combines enableMetrics and enableKVMetrics when option present.
KV engine (metrics wiring + logging changes)
src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp
Propagate eloqGlobalOptions.enableKVMetrics into metrics config (metrics::enable_kv_metrics); added <iomanip> include; introduced custom InitGlog with formatted prefix, per-level file destinations and symlinks, disabled stdout/stderr, and invoke google::ShutdownGoogleLogging() during clean shutdown.
Submodule update
src/mongo/db/modules/eloq/store_handler
Submodule pointer advanced (commit update) with no code diffs in this diff.
CI scripts (workspace creation / symlinks)
concourse/scripts/main.ent.bash, concourse/scripts/pr.ent.bash, concourse/scripts/main.bash
Ensure /home/$current_user/workspace exists (create if missing), chown to current user, cd into it, and create symlinks (e.g., py-tpcc) to expected workspace sources before later steps.

Sequence Diagram(s)

sequenceDiagram
  participant Conf as eloqdoc.conf
  participant GO as EloqGlobalOptions
  participant KV as EloqKVEngine
  participant Metrics as metrics::module
  participant Glog as GoogleLogging

  rect rgba(200,230,255,0.25)
  Conf->>GO: read storage.eloq.metrics (enableMetrics) and optional enableKVMetrics
  note right of GO: enableKVMetrics defaults true\nif provided: combined = enableMetrics && enableKVMetrics
  GO->>KV: pass eloqGlobalOptions
  end

  rect rgba(220,255,220,0.18)
  KV->>Metrics: metrics::enable_kv_metrics = eloqGlobalOptions.enableKVMetrics
  note right of Metrics: gates KV-specific metric emission
  end

  rect rgba(255,240,200,0.18)
  KV->>Glog: InitGlog(custom prefix, per-level files, symlinks, disable stdout/stderr)
  Glog-->KV: logging initialized
  KV->>Glog: on shutdown -> google::ShutdownGoogleLogging()
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay extra attention to:
    • src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp — InitGlog implementation (file/symlink handling, formatting, thread-safety, shutdown).
    • src/mongo/db/modules/eloq/src/eloq_global_options.{h,cpp} — parsing/composition semantics between enableMetrics and enableKVMetrics.
    • Config removals — verify removed metric keys are not referenced elsewhere.

Possibly related PRs

Suggested reviewers

  • xiexiaoy

Poem

🐇 I hop through configs, quiet and spry,
I tuck metrics down where small flags lie.
I wire a KV flag and tune logs to sing,
nudge a submodule forward — a neat little thing.
🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes in the changeset: updates to KV metrics configuration and refactoring of glog initialization in eloq_kv_engine.cpp.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46a4862 and 32bde02.

📒 Files selected for processing (12)
  • concourse/artifact/ELOQDSS_ROCKSDB/eloqdoc.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_a.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_b.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_c.conf (1 hunks)
  • concourse/scripts/main.bash (1 hunks)
  • concourse/scripts/main.ent.bash (1 hunks)
  • concourse/scripts/pr.ent.bash (1 hunks)
  • src/mongo/db/modules/eloq/src/eloq_global_options.cpp (2 hunks)
  • src/mongo/db/modules/eloq/src/eloq_global_options.h (1 hunks)
  • src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp (6 hunks)
  • src/mongo/db/modules/eloq/store_handler (1 hunks)

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

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

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: 0

🧹 Nitpick comments (3)
concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc.conf (1)

63-64: Confirm intent to fully disable legacy metrics for this artifact

enableMetrics: false will turn off the legacy metrics endpoint while leaving metricsPort: 18081 configured but effectively unused. Given the PR’s move toward enableKVMetrics and removal of per-metric knobs, please double‑check that:

  • This Concourse artifact is not relied on by tests or tooling that still scrape the old metrics endpoint.
  • The new KV‑metrics wiring covers any observability you still need from this profile (or that it’s intentionally metrics‑silent).

If the endpoint is no longer expected to run at all here, you might also consider dropping metricsPort in a follow‑up to avoid confusion.

concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_c.conf (1)

55-56: Verify cluster‑wide observability expectations with metrics disabled

For the cloud‑c node, enableMetrics: false means this node will no longer expose the legacy metrics endpoint on metricsPort: 18081. Since this is part of a 3‑node cluster:

  • Confirm that all cluster configs (a/b/c) are aligned on whether legacy metrics are enabled or disabled.
  • Ensure any dashboards/alerts that scraped these endpoints are either updated to use the new KV‑metrics path or intentionally retired.

If the whole cluster is expected to be metrics‑silent for this profile, keeping metricsPort around is harmless but slightly confusing; you could remove it later for clarity.

concourse/artifact/ELOQDSS_ROCKSDB/eloqdoc.conf (1)

35-36: Check CI/test expectations after disabling legacy metrics in RocksDB profile

Here enableMetrics: false disables the legacy metrics endpoint for the standard RocksDB artifact, while leaving metricsPort in place. With the new enableKVMetrics wiring in code:

  • Please confirm that any Concourse jobs or tests using this profile no longer depend on the old metrics endpoint.
  • Ensure they are either updated to rely on KV‑metrics (if exposed elsewhere) or no longer require metrics.

If legacy metrics are fully deprecated for this profile, consider dropping metricsPort in a later cleanup to avoid implying that an endpoint is available.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6439463 and 819eb19.

📒 Files selected for processing (5)
  • concourse/artifact/ELOQDSS_ROCKSDB/eloqdoc.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_a.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_b.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_c.conf (1 hunks)
🔇 Additional comments (2)
concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_b.conf (1)

53-56: No action required. The configuration is correct as-is.

The original review comment incorrectly assumes enableKVMetrics should appear in configuration files. However, verification shows:

  1. enableKVMetrics is a code-level parameter defined with a default value of true in eloq_global_options.h:162, not a required configuration file entry.

  2. The logic at eloq_global_options.cpp:1144 shows that enableKVMetrics is gated by enableMetrics: even if enableKVMetrics were configured, it would be disabled when enableMetrics: false.

  3. All three cluster configs (a, b, c) consistently omit enableKVMetrics from their configuration files, confirming this is the intended pattern.

The configuration change is correct: disabling the legacy metrics system (enableMetrics: false) appropriately prevents all metrics, including the new KV metrics. The PR successfully adds the enableKVMetrics feature to the codebase; no additional configuration file changes are needed.

Likely an incorrect or invalid review comment.

concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_a.conf (1)

53-56: Verify operational impact of metrics disablement and ensure new observability system is active.

Metrics are consistently disabled across all cluster configurations (enableMetrics: false). While the code includes a new enableKVMetrics flag alongside other granular metrics options, none of the cluster configuration files have explicit enableKVMetrics entries—meaning the new metrics system is also disabled via the central enableMetrics: false setting.

Before merging, confirm:

  1. The new enableKVMetrics flag is intentionally disabled alongside other metrics, or whether it should be explicitly enabled in configs as the observability replacement
  2. Existing monitoring dashboards and alerts have been updated or have fallback mechanisms
  3. This consistent disablement across all clusters is intentional and documented
  4. A rollback or re-enablement plan exists if observability needs to be restored

@lzxddz lzxddz changed the title Update kv metrics Update kv metrics and refactor glog init Nov 21, 2025
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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 819eb19 and 1b220e6.

📒 Files selected for processing (9)
  • concourse/artifact/ELOQDSS_ROCKSDB/eloqdoc.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_a.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_b.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_c.conf (1 hunks)
  • src/mongo/db/modules/eloq/src/eloq_global_options.cpp (2 hunks)
  • src/mongo/db/modules/eloq/src/eloq_global_options.h (1 hunks)
  • src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp (4 hunks)
  • src/mongo/db/modules/eloq/store_handler (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/mongo/db/modules/eloq/store_handler
🚧 Files skipped from review as they are similar to previous changes (1)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_c.conf
🧰 Additional context used
🧬 Code graph analysis (1)
src/mongo/db/modules/eloq/src/eloq_global_options.cpp (1)
src/mongo/db/modules/eloq/src/eloq_global_options.h (1)
  • enableKVMetrics (162-163)
🔇 Additional comments (8)
concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_b.conf (1)

53-56: Disabling metrics for cluster_b is behavior‑changing but consistent with other configs

Setting enableMetrics: false will fully disable metrics export for this cluster (given the per‑metric toggles were removed). That matches the other concourse configs in this PR; just confirm this is acceptable for your observability/alerting for cluster_b.

concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc.conf (1)

61-64: Root CLOUD_S3 config now disables metrics globally

enableMetrics: false will turn off metrics export for this deployment, while keeping the port configured. This is consistent with the cluster_* configs; please double‑check that CI/production expectations don’t rely on these metrics.

src/mongo/db/modules/eloq/src/eloq_global_options.h (1)

149-163: New enableKVMetrics option is consistent with existing metrics fields

Adding bool enableKVMetrics{true}; alongside the other metrics toggles fits the existing pattern (public member with an in‑class default) and gives a clear hook for the KV metrics gate.

concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_a.conf (1)

53-56: Cluster_a metrics disabled to match other environments

With enableMetrics: false, this cluster won’t export metrics. That keeps cluster_a aligned with cluster_b and the ROCKSDB configs; verify this won’t break any monitoring that was expecting per‑cluster metrics.

src/mongo/db/modules/eloq/src/eloq_global_options.cpp (1)

578-586: KV metrics option wiring matches existing metrics pattern

The new storage.eloq.metrics.enableKVMetrics option (default true) and the store‑side assignment

if (params.count("storage.eloq.metrics.enableKVMetrics")) {
    enableKVMetrics =
        enableMetrics && params["storage.eloq.metrics.enableKVMetrics"].as<bool>();
}

mirror how the other fine‑grained metrics toggles are gated by enableMetrics. That keeps KV metrics disabled whenever both the global and per‑metric gates are explicitly turned off, while defaulting to enabled when metrics are globally on and the KV toggle is omitted.

Also applies to: 655-660, 1142-1145

concourse/artifact/ELOQDSS_ROCKSDB/eloqdoc.conf (1)

33-36: ROCKSDB config now disables Eloq metrics globally

enableMetrics: false turns off metrics for this deployment, aligning the non‑cloud ROCKSDB setup with the CLOUD_S3 configs. Please confirm that this is intended and that any dashboards for this environment don’t rely on those metrics.

src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp (2)

567-576: KV metrics flag correctly surfaces into metrics namespace

metrics::enable_kv_metrics = eloqGlobalOptions.enableKVMetrics; cleanly connects the new configuration flag through to the metrics subsystem, alongside the existing enable_metrics and per‑metric toggles.


1282-1298: Double-shutdown risk is mitigated; process-wide concerns remain unverifiable

Code inspection confirms:

  • cleanShutdown() sets _txService.reset() (line 1296), and the destructor checks if (_txService) before re-calling it (line 786)—double shutdown is prevented
  • InitGlog() is called once in the constructor; ShutdownGoogleLogging() is called once in cleanShutdown()
  • No logging observed immediately after cleanShutdown() in shutdownGlobalStorageEngineCleanly() (storage_engine_init.cpp:212–214)

However, the broader concern—whether other subsystems in the same process depend on glog after EloqKVEngine is destroyed—cannot be ruled out without auditing the complete process shutdown sequence. Verify that no other components attempt to log after shutdownGlobalStorageEngineCleanly() completes.

@lzxddz lzxddz force-pushed the update-kv-metrics branch 3 times, most recently from ebd4a86 to b415836 Compare November 24, 2025 05:35
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: 0

♻️ Duplicate comments (2)
concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_c.conf (1)

55-55: Metrics disabled - consistent with cluster_a and cluster_b.

This cluster node also has metrics disabled, consistent with the other cluster configurations. The same operational considerations apply.

concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_a.conf (1)

55-55: Metrics disabled - consistent with other cluster nodes.

This completes the metrics disabling across all cluster configurations (cluster_a, cluster_b, cluster_c). Ensure this is the intended deployment state.

🧹 Nitpick comments (2)
concourse/artifact/ELOQDSS_ROCKSDB/eloqdoc.conf (1)

35-35: Verify the operational impact of disabling metrics collection.

Metrics collection is now completely disabled (enableMetrics: false). This affects observability and monitoring capabilities for this deployment. Ensure that:

  • Monitoring/alerting systems don't depend on these metrics
  • This change aligns with operational requirements
  • Alternative observability mechanisms are in place if needed
concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_b.conf (1)

55-55: Verify the operational impact of disabling metrics collection.

Metrics collection is now completely disabled for this cluster node. This affects observability across the cluster deployment. Ensure this change is intentional and coordinated across all cluster nodes, and that monitoring systems are updated accordingly.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ebd4a86 and b415836.

📒 Files selected for processing (9)
  • concourse/artifact/ELOQDSS_ROCKSDB/eloqdoc.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_a.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_b.conf (1 hunks)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc_cluster_c.conf (1 hunks)
  • src/mongo/db/modules/eloq/src/eloq_global_options.cpp (2 hunks)
  • src/mongo/db/modules/eloq/src/eloq_global_options.h (1 hunks)
  • src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp (6 hunks)
  • src/mongo/db/modules/eloq/store_handler (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/mongo/db/modules/eloq/store_handler
🚧 Files skipped from review as they are similar to previous changes (1)
  • concourse/artifact/ELOQDSS_ROCKSDB_CLOUD_S3/eloqdoc.conf
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: lzxddz
Repo: eloqdata/eloqdoc PR: 325
File: src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp:1362-1384
Timestamp: 2025-11-24T03:11:24.946Z
Learning: The EloqDoc codebase uses an older version of glog that supports the two-parameter signature `google::InitGoogleLogging(const char* argv0, PrefixCallback)` for custom log prefix formatting, as seen in src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp line 1383.
📚 Learning: 2025-11-24T03:11:24.946Z
Learnt from: lzxddz
Repo: eloqdata/eloqdoc PR: 325
File: src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp:1362-1384
Timestamp: 2025-11-24T03:11:24.946Z
Learning: The EloqDoc codebase uses an older version of glog that supports the two-parameter signature `google::InitGoogleLogging(const char* argv0, PrefixCallback)` for custom log prefix formatting, as seen in src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp line 1383.

Applied to files:

  • src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp
  • src/mongo/db/modules/eloq/src/eloq_global_options.h
📚 Learning: 2025-11-14T03:10:22.027Z
Learnt from: githubzilla
Repo: eloqdata/eloqdoc PR: 279
File: src/mongo/db/dbmain.cpp:0-0
Timestamp: 2025-11-14T03:10:22.027Z
Learning: In this repository, avoid defining --config via gflags in src/mongo/db/dbmain.cpp; MongoDB’s options_parser owns --config. Prefer gflags flags with a distinct prefix (e.g., --data_substrate_config) parsed before options_parser, with options_parser configured to allow unregistered options.

Applied to files:

  • src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp
📚 Learning: 2025-09-25T12:24:06.434Z
Learnt from: githubzilla
Repo: eloqdata/eloqdoc PR: 211
File: src/mongo/db/modules/eloq/cmake/build_eloq_log_service.cmake:26-80
Timestamp: 2025-09-25T12:24:06.434Z
Learning: The user githubzilla implemented a fix in commit fe98aaf to address the MEMORY state incorrectly triggering RocksDB discovery in build_eloq_log_service.cmake. This was a control flow issue where MEMORY builds were falling into an else branch that still attempted RocksDB discovery.

Applied to files:

  • concourse/artifact/ELOQDSS_ROCKSDB/eloqdoc.conf
🧬 Code graph analysis (1)
src/mongo/db/modules/eloq/src/eloq_global_options.cpp (1)
src/mongo/db/modules/eloq/src/eloq_global_options.h (1)
  • enableKVMetrics (162-163)
🔇 Additional comments (7)
src/mongo/db/modules/eloq/src/eloq_global_options.h (1)

162-162: LGTM! New KV metrics flag added appropriately.

The new enableKVMetrics flag with default true follows the existing pattern for other metrics flags in this class and provides fine-grained control over KV-level metrics collection.

src/mongo/db/modules/eloq/src/eloq_global_options.cpp (2)

655-660: LGTM! KV metrics option registration follows the established pattern.

The option registration is consistent with other metrics flags in this file, properly documented, and uses the appropriate default value.


1142-1145: KV metrics gating follows the established pattern correctly.

The parsing logic applies the same gating pattern as other per-metric flags (lines 1100-1140): enableKVMetrics is set to enableMetrics && option_value. This means KV metrics can only be enabled when enableMetrics is true. Since the current configs disable enableMetrics, KV metrics will be disabled regardless of this flag's default value.

src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp (4)

573-573: LGTM! KV metrics configuration and registration implemented correctly.

The KV metrics flag is properly set from global options (line 573) and registration (lines 588-596) is correctly gated by both the global enable_metrics flag and the specific enable_kv_metrics flag. The common labels include appropriate node identification.

Also applies to: 588-596


1297-1297: LGTM! Proper cleanup added for log server and glog.

Line 1297 explicitly nullifies _logServer during shutdown, and line 1308 properly shuts down Google Logging. These cleanup steps are necessary and correctly placed in the cleanShutdown() sequence.

Also applies to: 1308-1308


1348-1371: LGTM! Custom log prefix function implemented correctly.

The CustomPrefix function properly formats log entries with ISO8601-style timestamps, severity, thread ID, and optional source location. The formatting uses std::setw and std::setfill correctly (now available via the <iomanip> header). The function signature matches the older glog version in use, as confirmed by previous discussion. Based on learnings, this implementation is correct for your glog version.


1373-1395: Based on my verification of glog's implementation and documentation:

Symlink configuration is correct; resolve review comment.

The SetLogSymlink function operates per severity level, with each severity having its own log_destination instance. A pair of files is generated for each log severity (INFO, WARNING, ERROR, FATAL), and each severity maintains separate symlinks. Setting all three severity levels to the same symlink base name "txservice" is the standard pattern—it does not cause a collision. Each severity level maintains its own independent symlink (e.g., txservice.INFO, txservice.WARNING, txservice.ERROR).

The log file naming with .INFO., .WARNING., .ERROR. suffixes aligns with glog's per-severity logging design.

@lzxddz lzxddz merged commit e8b32f1 into eloqdata:main Nov 24, 2025
1 of 2 checks passed
@lzxddz lzxddz deleted the update-kv-metrics branch November 24, 2025 08:07
@yi-xmu yi-xmu mentioned this pull request Nov 24, 2025
@coderabbitai coderabbitai bot mentioned this pull request Nov 28, 2025
This was referenced Dec 15, 2025
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.

2 participants