feat: integrate grafana loki#61
Merged
Dejmenek merged 5 commits intoMay 15, 2026
Merged
Conversation
Expanded README to include Loki as part of the observability stack alongside Prometheus and Grafana. Clarified that the API exports logs to Loki via Serilog's OpenTelemetry sink. Updated Docker Compose service list and Grafana setup instructions to include Loki as a data source.
Added a complete loki.yml for deploying Loki with filesystem-based storage. Config disables authentication, enables structured metadata, sets server to listen on port 3100, uses in-memory ring for single-instance mode, and configures TSDB schema with local directories for index and chunk storage under /tmp/loki.
Added Serilog.AspNetCore, Serilog.Extensions.Logging, and Serilog.Sinks.OpenTelemetry to project dependencies for enhanced logging and OpenTelemetry export support. Updated packages.lock.json with all required transitive dependencies. No packages were removed or downgraded.
Added a Loki service using the grafana/loki:latest image to docker-compose.yml. The service exposes port 3100, mounts configuration and data volumes, and uses a custom config file. Also introduced a named Docker volume for Loki data persistence.
Switched to .CreateBootstrapLogger() for early logging during startup. Integrated Serilog.Sinks.OpenTelemetry to export logs to an OTLP endpoint (http://localhost:3100/otlp) using HTTP Protobuf protocol. Set the service name to "TournamentAPI" for log resource attributes. Added the required using statement for Serilog.Sinks.OpenTelemetry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Loki to the observability stack and configures the API to export logs to Loki via Serilog's OpenTelemetry sink. Documentation is updated to reflect these changes.
Changes
docker-compose.ymland newloki.yml: Add and configure Loki service for log aggregation.Program.cs: Configure Serilog to export logs to Loki using the OTLP protocol.TournamentAPI.csprojand central package files: Add Serilog OpenTelemetry sink and related dependencies.README.md: Update instructions and documentation for Loki integration and Grafana data sources.