ui

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

README

Grafana Alloy UI

The Alloy UI uses the following:

  • node v24.4
  • npm v11
  • vite 7

How it works

Normal, local development is done via npm run dev from this folder (internal/web/ui).

However, API responses are not currently mocked, so most of the UI will not show any data.

Mock mode

To develop against fixture data without a running Alloy instance, use:

npm run dev:mock

This generates fixture files and starts the Vite dev server with a mock API layer that intercepts requests to /api/ and serves responses from src/test/generated_fixtures/.

Full build testing

To fully test the UI, run npm run build, then run Alloy as normal. This will use the "no built-in assets" version.

You can also run Alloy with built-in assets if you'd like to test it that way.

About the Alloy web server

The Alloy web server has the job of ensuring that the UI is available at the specified UI prefix.

This is accomplished by Vite rewriting the index.html file during a production build to include a template string that the UI can replace when serving the index.html page.

Documentation

Overview

Package ui exposes utilities to get a Handler for the Grafana Alloy UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assets

func Assets() http.FileSystem

Assets contains the UI's assets.

func RegisterRoutes

func RegisterRoutes(pathPrefix string, router *mux.Router)

RegisterRoutes registers routes to the provided mux.Router for serving the Grafana Alloy UI. The UI will be served relative to pathPrefix. If no pathPrefix is specified, the UI will be served at root.

By default, the UI is retrieved from the ./internal/web/ui/dist directory relative to working directory, assuming that Alloy is run from the repo root. However, if the embedalloyui Go tag is present, the built UI will be embedded into the binary; run go generate -tags embedalloyui for this package to generate the assets to embed.

RegisterRoutes catches all requests from pathPrefix and so should only be invoked after all other routes have been registered.

RegisterRoutes is not intended for public use and will only work properly when called from github.com/grafana/alloy.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL