-
Notifications
You must be signed in to change notification settings - Fork 428
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/backend #4282
Instrument/backend #4282
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
24f238f
to
72ed24d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
101a419
to
7543844
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/instrument #4282 +/- ##
======================================================
+ Coverage 84.28% 84.69% +0.41%
======================================================
Files 556 556
Lines 33889 33889
======================================================
+ Hits 28564 28703 +139
+ Misses 5325 5186 -139 ☔ View full report in Codecov by Sentry. |
This comment was marked as outdated.
This comment was marked as outdated.
d545ca3
to
2680ead
Compare
This comment was marked as outdated.
This comment was marked as outdated.
2680ead
to
41afdf8
Compare
This comment was marked as outdated.
This comment was marked as outdated.
41afdf8
to
7b7fa14
Compare
This comment was marked as outdated.
This comment was marked as outdated.
7b7fa14
to
f5fbe45
Compare
elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / f5fbe45 small_tests_25 / small_tests / f5fbe45 small_tests_26 / small_tests / f5fbe45 small_tests_26_arm64 / small_tests / f5fbe45 ldap_mnesia_25 / ldap_mnesia / f5fbe45 ldap_mnesia_26 / ldap_mnesia / f5fbe45 internal_mnesia_26 / internal_mnesia / f5fbe45 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / f5fbe45 dynamic_domains_mysql_redis_26 / mysql_redis / f5fbe45 offline_SUITE:with_groupchat:groupchat_message_is_stored{error,{{badrpc,timeout},
[{escalus_rpc,call_with_cookie_match,
[mongooseim@localhost,ejabberd_admin,register,
[<<"alicE_groupchat_message_is_stored_2787">>,
<<"domain.example.com">>,<<"matygrysa">>],
3000,mongooseim],
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_rpc.erl"},
{line,34}]},
{lists,foreach_1,2,[{file,"lists.erl"},{line,1686}]},
{escalus_ejabberd,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_ejabberd.erl"},
{line,211}]},
{escalus_fresh,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_fresh.erl"},
{line,62}]},
{escalus_fresh,story_with_config,3,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_fresh.erl"},
{line,50}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1302}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1234}]}]}} pgsql_cets_26 / pgsql_cets / f5fbe45 dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / f5fbe45 dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / f5fbe45 pgsql_mnesia_25 / pgsql_mnesia / f5fbe45 pgsql_mnesia_26 / pgsql_mnesia / f5fbe45 mysql_redis_26 / mysql_redis / f5fbe45 mssql_mnesia_26 / odbc_mssql_mnesia / f5fbe45 |
f5fbe45
to
f48f62e
Compare
Make sure the instrumentation is set up only once. Unfortunately there is no 'stop', and adding it would be a substantial task. Moreover, some modules intentionally call it multiple times for the 'global' scope.
It can be reused e.g. in small tests. This way tracked funs are always the same.
- Start instrumentation in tests - Use the new mongoose_rdbms_backend:init/1
f48f62e
to
2ce2ec2
Compare
elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / f48f62e small_tests_25 / small_tests / f48f62e small_tests_26 / small_tests / f48f62e small_tests_26_arm64 / small_tests / f48f62e ldap_mnesia_25 / ldap_mnesia / f48f62e ldap_mnesia_26 / ldap_mnesia / f48f62e internal_mnesia_26 / internal_mnesia / f48f62e dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / f48f62e dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / f48f62e dynamic_domains_mysql_redis_26 / mysql_redis / f48f62e pgsql_cets_26 / pgsql_cets / f48f62e dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / f48f62e pgsql_mnesia_25 / pgsql_mnesia / f48f62e pgsql_mnesia_26 / pgsql_mnesia / f48f62e mysql_redis_26 / mysql_redis / f48f62e mssql_mnesia_26 / odbc_mssql_mnesia / f48f62e |
elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 2ce2ec2 small_tests_25 / small_tests / 2ce2ec2 small_tests_26 / small_tests / 2ce2ec2 small_tests_26_arm64 / small_tests / 2ce2ec2 ldap_mnesia_25 / ldap_mnesia / 2ce2ec2 ldap_mnesia_26 / ldap_mnesia / 2ce2ec2 internal_mnesia_26 / internal_mnesia / 2ce2ec2 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 2ce2ec2 dynamic_domains_mysql_redis_26 / mysql_redis / 2ce2ec2 dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 2ce2ec2 pgsql_cets_26 / pgsql_cets / 2ce2ec2 dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 2ce2ec2 pgsql_mnesia_25 / pgsql_mnesia / 2ce2ec2 mysql_redis_26 / mysql_redis / 2ce2ec2 pgsql_mnesia_26 / pgsql_mnesia / 2ce2ec2 mssql_mnesia_26 / odbc_mssql_mnesia / 2ce2ec2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! Looks good to me 👍
The goal is to use
mongoose_instrument
instead ofmongoose_metrics
inmongoose_backend
.The new event naming is different from the previously used metric naming:
Mod_Backend
, e.g.mod_roster_rdbms
.host_type
andfunction
(which is a new label supported bymongoose_instrument
). The events are per host type unless the backend is set up globally. This differs from the previously used global metrics, which were implemented before we introduced dynamic domains. With the limited number of host types and the possibility to use theall_metrics_are_global
option, it shouldn't be an issue.count
,time
andargs
. The latter is a list of arguments, which can be used for debugging and is used in big tests to match expected events. Unless debug logs are enabled, a heavy term in arguments shouldn't cause any problems, because it is not copied anywhere.Other changes:
M
,F
,A
arguments inmongoose_instrument:span
.tracked_funs
, which were discovered because it is illegal to trigger a non-existing event.metrics_roster_SUITE
checks two selected backends events now, which is as a sample used to verify thatmongoose_backend
events are working.Note: if
mongoose_backend
had astop
function in addition toinit
, it would be possible to eliminate thetry ... catch
and prevent other unwanted issues when a backend is initialized many times. This would require a lot of changes, and I will log it as a separate story.