Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrument mongoose_user_cache #4323

Merged
merged 4 commits into from
Jul 15, 2024
Merged

Conversation

jacekwegr
Copy link
Collaborator

@jacekwegr jacekwegr commented Jul 12, 2024

This PR updates the mongoose_user_cache metrics to use mongoose_instrument. It removes old telemetry events and uses span to collect the needed information.

Code changes

  • Metric migration: Changed mongoose_user_cache metrics to use mongoose_instrument.
  • Telemetry removal: Removed telemetry events and replaced them with span to collect relevant information.

Testing

  • Cache event checks: Added checks for cache events to the muc_light_SUITE tests, as this module uses them.
  • Test updates: Added these checks to the tests where they are most relevant.

@mongoose-im

This comment was marked as outdated.

Copy link

codecov bot commented Jul 12, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 35.35%. Comparing base (31ad729) to head (31c2b20).

Files Patch % Lines
src/mongoose_user_cache.erl 66.66% 4 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           feature/instrument    #4323       +/-   ##
=======================================================
- Coverage               84.39%   35.35%   -49.04%     
=======================================================
  Files                     553      553               
  Lines                   33874    33874               
=======================================================
- Hits                    28587    11976    -16611     
- Misses                   5287    21898    +16611     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jacekwegr jacekwegr force-pushed the instrument/user-cache branch from 4a8dc96 to 5223783 Compare July 15, 2024 06:27
@mongoose-im

This comment was marked as outdated.

@jacekwegr jacekwegr force-pushed the instrument/user-cache branch from 5223783 to fd97605 Compare July 15, 2024 07:10
@mongoose-im

This comment was marked as outdated.

@jacekwegr jacekwegr changed the title Instrument/user cache Instrument mongoose_user_cache Jul 15, 2024
@jacekwegr jacekwegr marked this pull request as ready for review July 15, 2024 07:41
Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

Looks good in general. I added a comment.

@mongoose-im

This comment was marked as outdated.

@jacekwegr jacekwegr force-pushed the instrument/user-cache branch from 4c8a884 to 31c2b20 Compare July 15, 2024 12:18
@mongoose-im
Copy link
Collaborator

mongoose-im commented Jul 15, 2024

elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 31c2b20
Reports root/ big
OK: 457 / Failed: 0 / User-skipped: 45 / Auto-skipped: 0


small_tests_25 / small_tests / 31c2b20
Reports root / small


small_tests_26 / small_tests / 31c2b20
Reports root / small


small_tests_26_arm64 / small_tests / 31c2b20
Reports root / small


ldap_mnesia_25 / ldap_mnesia / 31c2b20
Reports root/ big
OK: 2286 / Failed: 0 / User-skipped: 910 / Auto-skipped: 0


dynamic_domains_mysql_redis_26 / mysql_redis / 31c2b20
Reports root/ big
OK: 4600 / Failed: 0 / User-skipped: 139 / Auto-skipped: 0


ldap_mnesia_26 / ldap_mnesia / 31c2b20
Reports root/ big
OK: 2286 / Failed: 0 / User-skipped: 910 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 31c2b20
Reports root/ big
OK: 4633 / Failed: 0 / User-skipped: 106 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 31c2b20
Reports root/ big
OK: 4629 / Failed: 1 / User-skipped: 109 / Auto-skipped: 0

muc_SUITE:register:user_unregisters_nick_twice
{error,
  {{assertion_failed,assert,is_iq_result,
     [{xmlel,<<"iq">>,
        [{<<"type">>,<<"set">>},
         {<<"id">>,<<"4f30b0de900106a9577df3d7d3eca600">>},
         {<<"to">>,<<"groupchats.domain.example.com">>}],
        [{xmlel,<<"query">>,
           [{<<"xmlns">>,<<"jabber:iq:register">>}],
           [{xmlel,<<"x">>,
            [{<<"xmlns">>,<<"jabber:x:data">>},
             {<<"type">>,<<"submit">>}],
            [{xmlel,<<"field">>,
               [{<<"type">>,<<"hidden">>},
                {<<"var">>,<<"FORM_TYPE">>}],
               [{xmlel,<<"value">>,[],
                  [{xmlcdata,<<"jabber:iq:register">>}]}]},
             {xmlel,<<"field">>,
               [{<<"type">>,<<"text-single">>},
                {<<"var">>,<<"nick">>}],
               [{xmlel,<<"value">>,[],
                  [{xmlcdata,
                     <<"thirdwitch1room-974af10c87">>}]}]}]}]}]}],
     {xmlel,<<"iq">>,
       [{<<"from">>,<<"groupchats.domain.example.com">>},
        {<<"to">>,
         <<"[email protected]/res1">>},
        {<<"type">>,<<"error">>},
        {<<"id">>,<<"4f30b0de900106a9577df3d7d3eca600">>}],
       [{xmlel,<<"query">>,
          [{<<"xmlns">>,<<"jabber:iq:register">>}],
          [{xmlel,<<"x">>,
             [{<<"xmlns">>,<<"jabber:x:data">>},
            {<<"type">>,<<"submit">>}],
             [{xmlel,<<"field">>,
              [{<<"type">>,<<"hidden">>},
               {<<"var">>,<<"FORM_TYPE">>}],
        ...

Report log


internal_mnesia_26 / internal_mnesia / 31c2b20
Reports root/ big
OK: 2428 / Failed: 0 / User-skipped: 768 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 31c2b20
Reports root/ big
OK: 4633 / Failed: 0 / User-skipped: 106 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 31c2b20
Reports root/ big
OK: 5025 / Failed: 0 / User-skipped: 115 / Auto-skipped: 0


pgsql_cets_26 / pgsql_cets / 31c2b20
Reports root/ big
OK: 4528 / Failed: 0 / User-skipped: 176 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 31c2b20
Reports root/ big
OK: 5006 / Failed: 0 / User-skipped: 134 / Auto-skipped: 0


pgsql_mnesia_26 / pgsql_mnesia / 31c2b20
Reports root/ big
OK: 5025 / Failed: 0 / User-skipped: 115 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 31c2b20
Reports root/ big
OK: 5022 / Failed: 0 / User-skipped: 118 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 31c2b20
Reports root/ big
OK: 4630 / Failed: 0 / User-skipped: 109 / Auto-skipped: 0

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@chrzaszcz chrzaszcz merged commit 8abfb09 into feature/instrument Jul 15, 2024
2 of 4 checks passed
@chrzaszcz chrzaszcz deleted the instrument/user-cache branch July 15, 2024 13:38
@jacekwegr jacekwegr added this to the 6.3.0 milestone Oct 3, 2024
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.

3 participants