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.
Every listener defaults to plaintext. WithTls enables TLS — and WithMtls
optional mutual TLS — on every listener a backend exposes (the native HTTP
API plus the OTLP receivers), and on the Grafana UI's :3000 listener.
Datasource provisioning is TLS-aware: WithLokiDatasource / WithTempoDatasource
/ WithMimirDatasource detect a TLS-enabled backend and render the datasource
YAML with an https:// URL and the CA (plus client cert for an mTLS backend)
so the Grafana proxy chain still works end-to-end.
Installation
dagger install github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316Entrypoint
Return Type
GrafanaStack Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 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.
grafana() 🔗
Grafana configures a grafana/grafana service with file-based datasource and dashboard provisioning. Listens on :3000 plaintext.
registry defaults to docker.io. tag defaults to a known-good upstream version. configFile fully replaces the embedded default when supplied. adminPassword is required and is mounted into the container at a fixed path; Grafana reads it via GF_SECURITY_ADMIN_PASSWORD__FILE so the plaintext never enters generated bindings. storage, when non-nil, is mounted at /var/lib/grafana for persistence; when nil, an ephemeral empty Directory is mounted instead.
Return Type
GrafanaStackGrafana !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| registry | String ! | "docker.io" | Container registry hosting the grafana/grafana image. |
| tag | String ! | "12.0.0" | Image tag for grafana/grafana. |
| configFile | File | - | grafana.ini config; replaces the embedded default when supplied. |
| adminPassword | Secret ! | - | Admin password supplied to GF_SECURITY_ADMIN_PASSWORD__FILE. |
| storage | CacheVolume | - | Persistence volume mounted at /var/lib/grafana. When nil the data dir is ephemeral. |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRETfunc (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret) *dagger.GrafanaStackGrafana {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword)
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret) -> dagger.GrafanaStackGrafana:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
)@func()
example(registry: string, tag: string, adminPassword: Secret): GrafanaStackGrafana {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
}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@47e25f065653c481a6d1567537307f2565bfa316 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@47e25f065653c481a6d1567537307f2565bfa316 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@47e25f065653c481a6d1567537307f2565bfa316 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)
}GrafanaStackGrafana 🔗
Grafana wraps a configured grafana/grafana container with file-based datasource and dashboard provisioning. Datasources and dashboards are accumulated via the WithX builder methods and rendered into the container’s /etc/grafana/provisioning tree at Service() time.
image() 🔗
Image is the resolved /grafana/grafana: reference.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRET \
imagefunc (m *MyModule) Example(ctx context.Context, registry string, tag string, adminPassword *dagger.Secret) string {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Image(ctx)
}@function
async def example(registry: str, tag: str, adminpassword: dagger.Secret) -> str:
return await (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.image()
)@func()
async example(registry: string, tag: string, adminPassword: Secret): Promise<string> {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.image()
}configFile() 🔗
ConfigFile is the grafana.ini config: caller-supplied override or the embedded default.
Return Type
File ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRET \
config-filefunc (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret) *dagger.File {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Configfile()
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret) -> dagger.File:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.configfile()
)@func()
example(registry: string, tag: string, adminPassword: Secret): File {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.configFile()
}adminPassword() 🔗
AdminPassword is mounted into the container as a file and pointed at via GF_SECURITY_ADMIN_PASSWORD__FILE so plaintext never enters generated bindings.
Return Type
Secret ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRET \
admin-passwordfunc (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret) *dagger.Secret {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Adminpassword()
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret) -> dagger.Secret:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.adminpassword()
)@func()
example(registry: string, tag: string, adminPassword: Secret): Secret {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.adminPassword()
}storage() 🔗
Storage is the optional persistence volume for /var/lib/grafana.
Return Type
CacheVolume ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRET \
storagefunc (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret) *dagger.CacheVolume {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Storage()
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret) -> dagger.CacheVolume:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.storage()
)@func()
example(registry: string, tag: string, adminPassword: Secret): CacheVolume {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.storage()
}dashboards() 🔗
Dashboards is the accumulated set of dashboard JSON files, mounted at /var/lib/grafana/dashboards on the Grafana container at Service() time. Starts empty.
Return Type
Directory ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRET \
dashboardsfunc (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret) *dagger.Directory {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Dashboards()
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret) -> dagger.Directory:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.dashboards()
)@func()
example(registry: string, tag: string, adminPassword: Secret): Directory {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.dashboards()
}endpoint() 🔗
Endpoint returns the Grafana HTTP base URL, e.g. http://:3000, or https://:3000 once WithTls has been called.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRET \
endpointfunc (m *MyModule) Example(ctx context.Context, registry string, tag string, adminPassword *dagger.Secret) string {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Endpoint(ctx)
}@function
async def example(registry: str, tag: str, adminpassword: dagger.Secret) -> str:
return await (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.endpoint()
)@func()
async example(registry: string, tag: string, adminPassword: Secret): Promise<string> {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.endpoint()
}service() 🔗
Service returns the Grafana Dagger service. The container is run as root (see Loki.Service for the rationale). The accumulated datasource and dashboard state is rendered into the container’s provisioning tree at this point — subsequent WithX calls on the same *Grafana receiver are not visible to the returned service.
Return Type
Service ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRET \
servicefunc (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret) *dagger.Service {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Service()
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret) -> dagger.Service:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.service()
)@func()
example(registry: string, tag: string, adminPassword: Secret): Service {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.service()
}withDashboard() 🔗
WithDashboard adds a single dashboard JSON file to the provisioned
dashboards directory under the supplied name. .json is appended if
the supplied name does not already end with it.
Return Type
GrafanaStackGrafana !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String ! | - | No description provided |
| file | File ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRET \
with-dashboard --name string --file file:pathfunc (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret, name string, file *dagger.File) *dagger.GrafanaStackGrafana {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Withdashboard(name, file)
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret, name: str, file: dagger.File) -> dagger.GrafanaStackGrafana:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.withdashboard(name, file)
)@func()
example(registry: string, tag: string, adminPassword: Secret, name: string, file: File): GrafanaStackGrafana {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.withDashboard(name, file)
}withDashboards() 🔗
WithDashboards adds every *.json entry in dir to the provisioned dashboards directory, preserving filenames.
Return Type
GrafanaStackGrafana !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| dir | Directory ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRET \
with-dashboards --dir DIR_PATHfunc (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret, dir *dagger.Directory) *dagger.GrafanaStackGrafana {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Withdashboards(dir)
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret, dir: dagger.Directory) -> dagger.GrafanaStackGrafana:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.withdashboards(dir)
)@func()
example(registry: string, tag: string, adminPassword: Secret, dir: Directory): GrafanaStackGrafana {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.withDashboards(dir)
}withLokiDatasource() 🔗
WithLokiDatasource binds loki into Grafana’s network at hostname name
and accumulates a Loki datasource entry under the same name (which is
also used as the datasource uid, so callers can hit
/api/datasources/proxy/uid//…).
name must be a valid DNS label: it is used as the in-network
hostname (enforced by Dagger’s WithServiceBinding), as the Grafana
datasource uid, and is interpolated into provisioning YAML.
TLS is derived from the loki builder: when loki has WithTls, the datasource URL becomes https:// and the entry pins the backend’s CA. Supply caCert (the PEM CA that signed loki’s server certificate) so Grafana can verify the backend; when omitted, loki’s own server certificate is pinned instead (correct only for a self-signed server cert). When loki has WithMtls, also supply clientCert / clientKey (the PEM certificate + key Grafana presents to the backend); Service returns an error if they are missing.
Return Type
GrafanaStackGrafana !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String ! | - | No description provided |
| loki | GrafanaStackLoki ! | - | No description provided |
| caCert | File | - | PEM CA that signed the backend’s server certificate. |
| clientCert | File | - | PEM client certificate Grafana presents to an mTLS backend. |
| clientKey | Secret | - | PEM client private key paired with clientCert. |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret, name string, loki *dagger.GrafanaStackLoki) *dagger.GrafanaStackGrafana {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Withlokidatasource(name, loki)
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret, name: str, loki: dagger.GrafanaStackLoki) -> dagger.GrafanaStackGrafana:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.withlokidatasource(name, loki)
)@func()
example(registry: string, tag: string, adminPassword: Secret, name: string, loki: GrafanaStackLoki): GrafanaStackGrafana {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.withLokiDatasource(name, loki)
}withMimirDatasource() 🔗
WithMimirDatasource binds mimir into Grafana’s network at hostname name
and accumulates a Prometheus-type datasource entry pointing at
Mimir’s Prometheus-compatible API endpoint. See WithLokiDatasource
for the constraints on name and the TLS args.
Return Type
GrafanaStackGrafana !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String ! | - | No description provided |
| mimir | GrafanaStackMimir ! | - | No description provided |
| caCert | File | - | No description provided |
| clientCert | File | - | No description provided |
| clientKey | Secret | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret, name string, mimir *dagger.GrafanaStackMimir) *dagger.GrafanaStackGrafana {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Withmimirdatasource(name, mimir)
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret, name: str, mimir: dagger.GrafanaStackMimir) -> dagger.GrafanaStackGrafana:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.withmimirdatasource(name, mimir)
)@func()
example(registry: string, tag: string, adminPassword: Secret, name: string, mimir: GrafanaStackMimir): GrafanaStackGrafana {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.withMimirDatasource(name, mimir)
}withTempoDatasource() 🔗
WithTempoDatasource binds tempo into Grafana’s network at hostname
name and accumulates a Tempo datasource entry under the same name.
See WithLokiDatasource for the constraints on name and the TLS args.
Return Type
GrafanaStackGrafana !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String ! | - | No description provided |
| tempo | GrafanaStackTempo ! | - | No description provided |
| caCert | File | - | No description provided |
| clientCert | File | - | No description provided |
| clientKey | Secret | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret, name string, tempo *dagger.GrafanaStackTempo) *dagger.GrafanaStackGrafana {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Withtempodatasource(name, tempo)
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret, name: str, tempo: dagger.GrafanaStackTempo) -> dagger.GrafanaStackGrafana:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.withtempodatasource(name, tempo)
)@func()
example(registry: string, tag: string, adminPassword: Secret, name: string, tempo: GrafanaStackTempo): GrafanaStackGrafana {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.withTempoDatasource(name, tempo)
}withTls() 🔗
WithTls switches the Grafana UI’s :3000 listener from HTTP to HTTPS by setting [server] protocol = https plus cert_file / cert_key in grafana.ini. serverCert is the PEM server certificate and serverKey its PEM private key. After this call Endpoint returns an https:// URL.
Note: Grafana core does not support requiring client certificates on its own listener, so there is no Grafana.WithMtls. To reach an mTLS-required backend, supply the client certificate to the datasource instead (see WithLokiDatasource). Ignored when a custom config file was supplied to Grafana().
Return Type
GrafanaStackGrafana !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| serverCert | File ! | - | No description provided |
| serverKey | Secret ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
grafana --registry string --tag string --admin-password env:MYSECRET \
with-tls --server-cert file:path --server-key env:MYSECRETfunc (m *MyModule) Example(registry string, tag string, adminPassword *dagger.Secret, serverCert *dagger.File, serverKey *dagger.Secret) *dagger.GrafanaStackGrafana {
return dag.
Grafanastack().
Grafana(registry, tag, adminPassword).
Withtls(serverCert, serverKey)
}@function
def example(registry: str, tag: str, adminpassword: dagger.Secret, servercert: dagger.File, serverkey: dagger.Secret) -> dagger.GrafanaStackGrafana:
return (
dag.grafana_stack()
.grafana(registry, tag, adminpassword)
.withtls(servercert, serverkey)
)@func()
example(registry: string, tag: string, adminPassword: Secret, serverCert: File, serverKey: Secret): GrafanaStackGrafana {
return dag
.grafanaStack()
.grafana(registry, tag, adminPassword)
.withTls(serverCert, serverKey)
}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@47e25f065653c481a6d1567537307f2565bfa316 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@47e25f065653c481a6d1567537307f2565bfa316 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)
.configfile()
)@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@47e25f065653c481a6d1567537307f2565bfa316 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, or https://:3100 once WithTls has been called.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 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. The
scheme is https once WithTls has been called.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 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)
.otlphttpendpoint()
)@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@47e25f065653c481a6d1567537307f2565bfa316 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()
}withMtls() 🔗
WithMtls additionally requires every client to present a certificate signed by clientCa (PEM). Must be combined with WithTls; Service returns an error otherwise.
Return Type
GrafanaStackLoki !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| clientCa | File ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
loki --registry string --tag string \
with-mtls --client-ca file:pathfunc (m *MyModule) Example(registry string, tag string, clientCa *dagger.File) *dagger.GrafanaStackLoki {
return dag.
Grafanastack().
Loki(registry, tag).
Withmtls(clientCa)
}@function
def example(registry: str, tag: str, clientca: dagger.File) -> dagger.GrafanaStackLoki:
return (
dag.grafana_stack()
.loki(registry, tag)
.withmtls(clientca)
)@func()
example(registry: string, tag: string, clientCa: File): GrafanaStackLoki {
return dag
.grafanaStack()
.loki(registry, tag)
.withMtls(clientCa)
}withTls() 🔗
WithTls enables TLS on Loki’s HTTP listener (:3100) — which serves both the native LogQL/ingest API and the OTLP/HTTP logs receiver — by rendering server.http_tls_config into the config. serverCert is the PEM server certificate (its SAN must cover the hostname clients dial) and serverKey its PEM private key. After this call Endpoint / OtlpHttpEndpoint return https:// URLs. Ignored when a custom config file was supplied to Loki(); that config owns its own TLS.
Return Type
GrafanaStackLoki !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| serverCert | File ! | - | No description provided |
| serverKey | Secret ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
loki --registry string --tag string \
with-tls --server-cert file:path --server-key env:MYSECRETfunc (m *MyModule) Example(registry string, tag string, serverCert *dagger.File, serverKey *dagger.Secret) *dagger.GrafanaStackLoki {
return dag.
Grafanastack().
Loki(registry, tag).
Withtls(serverCert, serverKey)
}@function
def example(registry: str, tag: str, servercert: dagger.File, serverkey: dagger.Secret) -> dagger.GrafanaStackLoki:
return (
dag.grafana_stack()
.loki(registry, tag)
.withtls(servercert, serverkey)
)@func()
example(registry: string, tag: string, serverCert: File, serverKey: Secret): GrafanaStackLoki {
return dag
.grafanaStack()
.loki(registry, tag)
.withTls(serverCert, serverKey)
}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@47e25f065653c481a6d1567537307f2565bfa316 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@47e25f065653c481a6d1567537307f2565bfa316 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)
.configfile()
)@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@47e25f065653c481a6d1567537307f2565bfa316 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, or https://:9009 once WithTls has been called. 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@47e25f065653c481a6d1567537307f2565bfa316 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. The scheme is https once WithTls has been called.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 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)
.otlphttpendpoint()
)@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@47e25f065653c481a6d1567537307f2565bfa316 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()
}withMtls() 🔗
WithMtls additionally requires every client to present a certificate signed by clientCa (PEM). Must be combined with WithTls; Service returns an error otherwise.
Return Type
GrafanaStackMimir !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| clientCa | File ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
mimir --registry string --tag string \
with-mtls --client-ca file:pathfunc (m *MyModule) Example(registry string, tag string, clientCa *dagger.File) *dagger.GrafanaStackMimir {
return dag.
Grafanastack().
Mimir(registry, tag).
Withmtls(clientCa)
}@function
def example(registry: str, tag: str, clientca: dagger.File) -> dagger.GrafanaStackMimir:
return (
dag.grafana_stack()
.mimir(registry, tag)
.withmtls(clientca)
)@func()
example(registry: string, tag: string, clientCa: File): GrafanaStackMimir {
return dag
.grafanaStack()
.mimir(registry, tag)
.withMtls(clientCa)
}withTls() 🔗
WithTls enables TLS on Mimir’s HTTP listener (:9009) — which serves both the Prometheus-compatible API and the OTLP/HTTP metrics receiver — by rendering server.http_tls_config into the config. serverCert is the PEM server certificate and serverKey its PEM private key. After this call Endpoint / OtlpHttpEndpoint return https:// URLs. Ignored when a custom config file was supplied to Mimir().
Return Type
GrafanaStackMimir !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| serverCert | File ! | - | No description provided |
| serverKey | Secret ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
mimir --registry string --tag string \
with-tls --server-cert file:path --server-key env:MYSECRETfunc (m *MyModule) Example(registry string, tag string, serverCert *dagger.File, serverKey *dagger.Secret) *dagger.GrafanaStackMimir {
return dag.
Grafanastack().
Mimir(registry, tag).
Withtls(serverCert, serverKey)
}@function
def example(registry: str, tag: str, servercert: dagger.File, serverkey: dagger.Secret) -> dagger.GrafanaStackMimir:
return (
dag.grafana_stack()
.mimir(registry, tag)
.withtls(servercert, serverkey)
)@func()
example(registry: string, tag: string, serverCert: File, serverKey: Secret): GrafanaStackMimir {
return dag
.grafanaStack()
.mimir(registry, tag)
.withTls(serverCert, serverKey)
}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@47e25f065653c481a6d1567537307f2565bfa316 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@47e25f065653c481a6d1567537307f2565bfa316 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)
.configfile()
)@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@47e25f065653c481a6d1567537307f2565bfa316 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, or https://:3200 once WithTls has been called.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 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)
.httpendpoint()
)@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 and must configure TLS themselves (the receiver enforces it once WithTls is set).
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 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)
.otlpgrpcendpoint()
)@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, or https://:4318 once WithTls has been called. 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@47e25f065653c481a6d1567537307f2565bfa316 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)
.otlphttpendpoint()
)@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@47e25f065653c481a6d1567537307f2565bfa316 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()
}withMtls() 🔗
WithMtls additionally requires every client to present a certificate signed by clientCa (PEM) on every listener. Must be combined with WithTls; Service returns an error otherwise.
Return Type
GrafanaStackTempo !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| clientCa | File ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
tempo --registry string --tag string \
with-mtls --client-ca file:pathfunc (m *MyModule) Example(registry string, tag string, clientCa *dagger.File) *dagger.GrafanaStackTempo {
return dag.
Grafanastack().
Tempo(registry, tag).
Withmtls(clientCa)
}@function
def example(registry: str, tag: str, clientca: dagger.File) -> dagger.GrafanaStackTempo:
return (
dag.grafana_stack()
.tempo(registry, tag)
.withmtls(clientca)
)@func()
example(registry: string, tag: string, clientCa: File): GrafanaStackTempo {
return dag
.grafanaStack()
.tempo(registry, tag)
.withMtls(clientCa)
}withTls() 🔗
WithTls enables TLS on every Tempo listener: the native HTTP query API (:3200, via server.http_tls_config) and both OTLP receivers (gRPC :4317 and HTTP :4318, via distributor.receivers.otlp.protocols.{grpc,http}.tls). serverCert is the PEM server certificate and serverKey its PEM private key. After this call HttpEndpoint / OtlpHttpEndpoint return https:// URLs; OtlpGrpcEndpoint stays scheme-less (gRPC callers configure TLS themselves). Ignored when a custom config file was supplied to Tempo().
Return Type
GrafanaStackTempo !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| serverCert | File ! | - | No description provided |
| serverKey | Secret ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/grafana-stack@47e25f065653c481a6d1567537307f2565bfa316 call \
tempo --registry string --tag string \
with-tls --server-cert file:path --server-key env:MYSECRETfunc (m *MyModule) Example(registry string, tag string, serverCert *dagger.File, serverKey *dagger.Secret) *dagger.GrafanaStackTempo {
return dag.
Grafanastack().
Tempo(registry, tag).
Withtls(serverCert, serverKey)
}@function
def example(registry: str, tag: str, servercert: dagger.File, serverkey: dagger.Secret) -> dagger.GrafanaStackTempo:
return (
dag.grafana_stack()
.tempo(registry, tag)
.withtls(servercert, serverkey)
)@func()
example(registry: string, tag: string, serverCert: File, serverKey: Secret): GrafanaStackTempo {
return dag
.grafanaStack()
.tempo(registry, tag)
.withTls(serverCert, serverKey)
}