Skip to content

logreposit/logreposit-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Logreposit API Logo

logreposit-api

Unified monitoring platform for time-series data collection and processing

Branch Build Status Code Coverage
master CircleCI codecov
develop CircleCI codecov

Table of Contents


πŸ“‹ Service Description

Logreposit API is a unified monitoring platform for collecting and processing time-series data from various sources, including, for example:

Source Type Examples Use Cases
Energy Systems Photovoltaic systems energy efficiency
Heating Systems heating controllers energy efficiency, problem debugging, proactive alerting
Smart Home Devices IoT sensors, thermostats Home automation, climate control
Industrial Controllers Equipment monitoring Multi-location device (e.g. PLC) monitoring

Key Features

  • πŸš€ REST API endpoints for data ingestion and device/user management
  • πŸ”„ Real-time MQTT support for streaming data
  • πŸ“Š Time-series storage with InfluxDB backend

where data can be then visualized e.g. with

  • πŸ“ˆ Grafana dashboards for visualization and alerting

πŸ—οΈ Architecture

This service supports three operational modes that can be enabled independently:

graph TB
    A[Client Applications] --> B[INGRESS Mode]
    B --> C[Message Queue]
    C --> D[PROCESSOR_MQTT Mode]
    C --> E[PROCESSOR_INFLUX Mode]
    D --> F[MQTT Broker]
    E --> G[InfluxDB]
Loading
Mode Description Purpose
🌐 INGRESS REST API endpoints Data collection and device management
πŸ“‘ PROCESSOR_MQTT MQTT message processing Real-time data streaming
πŸ—„οΈ PROCESSOR_INFLUX Time-series storage InfluxDB data persistence

For production-grade setups, you should run different modes in separate deployments. The logreposit-api per default has all modes enabled, but using the APP_MODES_ENABLED environment variable, you can specifically control which components are loaded on startup.

See the βš™οΈ Configuration Reference section below.

πŸš€ Quick Start

πŸ“‹ Prerequisites

The logreposit-api software ships as a docker image. You need some container orchestration system such as docker or Kubernetes to run it.

Requirement Version Purpose
🐳 Container Orchestration Engine - Container orchestration engine such as docker-compose or k8s
β˜• Java 25+

βš™οΈ Configuration Reference

πŸŽ›οΈ Application Modes

Configure which components to enable:

Environment Variable Default Description
APP_MODES_ENABLED ingress,processor_mqtt,processor_influx Comma-separated list of modes to enable

Available modes:

  • ingress - REST API endpoints for data collection and user/device management
  • processor_mqtt - MQTT message processing
  • processor_influx - InfluxDB integration

πŸ”— Core Dependencies

Environment Variable Default Description
SPRING_MONGODB_HOST localhost MongoDB hostname
SPRING_MONGODB_PORT 27017 MongoDB port
SPRING_MONGODB_DATABASE logrepositapi MongoDB database name
SPRING_RABBITMQ_HOST localhost RabbitMQ hostname
SPRING_RABBITMQ_PORT 5672 RabbitMQ port
SPRING_RABBITMQ_USERNAME guest RabbitMQ username
SPRING_RABBITMQ_PASSWORD guest RabbitMQ password

πŸ—„οΈ InfluxDB Configuration (PROCESSOR_INFLUX mode)

Environment Variable Default Description
INFLUXDB_URL http://localhost:8086 InfluxDB URL
INFLUXDB_USERNAME admin InfluxDB username
INFLUXDB_PASSWORD admin InfluxDB password

πŸ“‘ MQTT Configuration (PROCESSOR_MQTT mode)

Currently, only the EMQX MQTT broker is supported.

Environment Variable Default Description
MQTT_ENABLED true Enable MQTT functionality
MQTT_HOST 127.0.0.1 MQTT broker hostname
MQTT_PORT 1883 MQTT broker port
MQTT_USERNAME administrator MQTT broker username
MQTT_PASSWORD administrator1 MQTT broker password
MQTT_EMQX_MANAGEMENTENDPOINT http://127.0.0.1:18083 EMQX management API endpoint

πŸ”§ Application Settings

Environment Variable Default Description
SERVER_PORT 8080 HTTP server port
LOGGING_FILE_NAME logs/logreposit-api.log Log file location

πŸ”Œ API Usage

After startup you can access the OpenAPI Swagger documentation at http://<host>:<port>/reference/index.html.

πŸ₯ Health Monitoring

The service exposes health and metrics endpoints:

Endpoint URL Purpose
πŸ’š Health http://localhost:8080/actuator/health Service health status
πŸ“Š Metrics http://localhost:8080/actuator/prometheus Prometheus metrics
ℹ️ Info http://localhost:8080/actuator/info Application information

πŸ› οΈ Troubleshooting

πŸ“‹ Logging

Adjust log levels via environment variables:

Component Environment Variable Recommended Level
Application LOGGING_LEVEL_COM_LOGREPOSIT DEBUG (dev), INFO (prod)
Spring Framework LOGGING_LEVEL_ORG_SPRINGFRAMEWORK WARN
LOGGING_LEVEL_COM_LOGREPOSIT=DEBUG
LOGGING_LEVEL_ORG_SPRINGFRAMEWORK=WARN

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -am 'Add new feature'
  4. Push to the branch: git push origin feature/my-feature
  5. Submit a pull request

Note: Please ensure your code follows the existing style and includes appropriate tests.

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Logreposit API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages