startup

package
v1.171.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package startup runs the platform's initialization phases and reports them (#1898): one log line naming the version and every phase's duration, and a platform.startup span with a child per phase. Before it a slow boot was a gap between two timestamps nobody had correlated, and a boot that failed named the error but not the phase.

Index

Constants

View Source
const SpanName = "platform.startup"

SpanName is the root span every boot's phases are children of.

Variables

This section is empty.

Functions

func Run

func Run(phases []Phase) error

Run runs phases in order, stopping at the first that fails, and reports what ran. The span is written after the phases finish, with the times they were measured at, because the first phase is the one that installs the tracer.

Types

type Phase

type Phase struct {
	Name string
	Run  func() error
}

Phase is one named step of initialization.

func Do

func Do(name string, run func()) Phase

Do is a Phase for a step that cannot fail.

Jump to

Keyboard shortcuts

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