Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metrics Microservice + VictoriaMetrics

This service provides a minimal HTTP API that interacts with a VictoriaMetrics instance. The stack is fully containerized using Docker Compose.

Prerequisites

  • Docker and docker-compose installed

Installation

1. Clone the repository

git clone git@github.com:SensorWave/metrics-service.git
cd metrics-service

2. Run the docker containers

docker-compose up --build

3. Access VictoriaMetrics UI

Once running, access the built-in UI:

API Overview

The microservice exposes a small HTTP interface. Full API documentation is available in documentation/api/.

Example Endpoint

POST /metrics
Content-Type: application/json
{
    "metric": "temperature",
    "value": 24.8,
    "tags": {"company_id": "google", "sensor_id": "sensor_42"}
}

Response

200 OK

Configuration

Environment Variables

The service supports configuration through environment variables (set in docker-compose.yml).

Variables:

  • VM_URL – VictoriaMetrics base URL

Adjust these in the compose file as needed.

How to Run Tests

Tests are executed directly inside the Go module.

Run all tests

cd metrics-service
go test ./...

File Structure

.
├── documentation/
│   ├── api/
│   └── architecture/
├── metrics-service/
│   ├── .gitignore
│   ├── Dockerfile
│   ├── go.mod
│   ├── go.sum
│   └── main.go
├── victoria-metrics/
│   ├── .gitignore
│   └── data/
├── docker-compose.yml
└── README.md

Conventions

The project follows the following conventions:

Useful Documentation

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages