Code Monkey home page Code Monkey logo

pit-wall-api's Introduction

Pitwall API

This API exposes a Metrics endpoint to allow a prometheus instance to retrieve data.

Installation

Requirements

  • Works on Azure B1 Standard Virtual Machine

Compiling sources

docker build -f src/PitWallDataGatheringApi/PitWallDataGatheringApi/Dockerfile -t pitwalldatagatheringapi src/PitWallDataGatheringApi

Create the container

  • Go the container folder
  • Configure then simerkey Simer key in configuration
    • Send the simerkey to the people you wish to have the data sent from
  • Run the following command :
docker compose up -d

At this point should have a running container with

  • a Grafana instance
  • a Prometheus instance
  • a Pitwall API instance

Exploitation

What are the data available ?

The API is self documented by SWAGGER on one hand, and a documentation endpoint on the other hand. Swagger Snapshot - 2023-11-13

End points description

Endpoint name Description
/api/v1/ApiHealthCheck Used by the caller to check whether the API is here.
/api/v1/SeriesDocumentation The description of each series being exposed to Prometheus
/api/v1/Telemetry The endpoint to post telemetry to.

The contract documentation is generated by swagger itself.

At minimum there are two mandatories fields in Telemetry model :

  • Simerkey : The key to be able to post metrics to the API.
  • Pilot Name : The pilot name is used to break series by pilot.

Forget one of these, and you'll be toss out immediately.

Limitations

Security

Althought the API has a simerkey to avoid being data poisoning, it do not have a embed DDOS security.

The system has been made very light to run almost anywhere without having coupling to an authentication system for now.

It should not be left active all the time because no advanced pentesting has been made.

Prometheus instance is not user password secured for reading data. That is a prometheus limitation. Therefore, you have to secure its access using port mapping and network filter.

Disk space

I currently have not metrics about the growth of the disk space.

It works on a Standard B1 on Azure.

See also

pit-wall-api's People

Contributors

macreiben-dev avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

pit-wall-api's Issues

Break metrics by car

In endurance races, dashboarding is made by cars.

So we have to create one board to each car.

For each metrics we should have

  • Pilot
  • All
  • Car

See the live leaderboard

Create a new leaderboard controller

Les informations requises sont :

  • DriverName
  • CarNumber
  • LastLapTime
  • IntervalGap
  • PitCount
  • InPitBox
  • InPitLane

Dans le système, le filtrage rester basé sur 2 labels : Car et Pilot.

Annexe

GarySwallowDataPlugin.Leaderboard.Position10.DriverName

GarySwallowDataPlugin.Leaderboard.Position10.CarClass
GarySwallowDataPlugin.Leaderboard.Position10.CarNumber

GarySwallowDataPlugin.Leaderboard.Position10.LastLap
GarySwallowDataPlugin.Leaderboard.Position10.LastPitLap

GarySwallowDataPlugin.Leaderboard.Position10.LastSector1
GarySwallowDataPlugin.Leaderboard.Position10.LastSector2
GarySwallowDataPlugin.Leaderboard.Position10.LastSector3

GarySwallowDataPlugin.Leaderboard.Position10.DQ
GarySwallowDataPlugin.Leaderboard.Position10.DNF

GarySwallowDataPlugin.Leaderboard.Position10.IntervalGap

GarySwallowDataPlugin.Leaderboard.Position01.PitCount

GarySwallowDataPlugin.Leaderboard.Position10.InGarage
GarySwallowDataPlugin.Leaderboard.Position10.InPitBox
GarySwallowDataPlugin.Leaderboard.Position10.InPitLane

Create releases for each success full deployment

As of now, there are no test environment for the API since it's a very small project.

I decided to snapshot all successfull deployment meaning :

  • build + unit tests ok
  • docker compose ok on target

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.