1. An optical module adapted to operate in an optical network to perform one or more optical functions therein, the optical module comprising: optical components adapted to perform the one or more optical functions; processing circuitry communicatively coupled to the optical components and adapted to obtain data from operation of the optical components; and compute resources located in the optical module along with the processing circuitry and the optical components and adapted to receive an application for local execution on the compute resources in a sandboxed manner, and analyze, by the application, the data to perform one or more analysis functions locally on the data, wherein the data is any of Performance Monitoring (PM) data, received optical symbols, corrected optical symbols, polarization related data, and Bit Error Rate (BER).