MCPcopy
hub / github.com/grafana/tempo / main

Function main

pkg/docsgen/generate_manifest.go:35–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33`, Cmd)
34
35func main() {
36 newConfig := app.NewDefaultConfig()
37 // Override values that depend on the host specifics
38 const hostname = "hostname"
39 newConfig.Distributor.DistributorRing.InstanceID = hostname
40 newConfig.Generator.Ring.InstanceID = hostname
41 newConfig.BackendWorker.Ring.InstanceID = hostname
42 newConfig.Generator.InstanceID = hostname
43 newConfig.BlockBuilder.InstanceID = hostname
44 newConfig.LiveStore.Ring.InstanceID = hostname
45 newConfig.LiveStore.Ring.InstanceInterfaceNames = []string{"eth0"}
46
47 newConfigBytes, err := yaml.Marshal(newConfig)
48 if err != nil {
49 panic(err)
50 }
51 newManifest := Manifest + "```yaml\n" + string(newConfigBytes) + "```\n"
52
53 err = os.WriteFile(ManifestPath, []byte(newManifest), 0o644)
54 if err != nil {
55 panic(err)
56 }
57
58 cmd := exec.Command("git", "diff", "--exit-code", ManifestPath)
59 cmd.Stdout = os.Stdout
60 cmd.Stderr = os.Stderr
61 err = cmd.Run()
62 if err != nil {
63 log.Fatalf("The manifest with the default Tempo configuration has changed. Please run '%s' and commit the changes.", Cmd)
64 }
65}

Callers

nothing calls this directly

Calls 3

NewDefaultConfigFunction · 0.92
MarshalMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected