A system is described that can detect, track and analyze a bubble of a secondary substance contained within a primary substance along a part of a fluid line. For example, the system can detect the presence of the bubble within the primary substance along the part of the fluid line, which can include assigning a digital signature to the bubble. In addition, the system can track the movement of the bubble in order to ensure that the bubble is accounted for only once as it passes through the part of the fluid line. Furthermore, the system can analyze the bubble, such as determine its direction of travel, speed of travel, volume and size.