Performance analysis on a conventional distributed system consisting of a static (usually homogeneous) pool of computational resources comprises various techniques related to instrumentation, data collection, measurement, analysis and visualization. However, in a heterogeneous, dynamic environment, like grid, post-mortem analysis is of no use and data needs to be collected and analyzed in real time. Novel techniques are also required for dynamically tuning the application's performance and resource brokering in order to maintain the desired QoS. The objective of this paper is to present an agent framework for performance monitoring and analysis of applications running in grid environment and implementation of local tuning techniques for improving their performances. Results of a preliminary implementation are also presented in order to demonstrate the effectiveness of the agent framework.