Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions cmd/tempo/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/grafana/tempo/modules/distributor/receiver"
frontend_v1 "github.com/grafana/tempo/modules/frontend/v1"
"github.com/grafana/tempo/modules/generator"
"github.com/grafana/tempo/modules/ingester"
"github.com/grafana/tempo/modules/overrides"
"github.com/grafana/tempo/modules/querier"
"github.com/grafana/tempo/modules/storage"
Expand Down Expand Up @@ -74,6 +75,7 @@ type App struct {
distributor *distributor.Distributor
querier *querier.Querier
frontend *frontend_v1.Frontend
ingester *ingester.Ingester
generator *generator.Generator
blockBuilder *blockbuilder.BlockBuilder
store storage.Store
Expand Down Expand Up @@ -345,6 +347,16 @@ func (t *App) readyHandler(sm *services.Manager, shutdownRequested *atomic.Bool)
return
}

// Ingester has a special check that makes sure that it was able to register into the ring,
// and that all other ring entries are OK too.
if t.ingester != nil {
if err := t.ingester.CheckReady(r.Context()); err != nil {
http.Error(w, "Ingester not ready: "+err.Error(), http.StatusServiceUnavailable)
return
}
}

// Generator has a dedicated readiness check for generator-specific dependencies.
if t.generator != nil {
if err := t.generator.CheckReady(r.Context()); err != nil {
http.Error(w, "Generator not ready: "+err.Error(), http.StatusServiceUnavailable)
Expand Down
13 changes: 10 additions & 3 deletions cmd/tempo/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
"github.com/grafana/tempo/modules/distributor"
"github.com/grafana/tempo/modules/frontend"
"github.com/grafana/tempo/modules/generator"
"github.com/grafana/tempo/modules/ingester"
ingester_client "github.com/grafana/tempo/modules/ingester/client"
"github.com/grafana/tempo/modules/livestore"
livestore_client "github.com/grafana/tempo/modules/livestore/client"
"github.com/grafana/tempo/modules/overrides"
Expand Down Expand Up @@ -52,10 +54,12 @@ type Config struct {
Server server.Config `yaml:"server,omitempty"`
InternalServer internalserver.Config `yaml:"internal_server,omitempty"`
Distributor distributor.Config `yaml:"distributor,omitempty"`
IngesterClient ingester_client.Config `yaml:"ingester_client,omitempty"`
MetricsGeneratorClient map[string]any `yaml:"metrics_generator_client,omitempty"` // Deprecated: kept for one-release config compatibility.
LiveStoreClient livestore_client.Config `yaml:"live_store_client,omitempty"`
Querier querier.Config `yaml:"querier,omitempty"`
Frontend frontend.Config `yaml:"query_frontend,omitempty"`
Ingester ingester.Config `yaml:"ingester,omitempty"`
Generator generator.Config `yaml:"metrics_generator,omitempty"`
Ingest ingest.Config `yaml:"ingest,omitempty"`
BlockBuilder blockbuilder.Config `yaml:"block_builder,omitempty"`
Expand Down Expand Up @@ -139,11 +143,14 @@ func (c *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet) {
// Everything else
flagext.DefaultValues(&c.LiveStoreClient)
c.LiveStoreClient.GRPCClientConfig.GRPCCompression = defaultGRPCCompression
flagext.DefaultValues(&c.IngesterClient)
c.IngesterClient.GRPCClientConfig.GRPCCompression = defaultGRPCCompression
flagext.DefaultValues(&c.BackenSchedulerClient)
c.BackenSchedulerClient.GRPCClientConfig.GRPCCompression = defaultGRPCCompression
c.Overrides.RegisterFlagsAndApplyDefaults(f)

c.Distributor.RegisterFlagsAndApplyDefaults(util.PrefixConfig(prefix, "distributor"), f)
c.Ingester.RegisterFlagsAndApplyDefaults(util.PrefixConfig(prefix, "ingester"), f)
c.Generator.RegisterFlagsAndApplyDefaults(util.PrefixConfig(prefix, "generator"), f)
c.Ingest.RegisterFlagsAndApplyDefaults(util.PrefixConfig(prefix, "ingest"), f)
c.BlockBuilder.RegisterFlagsAndApplyDefaults(util.PrefixConfig(prefix, "block-builder"), f)
Expand All @@ -165,7 +172,7 @@ func (c *Config) MultitenancyIsEnabled() bool {
// CheckConfig checks if config values are suspect and returns a bundled list of warnings and explanation.
func (c *Config) CheckConfig() []ConfigWarning {
var warnings []ConfigWarning
if c.LiveStore.CompleteBlockTimeout < c.StorageConfig.Trace.BlocklistPoll {
if c.Ingester.CompleteBlockTimeout < c.StorageConfig.Trace.BlocklistPoll {
warnings = append(warnings, warnCompleteBlockTimeout)
}

Expand Down Expand Up @@ -250,8 +257,8 @@ type ConfigWarning struct {

var (
warnCompleteBlockTimeout = ConfigWarning{
Message: "live_store.complete_block_timeout < storage.trace.blocklist_poll",
Explain: "You may receive 404s between the time the live-store has flushed a trace and the querier is aware of the new block",
Message: "ingester.complete_block_timeout < storage.trace.blocklist_poll",
Explain: "You may receive 404s between the time the ingesters have flushed a trace and the querier is aware of the new block",
}
warnBlockRetention = ConfigWarning{
Message: "backend_worker.compaction.compacted_block_timeout < storage.trace.blocklist_poll",
Expand Down
4 changes: 0 additions & 4 deletions cmd/tempo/app/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/grafana/tempo/modules/blockbuilder"
"github.com/grafana/tempo/modules/frontend"
"github.com/grafana/tempo/modules/livestore"
"github.com/grafana/tempo/tempodb/backend/s3"
"github.com/stretchr/testify/assert"

Expand Down Expand Up @@ -68,9 +67,6 @@ func TestConfig_CheckConfig(t *testing.T) {
"foo-0": {0},
},
},
LiveStore: livestore.Config{
CompleteBlockTimeout: 30 * time.Second,
},
},
expect: []ConfigWarning{
warnCompleteBlockTimeout,
Expand Down
Loading
Loading