Practical DevOps for Big Data/Trace Checking
Trace checking is an approach for the analysis of system executions that are recorded as sequences of timestamped events. Collected logs are analyzed to establish whether the system logs satisfy a property, usually specified in a logical language; in the positive case, the sampled system behavior conforms with the constraints modeled by the property.
When the language that is used to specify properties allows temporal operators, trace checking is a way to check the correctness of the ordering of the events occurring in the system and of the time delays between pairs of events. For instance, if property requires that all the emitting events of a certain node occur not more than ten millisecond after the latest receive event, then checking the property over a trace results in a boolean outcome which is positive if the distance between two consecutive and ordered pair of emit and receive events is less than ten milliseconds.
The tool that is available in DICE to perform trace-checking (of Storm applications) is DICE-TraCT.
Trace checking is especially useful when the aggregated data that are available from the monitoring system are not enough to conclude the correctness of the system executions with respect to some specific criteria. In some cases, in fact, these criteria are application dependent as they are related to some non-functional property of the application itself and they do not depend on the physical infrastructure where the application is executed.
Trace checking is a possible technique to achieve this goal and can be used on purpose to extract information from the executions of a running application.
Logical languages involved in the trace checking analysis are usually extensions of metric temporal logics which offer special operators called aggregating modalities. These operators hold if the trace satisfies particular quantitative features like, for instance, a specific counting property of events in the trace. DICE-TraCT uses Soloist which offers the following class of aggregating modalities:
- number of occurrences of an event e in a time window of length d,
- maximum/average number of occurrences of an event e, aggregated over right-aligned adjacent non-overlapping subintervals (of size h) in a time window of length d,
- average time elapsed between a pair of specific adjacent and alternating events e ande' occurring in a time window of length d.
According to the DICE vision, trace checking is performed after verification to allow for continuous model refinement. The result obtained through the log analysis confirms or refutes the outcome of the verification task, which is run at design time. The value of the parameters in the design-time model is compared with the value at runtime; if both are “compatible” then the results of verification are valid, otherwise the model must be refined.
The research area related to runtime verification is very active on trace-checking. Various are the tools that support trace-checking and that provide either on-line or off-line analysis. Trace-checking in DICE is applied off-line but further extensions to the framework might consider also on-line analysis to improve the model-driven refinement that designers can perform. As far as the team knowledge, DICE is (one of) the first attempt which uses trace-checking analysis for supporting model-driven development of DIA. Trace-checking engines are tools that can be used in the assessment process and the choice of a specific one depends on the kind of analysis that designers wants to achieve. The international Competition on Runtime Verification is the best reference to consider to compare available tools and techniques. Some of the tools that were involved in the competition and that might be considered as alternative to the ones used and implemented in DICE are the following:
How the tool works
The outcome of the trace-checking analysis is used for refining the model of the application at design time that is verified with D-VerT.
Trace-checking is performed at run-time but it is based on annotated DTSM models, defined at design-time, that contain the topology undergoing the analysis.
The trace-checking process
Trace-checking is performed after verification. Based on the kind of the analysis (counting, average or quantitative) and the structure of the topology, DICE-TraCT retrieves the logs from the monitoring platform (D-Mon) and performs the analysis. Finally, when the outcome is available, the result is shown in the DICE IDE.
DICE-TraCT has a client server architecture: the client component is an Eclipse plugin that is fully integrated with the DICE IDE and the server component is a RESTful web server. The client component manages the transformation from the DTSM model defined by the user to an intermediate JSON object which is then used to invoke the server. The server component, based on the content of the JSON file generates the trace-checking instance for the trace-checking engine.
DICE-TraCT is an Eclipse plugin that can be executed within the integrated DICE framework. To carry out the trace-checking analysis, Storm topologies have to be specified by means of UML class diagrams and activity diagrams with the DICE::Storm profile. The diagrams can easily be drawn by dragging and dropping Eclipse items that are available in the DICE toolbars whereas the annotations can be specified in the bottom panel of the DICE IDE.
DICE-TraCT can be set through a suitable Run Configuration window allowing users to launch the analysis. The user can specify:
- the file containing the model undergoing the analysis,
- the time bound limiting the duration of the time window that is analyzed,
- the set of bolts and spouts whose metrics (sigma and avg_emit_rate) will be calculated by means of the topology logs,
- the IP address and the port where the DICE-TraCT server is running and
- the IP address and the port of the monitoring platform.
Trace-checking of application logs can be achieved successfully when logs contain suitable entries that enable the evaluation of temporal formulae or metrics. When the property to be checked only refers to events of the application that are tracked by the monitoring service of the data-intensive platform which runs the application, trace-checking can be employed simply by defining the property (or metric) to assess and by running the trace-checker on a selected log history. On the other hand, when the property to be checked refers to application events that are not natively monitored by the framework, trace-checking requires an ad-hoc instrumentation of the application code that allows the monitoring service to log those application-specific events needed for the evaluation of the property of interest.
DICE-TraCT currently supports Storm logs analysis.
The current implementation of DICE-TraCT enables the analysis of two distinct parameters which are tightly related to the verification analysis carried out by D-VerT. In particular, the two available metrics that DICE-TraCT can elaborate are:
- avg_emit_rate that is the emitting rate of a spout node, defined as the number of tuple emitted per second, and
- sigma that is the ratio between the number of tuples produced by a bolt node in output and the number of tuples that it has received in input.
The value of the metrics that is obtained by trace-checking helps designers in tuning the model used for verification with D-VerT.
The trace-checking analysis can be restricted only to a specific time window and consider only the log entries that occur in a limited amount of time. The size determines how many log events are considered to carry out the evaluation of the metrics (The unit measurement is the millisecond).
DICE-TraCT implements three different kind of analysis calculating the metrics. Each one depends on the features of the underlying engines that are used to analyze the logs. Logical languages involved in the trace checking analysis are usually extensions of metric temporal logics which offer special operators called aggregating modalities. These operators are useful to count events in the logs or calculate the average number of the occurrences over a certain time window and compare the value with a given threshold. Therefore, the outcome of the analysis is always a boolean answer that can be either yes or no. DICE-TraCT is based on Soloist but the current implementation of DICE-TraCT can also call a simpler trace-checker than the one for Soloist, that is developed to provide quantitative informations calculated from the logs.
The following kind of analysis are available:
- counting: it enables the evaluation of the selected metric by means of the so called Counting formulae of the Soloist logic. This choice will call the Soloists trace-checker.
- average: it enables the evaluation of the selected metric by means of the so called Average formulae of the Soloist logic. This choice will call the Soloists trace-checker.
- quantitative: it enables the quantitative analysis of the logs which extracts the value of the metric.
The analysis instantiated by the Soloist trace checker is designed to provide a boolean result that is calculated by comparing the number of occurrences of an event in the log with a user defined threshold. The relations <, = and > and the threshold value can be specified via an appropriate configuration window when DICE-TraCT is launched.
A test case - Wikistats
DICE-TraCT is an Eclipse plugin that can be executed within the integrated DICE framework. To carry out log analysis, Storm topologies have to be specified by means of UML class diagrams and activity diagrams. The diagrams can easily be drawn by dragging and dropping Eclipse items that are available in the DICE toolbars whereas the annotations can be specified in the bottom panel of the DICE IDE.
DICE-TraCT can be set through a Run Configuration window allowing users to launch the analysis. The user can specify:
- the file containing the model undergoing the analysis,
- the Storm componenents undergoing analysis,
- the IP address and the port where the DICE-TraCT server is running.
The analysis allows for the extraction of model parameters related to verification, i.e., values that are used in the formal model analysed by D-VerT. DICE-TraCT extracts the following parameter values:
- sigma: ratio between number of tuples emitted by a bolt and number of tuples received by the bolt.
- alpha: average time required to elaborate a tuple by a bolt.
- emit rate: average emit rate of a spout.
Next figure shows the run configuration for DICE-TraCT and the list of the components defining the Wikistats topology.
DICE-TraCT has been developed to perform log analysis of Storm applications. It is used to assess the runtime behavior of a deployed application as log traces collected from the monitoring platform are analyzed to certify the adherence to the behavioral model that is assumed at design time. If the runtime behavior does not conform to the design, then the design must be refined and later verified to obtain a new certification of correctness. Trace-checking can be applied to supply information to the verification task carried out by D-VerT. Trace checking extracts from real executions the parameter values of the model used by D-VerT that are not available from the monitoring service of the framework, as they are inherently specific of the modeling adopted for the verification.