Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ the source code for the UI assets (requires Node.js 6+).
The assets must be compiled first with `make build-ui`, which runs Node.js build and then
packages the assets into a Go file that is `.gitignore`-ed.

The packaged assets can be enabled by providing a build tag `ui`, for example:

```
$ go run -tags ui ./cmd/all-in-one/main.go
```

`make run-all-in-one` essentially runs Jaeger all-in-one by combining both of the above
steps into a single `make` command.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ lint-go: $(LINT)

.PHONY: run-all-in-one
run-all-in-one: build-ui
go run -tags ui ./cmd/all-in-one --log-level debug
go run ./cmd/all-in-one --log-level debug

.PHONY: changelog
changelog:
Expand Down
3 changes: 0 additions & 3 deletions Makefile.BuildBinaries.mk
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@ _build-a-binary-%:

.PHONY: build-jaeger
build-jaeger: BIN_NAME = jaeger
build-jaeger: GO_TAGS = -tags ui
build-jaeger: BUILD_INFO = $(BUILD_INFO_V2)
build-jaeger: build-ui _build-a-binary-jaeger$(SUFFIX)-$(GOOS)-$(GOARCH)

.PHONY: build-all-in-one
build-all-in-one: BIN_NAME = all-in-one
build-all-in-one: GO_TAGS = -tags ui
build-all-in-one: build-ui _build-a-binary-all-in-one$(SUFFIX)-$(GOOS)-$(GOARCH)

.PHONY: build-agent
Expand All @@ -89,7 +87,6 @@ build-agent: _build-a-binary-agent$(SUFFIX)-$(GOOS)-$(GOARCH)

.PHONY: build-query
build-query: BIN_NAME = query
build-query: GO_TAGS = -tags ui
build-query: build-ui _build-a-binary-query$(SUFFIX)-$(GOOS)-$(GOARCH)

.PHONY: build-collector
Expand Down
2 changes: 1 addition & 1 deletion cmd/query/app/static_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type loadedConfig struct {

// NewStaticAssetsHandler returns a StaticAssetsHandler
func NewStaticAssetsHandler(staticAssetsRoot string, options StaticAssetsHandlerOptions) (*StaticAssetsHandler, error) {
assetsFS := ui.StaticFiles
assetsFS := ui.GetStaticFiles()
if staticAssetsRoot != "" {
assetsFS = http.Dir(staticAssetsRoot)
}
Expand Down
21 changes: 0 additions & 21 deletions cmd/query/app/ui/actual.go

This file was deleted.

29 changes: 29 additions & 0 deletions cmd/query/app/ui/assets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2024 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0

package ui

import (
"embed"
"net/http"

"github.com/jaegertracing/jaeger/pkg/gzipfs"
"github.com/jaegertracing/jaeger/pkg/httpfs"
)

//go:embed actual/*
var actualAssetsFS embed.FS

//go:embed placeholder/index.html
var placeholderAssetsFS embed.FS

// GetStaticFiles gets the static assets that the Jaeger UI will serve. If the actual
// assets are available, then this function will return them. Otherwise, a
// non-functional index.html is returned to be used as a placeholder.
func GetStaticFiles() http.FileSystem {
if _, err := actualAssetsFS.ReadFile("actual/index.html.gz"); err != nil {
return httpfs.PrefixedFS("placeholder", http.FS(placeholderAssetsFS))
}

return httpfs.PrefixedFS("actual", http.FS(gzipfs.New(actualAssetsFS)))
}
6 changes: 3 additions & 3 deletions cmd/query/app/ui/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

// Package ui bundles UI assets packaged with stdlib/embed.
// By default it imports the placeholder, non-functional index.html.
// When building with "-tags ui", it imports the real UI assets
// generated in build-ui Makefile target.
// If the real UI assets are available, they are used in the
// build-ui Makefile target. Otherwise, the non-functional
// index.html is used.
package ui
20 changes: 0 additions & 20 deletions cmd/query/app/ui/placeholder.go

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/query/app/ui/placeholder/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h1>🥋: This is not the Jaeger UI you are looking for!</h1>
<p>
This is a placeholder for the Jaeger UI home page.
If you are seeing this, you are running a binary that was not compiled with the UI assets (<code>-tags ui</code>).
If you are seeing this, you are running a binary that was not compiled with the UI assets.
See <a href="https://github.com/jaegertracing/jaeger/blob/main/CONTRIBUTING.md#running-local-build-with-the-ui">these instructions</a>.
</p>
<h1>UI configuration</h1>
Expand Down