grafana-stack
Mimir as Dagger services for local development and testing. Each backendruns in single-binary / monolithic mode with optional caller-supplied
persistence and exposes both its native ingest API and an OTLP/HTTP
receiver. Plaintext is the only supported transport on every listener.
Installation
dagger install github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318Entrypoint
Return Type
GrafanaStack Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
func (m *MyModule) Example() *dagger.GrafanaStack {
return dag.
GrafanaStack()
}@function
def example() -> dagger.GrafanaStack:
return (
dag.grafana_stack()
)@func()
example(): GrafanaStack {
return dag
.grafanaStack()
}Types
GrafanaStack 🔗
GrafanaStack is the module entry point. Use the per-backend constructor functions (Loki, Tempo, Mimir) to obtain a service handle.
loki() 🔗
Loki configures a grafana/loki service running in monolithic mode with the OTLP HTTP ingester enabled and filesystem chunk/index storage rooted at the mounted data dir. Listens on :3100 plaintext.
registry defaults to docker.io. tag defaults to a known-good upstream version. configFile fully replaces the embedded default when supplied. storage, when non-nil, is mounted at /var/lib/loki for persistence; when nil, an ephemeral empty Directory is mounted instead.
Return Type
GrafanaStackLoki !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| registry | String ! | "docker.io" | Container registry hosting the grafana/loki image. |
| tag | String ! | "3.4.1" | Image tag for grafana/loki. |
| configFile | File | - | Loki YAML config; replaces the embedded default when supplied. |
| storage | CacheVolume | - | Persistence volume mounted at /var/lib/loki. When nil the data dir is ephemeral. |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
loki --registry string --tag stringfunc (m *MyModule) Example(registry string, tag string) *dagger.GrafanaStackLoki {
return dag.
GrafanaStack().
Loki(registry, tag)
}@function
def example(registry: str, tag: str) -> dagger.GrafanaStackLoki:
return (
dag.grafana_stack()
.loki(registry, tag)
)@func()
example(registry: string, tag: string): GrafanaStackLoki {
return dag
.grafanaStack()
.loki(registry, tag)
}mimir() 🔗
Mimir configures a grafana/mimir service in monolithic mode (the binary is invoked with -target=all). Multitenancy is disabled so callers can push and query without an X-Scope-OrgID header. Listens on :9009 plain HTTP, exposing both the Prometheus-compatible API and the OTLP HTTP metrics ingester at /otlp/v1/metrics.
registry defaults to docker.io. tag defaults to a known-good upstream version. configFile fully replaces the embedded default when supplied. storage, when non-nil, is mounted at /var/lib/mimir for persistence; when nil, an ephemeral empty Directory is mounted instead.
Return Type
GrafanaStackMimir !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| registry | String ! | "docker.io" | Container registry hosting the grafana/mimir image. |
| tag | String ! | "2.15.1" | Image tag for grafana/mimir. |
| configFile | File | - | Mimir YAML config; replaces the embedded default when supplied. |
| storage | CacheVolume | - | Persistence volume mounted at /var/lib/mimir. When nil the data dir is ephemeral. |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
mimir --registry string --tag stringfunc (m *MyModule) Example(registry string, tag string) *dagger.GrafanaStackMimir {
return dag.
GrafanaStack().
Mimir(registry, tag)
}@function
def example(registry: str, tag: str) -> dagger.GrafanaStackMimir:
return (
dag.grafana_stack()
.mimir(registry, tag)
)@func()
example(registry: string, tag: string): GrafanaStackMimir {
return dag
.grafanaStack()
.mimir(registry, tag)
}tempo() 🔗
Tempo configures a grafana/tempo service running in monolithic mode with both OTLP receivers (gRPC :4317, HTTP :4318) enabled and local filesystem trace storage. Tempo’s HTTP query API listens on :3200.
registry defaults to docker.io. tag defaults to a known-good upstream version. configFile fully replaces the embedded default when supplied. storage, when non-nil, is mounted at /var/lib/tempo for persistence; when nil, an ephemeral empty Directory is mounted instead.
Return Type
GrafanaStackTempo !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| registry | String ! | "docker.io" | Container registry hosting the grafana/tempo image. |
| tag | String ! | "2.7.1" | Image tag for grafana/tempo. |
| configFile | File | - | Tempo YAML config; replaces the embedded default when supplied. |
| storage | CacheVolume | - | Persistence volume mounted at /var/lib/tempo. When nil the data dir is ephemeral. |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
tempo --registry string --tag stringfunc (m *MyModule) Example(registry string, tag string) *dagger.GrafanaStackTempo {
return dag.
GrafanaStack().
Tempo(registry, tag)
}@function
def example(registry: str, tag: str) -> dagger.GrafanaStackTempo:
return (
dag.grafana_stack()
.tempo(registry, tag)
)@func()
example(registry: string, tag: string): GrafanaStackTempo {
return dag
.grafanaStack()
.tempo(registry, tag)
}GrafanaStackLoki 🔗
Loki wraps a configured grafana/loki container. Use Service() to obtain the *dagger.Service for binding into other containers, and Endpoint() / OtlpHttpEndpoint() to derive client URLs.
image() 🔗
Image is the resolved /grafana/loki: reference.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
loki --registry string --tag string \
imagefunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
GrafanaStack().
Loki(registry, tag).
Image(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.grafana_stack()
.loki(registry, tag)
.image()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.grafanaStack()
.loki(registry, tag)
.image()
}configFile() 🔗
ConfigFile is the Loki YAML config: either the caller-supplied override or the embedded default staged into the module workdir.
Return Type
File ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
loki --registry string --tag string \
config-filefunc (m *MyModule) Example(registry string, tag string) *dagger.File {
return dag.
GrafanaStack().
Loki(registry, tag).
ConfigFile()
}@function
def example(registry: str, tag: str) -> dagger.File:
return (
dag.grafana_stack()
.loki(registry, tag)
.config_file()
)@func()
example(registry: string, tag: string): File {
return dag
.grafanaStack()
.loki(registry, tag)
.configFile()
}storage() 🔗
Storage is the optional persistence volume for /var/lib/loki. When nil the data dir is mounted as an empty Directory (ephemeral).
Return Type
CacheVolume ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
loki --registry string --tag string \
storagefunc (m *MyModule) Example(registry string, tag string) *dagger.CacheVolume {
return dag.
GrafanaStack().
Loki(registry, tag).
Storage()
}@function
def example(registry: str, tag: str) -> dagger.CacheVolume:
return (
dag.grafana_stack()
.loki(registry, tag)
.storage()
)@func()
example(registry: string, tag: string): CacheVolume {
return dag
.grafanaStack()
.loki(registry, tag)
.storage()
}endpoint() 🔗
Endpoint returns the Loki HTTP base URL, e.g. http://:3100.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
loki --registry string --tag string \
endpointfunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
GrafanaStack().
Loki(registry, tag).
Endpoint(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.grafana_stack()
.loki(registry, tag)
.endpoint()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.grafanaStack()
.loki(registry, tag)
.endpoint()
}otlpHttpEndpoint() 🔗
OtlpHttpEndpoint returns the Loki OTLP/HTTP logs receiver URL, suitable
as the endpoint for an OpenTelemetry exporter posting log data.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
loki --registry string --tag string \
otlp-http-endpointfunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
GrafanaStack().
Loki(registry, tag).
OtlpHttpEndpoint(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.grafana_stack()
.loki(registry, tag)
.otlp_http_endpoint()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.grafanaStack()
.loki(registry, tag)
.otlpHttpEndpoint()
}service() 🔗
Service returns the Loki Dagger service. Bind it via WithServiceBinding or call .Start(ctx) to launch ahead-of-time.
The container is run as root so it can write to the mounted data dir without us having to second-guess the upstream image’s USER. This is safe for ephemeral dev/test services and avoids per-image UID drift across Loki / Tempo / Mimir.
Return Type
Service ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
loki --registry string --tag string \
servicefunc (m *MyModule) Example(registry string, tag string) *dagger.Service {
return dag.
GrafanaStack().
Loki(registry, tag).
Service()
}@function
def example(registry: str, tag: str) -> dagger.Service:
return (
dag.grafana_stack()
.loki(registry, tag)
.service()
)@func()
example(registry: string, tag: string): Service {
return dag
.grafanaStack()
.loki(registry, tag)
.service()
}GrafanaStackMimir 🔗
Mimir wraps a configured grafana/mimir container running in monolithic (single-binary, target=all) mode with the OTLP HTTP ingester enabled, anonymous tenant, and filesystem block storage.
image() 🔗
Image is the resolved /grafana/mimir: reference.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
mimir --registry string --tag string \
imagefunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
GrafanaStack().
Mimir(registry, tag).
Image(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.grafana_stack()
.mimir(registry, tag)
.image()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.grafanaStack()
.mimir(registry, tag)
.image()
}configFile() 🔗
ConfigFile is the Mimir YAML config: either the caller-supplied override or the embedded default.
Return Type
File ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
mimir --registry string --tag string \
config-filefunc (m *MyModule) Example(registry string, tag string) *dagger.File {
return dag.
GrafanaStack().
Mimir(registry, tag).
ConfigFile()
}@function
def example(registry: str, tag: str) -> dagger.File:
return (
dag.grafana_stack()
.mimir(registry, tag)
.config_file()
)@func()
example(registry: string, tag: string): File {
return dag
.grafanaStack()
.mimir(registry, tag)
.configFile()
}storage() 🔗
Storage is the optional persistence volume for /var/lib/mimir.
Return Type
CacheVolume ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
mimir --registry string --tag string \
storagefunc (m *MyModule) Example(registry string, tag string) *dagger.CacheVolume {
return dag.
GrafanaStack().
Mimir(registry, tag).
Storage()
}@function
def example(registry: str, tag: str) -> dagger.CacheVolume:
return (
dag.grafana_stack()
.mimir(registry, tag)
.storage()
)@func()
example(registry: string, tag: string): CacheVolume {
return dag
.grafanaStack()
.mimir(registry, tag)
.storage()
}endpoint() 🔗
Endpoint returns the Mimir HTTP base URL, e.g. http://:9009. This endpoint serves both the Prometheus-compatible query API and the OTLP HTTP metrics ingester.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
mimir --registry string --tag string \
endpointfunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
GrafanaStack().
Mimir(registry, tag).
Endpoint(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.grafana_stack()
.mimir(registry, tag)
.endpoint()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.grafanaStack()
.mimir(registry, tag)
.endpoint()
}otlpHttpEndpoint() 🔗
OtlpHttpEndpoint returns the Mimir OTLP/HTTP metrics receiver URL,
suitable as the endpoint for an OpenTelemetry exporter posting
metric data.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
mimir --registry string --tag string \
otlp-http-endpointfunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
GrafanaStack().
Mimir(registry, tag).
OtlpHttpEndpoint(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.grafana_stack()
.mimir(registry, tag)
.otlp_http_endpoint()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.grafanaStack()
.mimir(registry, tag)
.otlpHttpEndpoint()
}service() 🔗
Service returns the Mimir Dagger service. The args explicitly include
-target=all so the binary runs in monolithic mode regardless of the
upstream image’s default CMD. See Loki.Service for notes on the
WithUser(“0:0”) choice.
Return Type
Service ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
mimir --registry string --tag string \
servicefunc (m *MyModule) Example(registry string, tag string) *dagger.Service {
return dag.
GrafanaStack().
Mimir(registry, tag).
Service()
}@function
def example(registry: str, tag: str) -> dagger.Service:
return (
dag.grafana_stack()
.mimir(registry, tag)
.service()
)@func()
example(registry: string, tag: string): Service {
return dag
.grafanaStack()
.mimir(registry, tag)
.service()
}GrafanaStackTempo 🔗
Tempo wraps a configured grafana/tempo container running in monolithic mode with the OTLP gRPC and HTTP receivers enabled and local filesystem trace storage.
image() 🔗
Image is the resolved /grafana/tempo: reference.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
tempo --registry string --tag string \
imagefunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
GrafanaStack().
Tempo(registry, tag).
Image(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.grafana_stack()
.tempo(registry, tag)
.image()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.grafanaStack()
.tempo(registry, tag)
.image()
}configFile() 🔗
ConfigFile is the Tempo YAML config: either the caller-supplied override or the embedded default.
Return Type
File ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
tempo --registry string --tag string \
config-filefunc (m *MyModule) Example(registry string, tag string) *dagger.File {
return dag.
GrafanaStack().
Tempo(registry, tag).
ConfigFile()
}@function
def example(registry: str, tag: str) -> dagger.File:
return (
dag.grafana_stack()
.tempo(registry, tag)
.config_file()
)@func()
example(registry: string, tag: string): File {
return dag
.grafanaStack()
.tempo(registry, tag)
.configFile()
}storage() 🔗
Storage is the optional persistence volume for /var/lib/tempo.
Return Type
CacheVolume ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
tempo --registry string --tag string \
storagefunc (m *MyModule) Example(registry string, tag string) *dagger.CacheVolume {
return dag.
GrafanaStack().
Tempo(registry, tag).
Storage()
}@function
def example(registry: str, tag: str) -> dagger.CacheVolume:
return (
dag.grafana_stack()
.tempo(registry, tag)
.storage()
)@func()
example(registry: string, tag: string): CacheVolume {
return dag
.grafanaStack()
.tempo(registry, tag)
.storage()
}httpEndpoint() 🔗
HttpEndpoint returns the Tempo HTTP query/push base URL, e.g. http://:3200.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
tempo --registry string --tag string \
http-endpointfunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
GrafanaStack().
Tempo(registry, tag).
HttpEndpoint(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.grafana_stack()
.tempo(registry, tag)
.http_endpoint()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.grafanaStack()
.tempo(registry, tag)
.httpEndpoint()
}otlpGrpcEndpoint() 🔗
OtlpGrpcEndpoint returns the Tempo OTLP/gRPC receiver address, e.g. :4317. No URL scheme — gRPC clients want host:port.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
tempo --registry string --tag string \
otlp-grpc-endpointfunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
GrafanaStack().
Tempo(registry, tag).
OtlpGrpcEndpoint(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.grafana_stack()
.tempo(registry, tag)
.otlp_grpc_endpoint()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.grafanaStack()
.tempo(registry, tag)
.otlpGrpcEndpoint()
}otlpHttpEndpoint() 🔗
OtlpHttpEndpoint returns the Tempo OTLP/HTTP receiver base URL, e.g. http://:4318. The OpenTelemetry HTTP exporter appends the per-signal path itself (e.g. /v1/traces).
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
tempo --registry string --tag string \
otlp-http-endpointfunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
GrafanaStack().
Tempo(registry, tag).
OtlpHttpEndpoint(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.grafana_stack()
.tempo(registry, tag)
.otlp_http_endpoint()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.grafanaStack()
.tempo(registry, tag)
.otlpHttpEndpoint()
}service() 🔗
Service returns the Tempo Dagger service. See Loki.Service for notes on the WithUser(“0:0”) choice.
Return Type
Service ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@9ebfb29b95cb654ed5d00d1e595bcf710c2a7318 call \
tempo --registry string --tag string \
servicefunc (m *MyModule) Example(registry string, tag string) *dagger.Service {
return dag.
GrafanaStack().
Tempo(registry, tag).
Service()
}@function
def example(registry: str, tag: str) -> dagger.Service:
return (
dag.grafana_stack()
.tempo(registry, tag)
.service()
)@func()
example(registry: string, tag: string): Service {
return dag
.grafanaStack()
.tempo(registry, tag)
.service()
}