Skip to content

Check Exometer is loaded before calling it - #4542

Merged
chrzaszcz merged 3 commits into
masterfrom
exometer-crash
Jun 24, 2025
Merged

chrzaszcz merged 3 commits into
masterfrom
exometer-crash

Conversation

@gustawlippa

@gustawlippa gustawlippa commented Jun 24, 2025 •

Copy link
Copy Markdown
Contributor

There is a crash in mongoose_system_metrics_collector when Exometer is not configured, and thus not started - reported in #4541. This PR should fix this issue.
I've tested locally:

  1. The crash goes away without Exometer enabled - the report just doesn't have the stanza statistics.
  2. With Exometer enabled, the report has the stanza statistics.

I don't have an idea for a testcase for big_tests though.

@mongoose-im

This comment was marked as outdated.

@codecov

codecov Bot commented Jun 24, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.90%. Comparing base (c33bd53) to head (77d43a9).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...stem_metrics/mongoose_system_metrics_collector.erl 50.00% 1 Missing ⚠ïļ
...system_metrics/service_mongoose_system_metrics.erl 80.00% 1 Missing ⚠ïļ
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4542      +/-   ##
==========================================
- Coverage   85.90%   85.90%   -0.01%     
==========================================
  Files         565      565              
  Lines       33815    33820       +5     
==========================================
+ Hits        29050    29052       +2     
- Misses       4765     4768       +3     

☔ View full report in Codecov by Sentry.
ðŸ“Ē Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄ïļ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • ðŸ“Ķ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gustawlippa
gustawlippa marked this pull request as draft June 24, 2025 11:00
@mongoose-im

This comment was marked as outdated.

Comment thread src/system_metrics/service_mongoose_system_metrics.erl Outdated
@mongoose-im

mongoose-im commented Jun 24, 2025 •

Copy link
Copy Markdown
Collaborator

elasticsearch_and_cassandra_27 / elasticsearch_and_cassandra_mnesia / 77d43a9
Reports root/ big
OK: 683 / Failed: 0 / User-skipped: 72 / Auto-skipped: 0


small_tests_26 / small_tests / 77d43a9
Reports root / small


small_tests_27 / small_tests / 77d43a9
Reports root / small


small_tests_27_arm64 / small_tests / 77d43a9
Reports root / small


ldap_mnesia_26 / ldap_mnesia / 77d43a9
Reports root/ big
OK: 2332 / Failed: 0 / User-skipped: 1187 / Auto-skipped: 0


dynamic_domains_mysql_redis_27 / mysql_redis / 77d43a9
Reports root/ big
OK: 5164 / Failed: 0 / User-skipped: 154 / Auto-skipped: 0


ldap_mnesia_27 / ldap_mnesia / 77d43a9
Reports root/ big
OK: 2332 / Failed: 0 / User-skipped: 1352 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 77d43a9
Reports root/ big
OK: 5034 / Failed: 0 / User-skipped: 119 / Auto-skipped: 0


internal_mnesia_27 / internal_mnesia / 77d43a9
Reports root/ big
OK: 2466 / Failed: 0 / User-skipped: 1218 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / 77d43a9
Reports root/ big
OK: 5199 / Failed: 0 / User-skipped: 119 / Auto-skipped: 0


pgsql_cets_27 / pgsql_cets / 77d43a9
Reports root/ big
OK: 5285 / Failed: 0 / User-skipped: 188 / Auto-skipped: 0


pgsql_mnesia_26 / pgsql_mnesia / 77d43a9
Reports root/ big
OK: 5423 / Failed: 0 / User-skipped: 128 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_27 / odbc_mssql_mnesia / 77d43a9
Reports root/ big
OK: 5194 / Failed: 0 / User-skipped: 124 / Auto-skipped: 0


cockroachdb_cets_27 / cockroachdb_cets / 77d43a9
Reports root/ big
OK: 5293 / Failed: 4 / User-skipped: 188 / Auto-skipped: 0

pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alice_send_last_published_item_no_items_test_3781@localhost/res1">>,
          escalus_tcp,<0.118156.0>,
          [{event_manager,<0.118144.0>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_send_last_published_item_no_items_test_3781">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.118144.0>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_send_last_published_item_no_items_test_3781">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alice_send_last_published_item_no_items_test_3781">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,fun escalus_auth:auth_plain/2},
           {wspath,undefined},
           {username,
             <<"alicE_send_last_published_item_no_items_test_3781">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"bf6f46f8612aef14">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {pubsub_tools,receive_response,3,
       [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
        {line,434}]},
     {pubsub_tools,receive_and_c...

Report log

pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alice_send_last_published_item_no_items_test_3784@localhost/res1">>,
          escalus_tcp,<0.118231.0>,
          [{event_manager,<0.118221.0>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_send_last_published_item_no_items_test_3784">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.118221.0>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_send_last_published_item_no_items_test_3784">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alice_send_last_published_item_no_items_test_3784">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,fun escalus_auth:auth_plain/2},
           {wspath,undefined},
           {username,
             <<"alicE_send_last_published_item_no_items_test_3784">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"bfe418e187e4536d">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {pubsub_tools,receive_response,3,
       [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
        {line,434}]},
     {pubsub_tools,receive_and_c...

Report log

pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alice_send_last_published_item_no_items_test_3787@localhost/res1">>,
          escalus_tcp,<0.118310.0>,
          [{event_manager,<0.118299.0>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_send_last_published_item_no_items_test_3787">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.118299.0>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_send_last_published_item_no_items_test_3787">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alice_send_last_published_item_no_items_test_3787">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,fun escalus_auth:auth_plain/2},
           {wspath,undefined},
           {username,
             <<"alicE_send_last_published_item_no_items_test_3787">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"19a491bccbb4b534">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {pubsub_tools,receive_response,3,
       [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
        {line,434}]},
     {pubsub_tools,receive_and_c...

Report log

pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alice_send_last_published_item_no_items_test_3789@localhost/res1">>,
          escalus_tcp,<0.118386.0>,
          [{event_manager,<0.118366.0>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_send_last_published_item_no_items_test_3789">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.118366.0>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_send_last_published_item_no_items_test_3789">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alice_send_last_published_item_no_items_test_3789">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,fun escalus_auth:auth_plain/2},
           {wspath,undefined},
           {username,
             <<"alicE_send_last_published_item_no_items_test_3789">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"04cb7e2e72eb0599">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {pubsub_tools,receive_response,3,
       [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
        {line,434}]},
     {pubsub_tools,receive_and_c...

Report log


pgsql_mnesia_27 / pgsql_mnesia / 77d43a9
Reports root/ big
OK: 5588 / Failed: 0 / User-skipped: 128 / Auto-skipped: 0


mysql_redis_27 / mysql_redis / 77d43a9
Reports root/ big
OK: 5567 / Failed: 0 / User-skipped: 149 / Auto-skipped: 0


mssql_mnesia_27 / odbc_mssql_mnesia / 77d43a9
Reports root/ big
OK: 5583 / Failed: 0 / User-skipped: 133 / Auto-skipped: 0

@DenysGonchar
DenysGonchar marked this pull request as ready for review June 24, 2025 12:22

@chrzaszcz chrzaszcz left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good 👍 , and I also tested manually that the error is gone (and checked the uncovered lines this way).

@chrzaszcz
chrzaszcz merged commit 2bfbe57 into master Jun 24, 2025
@chrzaszcz
chrzaszcz deleted the exometer-crash branch June 24, 2025 12:42
@chrzaszcz chrzaszcz added this to the 6.4.0 milestone Jun 24, 2025
chrzaszcz added a commit that referenced this pull request Jun 24, 2025
- Add new PR's: #4539, #4540, #4542
- Rework descriptions to better reflect the functional changes
chrzaszcz added a commit that referenced this pull request Jun 24, 2025
- Add new PR's: #4539, #4540, #4542
- Rework descriptions to better reflect the functional changes
jacekwegr pushed a commit that referenced this pull request Jun 25, 2025
- Add new PR's: #4539, #4540, #4542
- Rework descriptions to better reflect the functional changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants