Skip to content

[Bug]: every server start warns that process group metrics are not exported, before the resource monitor is ready #38022

Closed

Description

@mInrOz

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Build the resource monitor (cargo build --release in native/resource-monitor) so the server can find it.
  2. Start the server with OTLP metrics export on, for example T3CODE_OTLP_METRICS_URL=http://127.0.0.1:4318/v1/metrics t3 serve.
  3. Watch the server log for a minute.

Expected behavior

With a working resource monitor, startup logs nothing about process group metrics, and the t3_process_group_* gauges are exported. When the monitor really is missing, the one warning from #23969 names why, for example Resource monitor binary was not found for linux/x64.

Actual behavior

Every server start logs a warning that metrics are not exported, then a recovery exactly one minute later, even though nothing is wrong:

[08:57:19.261] WARN: process group metrics are not exported: sample failed
    [cause]: NativeTelemetryUnavailable: Resource monitor is unavailable: sidecar is not running
[08:58:19.269] INFO: process group metrics sample recovered

When the binary really is missing, the warning still says sidecar is not running. The real cause (Resource monitor binary was not found …) only shows up in the later failures, which #23969 logs at debug.

Root cause

ProcessGroupMetrics takes its first sample as soon as its layer starts (ProcessGroupMetrics.ts#L137-L142). At that moment the NativeTelemetryClient supervisor has only just started spawning the sidecar (NativeTelemetryClient.ts#L568): the state is still starting with no handle and no lastError (L239). So sampleNow fails with the default reason sidecar is not running (L918-L923). The first failure is the one that is logged as a warning (ProcessGroupMetrics.ts#L126-L133), so it is always this race and never the real reason.

Impact

Minor bug or occasional failure

Version or commit

main @ 17c1425

Environment

Linux x64 (Debian 13), Node 26, headless t3 serve exporting OTLP metrics

Workaround

None. The warning is harmless when the binary exists, but it cannot be told apart from a real failure.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions