public void BeforeExecuteCommand(MySqlDataTraceCommand sqlCommand)
        {
            var peer = sqlCommand.DbServer;
            var span = ContextManager.CreateExitSpan(ResolveOperationName(sqlCommand), peer);

            span.SetLayer(SpanLayer.DB);
            span.SetComponent(ComponentsDefine.MySqlData);
            Tags.DbType.Set(span, "MySql");
            Tags.DbInstance.Set(span, sqlCommand.Database);
            Tags.DbStatement.Set(span, sqlCommand.SqlText);
        }
        private MySqlDataTraceCommand GetCommand(object driverIdObj, object cmd)
        {
            var command = new MySqlDataTraceCommand();

            if (_dbConn.TryGetValue((long)driverIdObj, out var database))
            {
                command.Database = database.Database;
                command.DbServer = database.Server;
            }

            command.SqlText = (cmd == null ? "" : cmd.ToString());
            return(command);
        }
        private static string ResolveOperationName(MySqlDataTraceCommand sqlCommand)
        {
            var commandType = sqlCommand.SqlText?.Split(' ');

            return($"{MySqlDataDiagnosticStrings.MySqlDataPrefix}{commandType?.FirstOrDefault()}");
        }