---
title: "Deploy Grafana OpenTelemetry Stack"
description: "One-click Grafana/OTLP stack deployment"
category: "Observability"
url: https://railway.com/deploy/faP63Y
---

# Deploy Grafana OpenTelemetry Stack

One-click Grafana/OTLP stack deployment

**[Deploy Grafana OpenTelemetry Stack on Railway](https://railway.com/template/faP63Y)**

- **Creator:** Weldon W
- **Category:** Observability
- **Total deploys:** 22

## Template content

### Grafana

- **Source:** wangxued/do-opentelemetry-collector
- **Public domain:** Yes

### Prometheus

- **Source:** wangxued/do-opentelemetry-collector
- **Public domain:** Yes

### Loki

- **Source:** wangxued/do-opentelemetry-collector

### Tempo

- **Source:** wangxued/do-opentelemetry-collector

### Otel-Collector

- **Source:** wangxued/do-opentelemetry-collector
- **Public domain:** Yes

## Documentation

# Deploy and Host Grafana-OpenTelemetry Stack on Railway

The Grafana-OpenTelemetry Stack is a pre-configured collection of Grafana, OpenTelemetry Collector, and essential data sources (Tempo/Prometheus/Loki) for one-click deployment. This OTLP-based technology stack provides simple, direct access to application-layer telemetry data, enabling comprehensive observability with minimal setup.

## About Hosting Grafana-OpenTelemetry Stack

Hosting this stack involves deploying a unified observability solution that integrates Grafana's visualization capabilities with OpenTelemetry's data collection. The stack includes Tempo for traces, Prometheus for metrics, and Loki for logs - all connected through the OpenTelemetry Collector. Once deployed, applications can be configured to send telemetry data to the collector endpoint, which processes and routes information to the appropriate backends. Railway manages the infrastructure complexity while providing automatic scaling and secure private networking between services.

## Common Use Cases

- Centralized observability for distributed systems
- End-to-end tracing and performance monitoring
- Unified metrics, logs, and traces correlation
- Rapid prototyping of observability stacks

## Dependencies for Grafana-OpenTelemetry Stack Hosting

- Applications instrumented with OpenTelemetry SDKs


### Deployment Dependencies

- [OpenTelemetry Security Config Best Practices](https://opentelemetry.io/docs/security/config-best-practices/)
- [OpenTelemetry Collector Deployment](https://opentelemetry.io/docs/collector/deployment/agent/)
- [Grafana OpenTelemetry Instrumentation](https://grafana.com/docs/opentelemetry/instrument/grafana-java/)
- [Grafana Cloud OpenTelemetry Setup](https://grafana.com/docs/grafana-cloud/send-data/otlp/send-data-otlp/#recommended-opentelemetry-setup-via-grafana-cloud-integrations)

### Implementation Details

Configure these OTEL_* environment variables as Shared Variables in Railway:

```env
OTEL_TRACES_EXPORTER="otlp"
OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
```

Then set these variables in your application services:

```env
OTEL_EXPORTER_OTLP_ENDPOINT="http://${{Otel-Collector.RAILWAY_PRIVATE_DOMAIN}}:4318"
OTEL_EXPORTER_OTLP_PROTOCOL="${{shared.OTEL_EXPORTER_OTLP_PROTOCOL}}"
OTEL_TRACES_EXPORTER="${{shared.OTEL_TRACES_EXPORTER}}"
OTEL_SERVICE_NAME="${{RAILWAY_SERVICE_NAME}}"
OTEL_RESOURCE_ATTRIBUTES="service.namespace=${{RAILWAY_PROJECT_NAME}},deployment.environment=${{RAILWAY_ENVIRONMENT_NAME}}"
```

**Example of Java service Dockerfile:**

```dockerfile
FROM maven:3.9-amazoncorretto-23 AS builder
ARG GITHUB_USER
ARG GITHUB_TOKEN

WORKDIR /app
COPY pom.xml ./
COPY settings.xml ./
COPY src ./src

RUN mvn clean install -U -s settings.xml &amp;&amp; \
    mvn package -Dmaven.test.skip=true -s settings.xml

FROM openjdk:23-jdk-slim
ARG GRAFANA_OTEL_VERSION=v2.15.0
ENV GRAFANA_OTEL_JAR=grafana-opentelemetry-java-${GRAFANA_OTEL_VERSION}.jar

WORKDIR /app
COPY --from=builder /app/target/*.jar app.jar

# Install curl, download the agent and clean up
RUN apt-get update &amp;&amp; \
    apt-get install -y curl &amp;&amp; \
    curl -s -L https://github.com/grafana/grafana-opentelemetry-java/releases/download/${GRAFANA_OTEL_VERSION}/grafana-opentelemetry-java.jar \
     -o ${GRAFANA_OTEL_JAR} &amp;&amp; \
    apt-get purge -y --auto-remove curl &amp;&amp; \
    rm -rf /var/lib/apt/lists/*

CMD ["sh", "-c", "java -Xms128m -Xmx1024m -javaagent:${GRAFANA_OTEL_JAR} -jar app.jar"]
```

## Why Deploy Grafana-OpenTelemetry Stack on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Grafana-OpenTelemetry Stack on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Pyroscope profiling](https://railway.com/deploy/pyroscope-profiling) — Protected continuous profiling with durable Pyroscope storage.
- [SigOnly](https://railway.com/deploy/sigonly) — Deploy SigNoz with a working demo app & config in one click
- [Unwrapped Spotify Music Stats](https://railway.com/deploy/wide-bold) — Unwrapped Spotify Music Stats, Estatísticas de músicas disponíveis

Open this page in a browser: https://railway.com/deploy/faP63Y
