I want to view server logs and traces with Grafana, but when I look for them, they all tell me to just set up a configuration file and launch a node in Kubernates, so there is a starter for people who don't feel like giving up.
grafana-otel-lgtm allows you to easily launch Loki, Grafana, Tempo, and Mimir locally without any configuration.
The grafana/otel-lgtm Docker image comes with OpenTelemetry Collector, Prometheus, Loki, Tempo, and Grafana preset as default settings.
It is easy to understand if you look at the picture below.
The application sends it to port 4317 (grpc) or 4318 (http) using the OTLP protocol.
The Opentelemetry Collector is listening to the port, collects it, and transmits it to Prometheus for Metric, Loki for Log, and Tempo for Trace depending on the type of signal.
Prometheus, Loki, and Tempo store signals in their respective storage.
Connect to Grafana at localhost:3000 and visualize the accumulated data through queries.
It is simple to key locally.
docker pull grafana/otel-lgtm
#!/bin/bash RELEASE=${1:-latest} docker run \ --name lgtm \ -p 3000:3000 \ -p 4317:4317 \ -p 4318:4318 \ --rm \ -ti \ -v $PWD/container/grafana:/data/grafana \ -v $PWD/container/prometheus:/data/prometheus \ -v $PWD/container/loki:/loki \ -e GF_PATHS_DATA=/data/grafana \ docker.io/grafana/otel-lgtm:${RELEASE}
sh run-lgtm.sh WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested Waiting for the OpenTelemetry collector and the Grafana LGTM stack to start up...
When I run it on an Apple silicon MacBook, the warning above appears, but it doesn't really matter since I'm using it locally for testing.
(You can check that ports 3000, 4317, and 4318 are open)
Let’s connect to localhost:3000.
You can log in as admin/admin.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3