The below description is outdated.
As a platform user I would like to have a very basic sample application that would demonstrate Kaa Logging extension functionality with detailed description. The application must be available in all supported languages and illustrate the use of Data collection management APIs on the client side, as well as the use of Administrative UI and the REST interfaces for managing Log schemas and Log appenders.
h1. Scenario description
This application bundle will demonstrate capability to collect measurements from temperature sensor from the client into MongoDB. The Log schema will contain temperature and time-stamp properties:
The client application will be generating log records, send them to server and printing log delivery status for every particular log record.
The application will use MongoDB Log appender and trustful credentials service for simplicity. User will be able to observe delivered data on live dashboard in a separate specially developed web application on the Sandbox VM.
This demo also contains configuration schema to control the log count threshold in Log upload strategy (how many log records must be collected before send them to Kaa node):
The default log count threshold is 1. It means that every added log will be sent immediately. Use Administrative UI for managing Log upload threshold: just change the threshold value in corresponding configuration inside All group.
h2. Scenario flow
In this application we have a few components:
# Client application
# Kaa node
# Separate web app for log delivery visualization
and next demonstration scenario:
# User starts the Client application.
# Client application: sends log records with randomly generated values of temperature in an infinite loop, receives log delivery confirmation and prints it to the console.
# Web app connects to DB to fetch data for time line diagram rendering
# User goes to Web app to ensure that log records were saved
List of links on documentation that must be present in application description:
h1. Proposed description for application inside sandbox (incomplete)
This bundle contains applications that demonstrates capabilities of the Kaa Logging subsystem.
(paste here more "water" about how important this feature is for IoT network)
The Kaa Logging subsystem allows to collect log records of pre-configured structure from the endpoints, periodically transferring these logs from endpoints to Operation servers, and, finally, either persisting them on the server for further processing or submitting them to immediate stream analysis.
The Kaa logs structure is determined by the configurable log schema. In this demonstration application we are gathering values of measurements from some temperature sensor and saving them into MongoDB. Data format for log records we have defined by the next schema:
You can find this schema in Administrative console - log in as a tenant developer (devuser / devuser123), and navigate to the "Data collection demo" application.
Than you need to select "Schemas" and than "Log". Here you can find list of available schemas for your application.
As you may guess "Log schema" - is the schema that we used in this demo. If you click on it to overview the structure of schema.
Also we are using MongoDB Log appender, Log appenders are responsible for writing logs received by the Operations server into specific storage systems. If you choose "Log appenders" tab in Administrative console you will finds the list of log appenders for your application.
And if you click on "Data collection log appender" you will find configuration page for given appender, where you can for example change database host.
Configuration for this Log appender you can find in our GitHub repository.
Also in endpoint application we are setting Log upload strategy. We selected RecordCountLogUploadStrategy with threshold 1 - following this strategy endpoint will be sending every log record separately. For more information refer to documentation.
So lets consider whats going on in this application.
h2. Playing around
Playing around section: must contain some examples for modification of the given application. For example, provide description how to modify Log record schema or how to add REST Log appender and send data on web service, provide links for other Log appenders and short overview of their abilities.
Also provide some information about the ways to fetch data from databases.
# Use configuration feature for managing Log upload threshold: you can control upload strategy threshold using Configuration feature. Just change threshold value for the appropriate configuration in group "All" and activate it. You can also load new configuration from file. The file format must be:
Demo application is already subscribed on configuration updates and you can see changed logs upload threshold immidietly in running application.
# Add extra Log appender, for example REST log appender, first without "confirm delivery" option enabled (we have no any web app that will consume this logs) to demonstrate that application will ignore fails of REST log appender to save logs, and then with this option enabled - demonstrate that endpoint wouldn't delete any logs until REST appender succeed to persist logs.
h2. What's next?
For more background on the Kaa Logging subsystem, you can check out "Cell monitor demo" and also refer to the corresponding programming guide and design reference sections.