Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/techsavvyash/loki-utils
Loki Testing Utils for BHASAI
https://github.com/techsavvyash/loki-utils
grafana loki nestjs python
Last synced: 25 days ago
JSON representation
Loki Testing Utils for BHASAI
- Host: GitHub
- URL: https://github.com/techsavvyash/loki-utils
- Owner: techsavvyash
- Created: 2024-09-11T16:20:25.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-26T12:16:55.000Z (26 days ago)
- Last Synced: 2024-11-26T13:25:13.028Z (26 days ago)
- Topics: grafana, loki, nestjs, python
- Language: TypeScript
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Loki Logger
This repository is a reference repository to configuring a logger which can send logs to Loki with structured metadata enabled in your application.
## NestJS
Refer: [nestjs](./nestjs/)
This folder contains a small reference NestJS application which configures the Loki Logger to send logs to Loki with structured metadata.
TL;DR: Copy the [nestjs/src/logger](./nestjs/src/logger/) folder in your app.
Configure the logger in you `app.module.ts` similar to [app.module.ts](./nestjs/src/app.module.ts)and voila!
## Python
Refer: [python](./python/)
This folder contains a small reference Python application which configures the Loki Logger to send logs to Loki with structured metadata.
## Running the samples locally
1. Start the loki and grafana instances with promtail
```bash
cd docker-loki
docker-compose up -d
```### For NestJS
2. Navigate to the `nestjs` folder and install the dependencies
```bash
cd nestjs
npm install
```3. Run the application
```bash
npm run start
```### For Python
2. Navigate to the `python` folder and install the dependencies
```bash
cd python
pip install -r requirements.txt
```3. Run the application
```bash
python main.py
```