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

Include more details to the mysql.commands metric. #34806

Open
bran1501 opened this issue Aug 22, 2024 · 7 comments
Open

Include more details to the mysql.commands metric. #34806

bran1501 opened this issue Aug 22, 2024 · 7 comments
Labels
enhancement New feature or request receiver/mysql

Comments

@bran1501
Copy link

Component(s)

receiver/mysql

Is your feature request related to a problem? Please describe.

When I enable the mysql.commands metric, it provides general use of the commands select, insert, update and delete. However, it has to provide more insight on User activity. i.e mysql.commands.alter_table, mysql.commands.drop_table, mysql.commands.rename_table, etc

Describe the solution you'd like

Provide more attributes to this metric so it could monitor more specific activity from the users.

Describe alternatives you've considered

sql_exporter and create a Query and export all this data.

Additional context

Here is an example of multiple metrics that could be included.
https://docs.splunk.com/observability/en/gdi/monitors-databases/mysql.html#metrics

@bran1501 bran1501 added enhancement New feature or request needs triage New item requiring triage labels Aug 22, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@atoulme
Copy link
Contributor

atoulme commented Oct 12, 2024

@djaglowski what do you think?

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@djaglowski
Copy link
Member

mysql.commands.alter_table, mysql.commands.drop_table, mysql.commands.rename_table

These seem like reasonable additions.

Provide more attributes to this metric so it could monitor more specific activity from the users.

Are there any others besides the three mentioned above?

@djaglowski djaglowski removed the Stale label Jan 6, 2025
@atoulme
Copy link
Contributor

atoulme commented Jan 18, 2025

Maybe we can start with the three ones named.

@atoulme
Copy link
Contributor

atoulme commented Jan 18, 2025

I played with the code a bit and I have convinced myself that it would be hard to manage this with an additional metric attribute. I think this warrants one or more new metrics that would be specific to the group of commands used. For example, anything touching a table, anything touching an index, a user, should be separate so you can manage the granularity. Otherwise, you would collect all those metrics all the time. It is also more difficult to add new attribute variants of a metric because we won't control emitting them, and this may constitute a breaking change.

@atoulme
Copy link
Contributor

atoulme commented Jan 18, 2025

We probably want to group those (I started but ran out of time, @bran1501 please help!)

Name Group
Com_admin_commands admin
Com_assign_to_keycache ?
Com_alter_db db
Com_alter_event ?
Com_alter_function ?
Com_alter_instance ?
Com_alter_procedure ?
Com_alter_resource_group ?
Com_alter_server ?
Com_alter_table ?
Com_alter_tablespace tablespace
Com_alter_user user
Com_alter_user_default_role user
Com_analyze ?
Com_begin tx
Com_binlog ?
Com_call_procedure ?
Com_change_db ?
Com_change_repl_filter ?
Com_change_replication_source ?
Com_check ?
Com_checksum ?
Com_clone ?
Com_commit tx
Com_create_db db
Com_create_event ?
Com_create_function ?
Com_create_index ?
Com_create_procedure ?
Com_create_role user
Com_create_server ?
Com_create_table table
Com_create_resource_group ?
Com_create_trigger ?
Com_create_udf ?
Com_create_user user
Com_create_view ?
Com_create_spatial_reference_system ?
Com_dealloc_sql ?
Com_delete ?
Com_delete_multi ?
Com_do ?
Com_drop_db db
Com_drop_event ?
Com_drop_function ?
Com_drop_index ?
Com_drop_procedure ?
Com_drop_resource_group ?
Com_drop_role ?
Com_drop_server ?
Com_drop_spatial_reference_system ?
Com_drop_table table
Com_drop_trigger ?
Com_drop_user user
Com_drop_view ?
Com_empty_query ?
Com_execute_sql ?
Com_explain_other ?
Com_flush ?
Com_get_diagnostics ?
Com_grant ?
Com_grant_roles ?
Com_ha_close ?
Com_ha_open ?
Com_ha_read ?
Com_help ?
Com_import ?
Com_insert commands
Com_insert_select ?
Com_install_component ?
Com_install_plugin ?
Com_kill ?
Com_load ?
Com_lock_instance ?
Com_lock_tables ?
Com_optimize ?
Com_preload_keys ?
Com_prepare_sql ?
Com_purge ?
Com_purge_before_date ?
Com_release_savepoint ?
Com_rename_table ?
Com_rename_user ?
Com_repair ?
Com_replace ?
Com_replace_select ?
Com_reset ?
Com_resignal ?
Com_restart ?
Com_revoke ?
Com_revoke_all ?
Com_revoke_roles ?
Com_rollback ?
Com_rollback_to_savepoint ?
Com_savepoint ?
Com_select commands
Com_set_option ?
Com_set_password ?
Com_set_resource_group ?
Com_set_role ?
Com_signal ?
Com_show_binlog_events ?
Com_show_binlogs ?
Com_show_charsets ?
Com_show_collations ?
Com_show_create_db ?
Com_show_create_event ?
Com_show_create_func ?
Com_show_create_proc ?
Com_show_create_table ?
Com_show_create_trigger ?
Com_show_databases ?
Com_show_engine_logs ?
Com_show_engine_mutex ?
Com_show_engine_status ?
Com_show_events ?
Com_show_errors ?
Com_show_fields ?
Com_show_function_code ?
Com_show_function_status ?
Com_show_grants ?
Com_show_keys ?
Com_show_binary_log_status ?
Com_show_open_tables ?
Com_show_parse_tree ?
Com_show_plugins ?
Com_show_privileges ?
Com_show_procedure_code ?
Com_show_procedure_status ?
Com_show_processlist ?
Com_show_profile ?
Com_show_profiles ?
Com_show_relaylog_events ?
Com_show_replicas ?
Com_show_replica_status ?
Com_show_status ?
Com_show_storage_engines ?
Com_show_table_status ?
Com_show_tables ?
Com_show_triggers ?
Com_show_variables ?
Com_show_warnings ?
Com_show_create_user ?
Com_shutdown ?
Com_replica_start ?
Com_replica_stop ?
Com_group_replication_start ?
Com_group_replication_stop ?
Com_stmt_execute ?
Com_stmt_close ?
Com_stmt_fetch ?
Com_stmt_prepare ?
Com_stmt_reset ?
Com_stmt_send_long_data ?
Com_truncate ?
Com_uninstall_component ?
Com_uninstall_plugin ?
Com_unlock_instance ?
Com_unlock_tables ?
Com_update commands
Com_update_multi commands
Com_xa_commit tx
Com_xa_end tx
Com_xa_prepare tx
Com_xa_recover tx
Com_xa_rollback tx
Com_xa_start tx
Com_stmt_reprepare ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request receiver/mysql
Projects
None yet
Development

No branches or pull requests

3 participants