Skip to content

Bug: upload-test incorrectly reports metrics as offline #163

Closed

Description

@avmaksimov

Description

The mtproxymax upload-test command reports:

Live Ingress vs Egress metrics: Metrics offline (proxy container stopped)

However, the Docker container is running and both mtproxymax metrics and mtproxymax verify successfully retrieve the engine metrics.

Root cause

In mtproxymax.sh, the upload-test function calls:

_metrics=$(fetch_metrics 2>/dev/null || true)

But the actual function is named _fetch_metrics.

Because errors are suppressed, the command incorrectly reports that metrics are unavailable.

Proposed fix

- _metrics=$(fetch_metrics 2>/dev/null || true)
+ _metrics=$(_fetch_metrics 2>/dev/null || true)

Environment

MTProxyMax 1.4.2-LTS, telemt 3.5.16, Docker on Linux.

The issue is also present in the current main branch.

This is a diagnostic reporting issue and does not appear to affect the proxy engine itself.

Activity

  1. SamNet-dev commented on Nov 8, 2026

    @SamNet-dev
    Owner

    Hello @avmaksimov,

    Thank you for reporting this issue and pinpointing the root cause!

    Root Cause & Resolution (Commit 1f6ac17)

    • Corrected the function call in run_upload_test() from fetch_metrics to _fetch_metrics.
    • The live ingress vs. egress ratio audit in mtproxymax upload-test now correctly retrieves Prometheus metrics from the running engine without reporting Metrics offline (proxy container stopped).
    • Added regression unit test coverage in tests/test_upload_diagnostics.sh for both active and offline metric states (all 11 assertions passing).

    Closing as resolved. To receive the fix, update your script with:

    mtproxymax update
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