# Self-host Grafana OTel LGTM

> An all-in-one OpenTelemetry backend with an OTLP collector, Loki logs, Tempo traces, Prometheus metrics and Grafana in one container. The Grafana admin password is generated at install. OTLP ports are not published on the host, so send telemetry from other services in this project to otel-lgtm:4317 (gRPC) or otel-lgtm:4318 (HTTP).

- Page: https://levelrail.com/templates/otel-lgtm/
- JSON: https://levelrail.com/templates/otel-lgtm.json
- Category: Monitoring
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/grafana/docker-otel-lgtm
- Upstream docs: https://grafana.com/docs/opentelemetry/docker-lgtm/

## Requirements
- Memory: about 1 GiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 0.40.0

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| otel-lgtm | grafana/otel-lgtm | 0.40.0 | 3000, 4317, 4318 | otel_lgtm_data -> /data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| otel-lgtm | GF_SECURITY_ADMIN_PASSWORD | generated |
| otel-lgtm | GF_SECURITY_ADMIN_USER | preset |
| otel-lgtm | TZ | preset |

## Deploy

### CLI

```bash
levelrail-cli templates install otel-lgtm --name my-otel-lgtm
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain otel-lgtm=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/otel-lgtm/install \
  -d '{
    "name": "my-otel-lgtm"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## First run
1. Sign in to Grafana as admin with the generated password from the app secrets.

## Questions

### Can I deploy Grafana OTel LGTM on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Grafana OTel LGTM, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image grafana/otel-lgtm:0.40.0 is what you deploy there.

Self-host Grafana OTel LGTM, Grafana OTel LGTM docker compose file, deploy Grafana OTel LGTM on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
