Skip to content
Merged
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
2 changes: 1 addition & 1 deletion cmd/fanout-docgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ var groups = map[string]groupPage{
},
"ingest": {
Title: "Ingest settings",
Description: "The advertised OTLP endpoint, batching, and the default namespace.",
Description: "Telemetry batching and the default namespace.",
Summary: "Settings for how telemetry arrives and how it is batched before it is written.",
ReadWhen: []string{
"Exporters cannot reach the instance.",
Expand Down
7 changes: 5 additions & 2 deletions docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ This is a breaking configuration change:
4. Enable HTTP/2 backend forwarding for gRPC at any proxy. Remove obsolete
ingest port mappings and proxy upstreams. A separate ingest hostname may
still route to the same Fanout port if required by the edge configuration.
5. Set `FANOUT_PUBLIC_URL` to the external origin so setup instructions advertise
the reachable endpoint. An explicit `FANOUT_INGEST_ADVERTISED_ENDPOINT` wins.
5. Set `FANOUT_PUBLIC_URL` to the external origin so setup instructions start
with the reachable endpoint. If collectors use a different private hostname,
edit the endpoint on **Connect telemetry** before copying the configuration.
Remove `FANOUT_INGEST_ADVERTISED_ENDPOINT` or YAML
`ingest.advertised_endpoint`; these guidance-only settings are rejected.

Local comparison results are in [the single-port benchmark report](benchmarks/single-port-2026-09-08.md).

Expand Down
1 change: 0 additions & 1 deletion fanout.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ server:
key_file: "" # FANOUT_TLS_KEY_FILE

ingest:
advertised_endpoint: "" # FANOUT_INGEST_ADVERTISED_ENDPOINT
default_namespace: default # FANOUT_DEFAULT_NAMESPACE
batch_size: 50000 # FANOUT_INGEST_BATCH_SIZE

Expand Down
6 changes: 3 additions & 3 deletions internal/api/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,9 @@ func TestSetupExpiryAndExistingAdminRetry(t *testing.T) {
})
}

func TestSetupReturnsAdvertisedIngestEndpoint(t *testing.T) {
const endpoint = "https://ingest.example.com"
s := newTestAuthServerWith(t, config.Config{AuthMode: "local", IngestAdvertisedEndpoint: endpoint}, auth.SMTPConfig{})
func TestSetupReturnsPublicIngestEndpoint(t *testing.T) {
const endpoint = "https://fanout.example.com"
s := newTestAuthServerWith(t, config.Config{AuthMode: "local", PublicURL: endpoint}, auth.SMTPConfig{})
req := httptest.NewRequest(http.MethodPost, "/api/auth/setup", strings.NewReader(`{"email":"admin@example.com","setup_token":"`+s.setupToken+`"}`))
req.Header.Set("Content-Type", "application/json")
rec := httptest.NewRecorder()
Expand Down
3 changes: 0 additions & 3 deletions internal/api/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ type ingestResponse struct {
}

func suggestedIngestEndpoint(req *http.Request, cfg config.Config) string {
if cfg.IngestAdvertisedEndpoint != "" {
return cfg.IngestAdvertisedEndpoint
}
if cfg.PublicURL != "" {
return strings.TrimRight(cfg.PublicURL, "/")
}
Expand Down
1 change: 0 additions & 1 deletion internal/api/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func TestSuggestedIngestEndpoint(t *testing.T) {
host string
want string
}{
{"advertised wins", config.Config{PublicURL: "https://fanout.example.com", IngestAdvertisedEndpoint: "https://ingest.example.com"}, "ignored", "https://ingest.example.com"},
{"public origin", config.Config{Addr: ":7520", PublicURL: "https://fanout.example.com/"}, "internal:7520", "https://fanout.example.com"},
{"request port", config.Config{Addr: ":7520"}, "localhost:8080", "http://localhost:8080"},
{"direct TLS", config.Config{TLSCertFile: "cert", TLSKeyFile: "key"}, "fanout.example.com:8443", "https://fanout.example.com:8443"},
Expand Down
18 changes: 6 additions & 12 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@ const maxIngestBatchSize = 50_000
// Elapsed-time settings use time.Duration with unit-bearing values.
type Config struct {
// Addr binds the browser, API, MCP, OTLP/gRPC and OTLP/HTTP listener.
Addr string `koanf:"server.addr" env:"FANOUT_ADDR" default:":7520"`
// IngestAdvertisedEndpoint is the OTLP endpoint shown in collector setup
// guidance (e.g. "https://ingest.example.com"). It is an operator hint for
// trusted services and collectors, not a public-client or mobile endpoint;
// it does not control the bind address. Empty uses server.public_url, or
// the browser request origin when no public URL is configured.
IngestAdvertisedEndpoint string `koanf:"ingest.advertised_endpoint" env:"FANOUT_INGEST_ADVERTISED_ENDPOINT"`
DataDir string `koanf:"storage.data_dir" env:"FANOUT_DATA_DIR" default:"./data"`
IngestBatchSize int `koanf:"ingest.batch_size" env:"FANOUT_INGEST_BATCH_SIZE" default:"50000"`
RollupInterval time.Duration `koanf:"storage.rollup_interval" env:"FANOUT_ROLLUP_INTERVAL" default:"1m"`
MCPEnabled bool `koanf:"mcp.enabled" env:"FANOUT_MCP_ENABLED" default:"true"`
RetentionDays int `koanf:"storage.retention_days" env:"FANOUT_RETENTION_DAYS" default:"30"`
Addr string `koanf:"server.addr" env:"FANOUT_ADDR" default:":7520"`
DataDir string `koanf:"storage.data_dir" env:"FANOUT_DATA_DIR" default:"./data"`
IngestBatchSize int `koanf:"ingest.batch_size" env:"FANOUT_INGEST_BATCH_SIZE" default:"50000"`
RollupInterval time.Duration `koanf:"storage.rollup_interval" env:"FANOUT_ROLLUP_INTERVAL" default:"1m"`
MCPEnabled bool `koanf:"mcp.enabled" env:"FANOUT_MCP_ENABLED" default:"true"`
RetentionDays int `koanf:"storage.retention_days" env:"FANOUT_RETENTION_DAYS" default:"30"`
// MaintenanceInterval controls Parquet retention and compaction, and
// query-cache checkpointing.
MaintenanceInterval time.Duration `koanf:"storage.maintenance_interval" env:"FANOUT_MAINTENANCE_INTERVAL" default:"1h"`
Expand Down
36 changes: 3 additions & 33 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,36 +110,6 @@ func TestLoadTypedEnvironmentValues(t *testing.T) {
}
}

func TestLoadAdvertisedIngestEndpoint(t *testing.T) {
const endpoint = "https://ingest.example.com"

t.Run("environment", func(t *testing.T) {
cfg, err := Load(LoadOptions{Environ: append(validEnvironment(),
"FANOUT_INGEST_ADVERTISED_ENDPOINT="+endpoint,
)})
if err != nil {
t.Fatalf("Load: %v", err)
}
if cfg.IngestAdvertisedEndpoint != endpoint {
t.Fatalf("IngestAdvertisedEndpoint = %q, want %q", cfg.IngestAdvertisedEndpoint, endpoint)
}
})

t.Run("YAML", func(t *testing.T) {
path := filepath.Join(t.TempDir(), "fanout.yaml")
if err := os.WriteFile(path, []byte("ingest:\n advertised_endpoint: "+endpoint+"\n"), 0o600); err != nil {
t.Fatalf("write config: %v", err)
}
cfg, err := Load(LoadOptions{Path: path, Environ: validEnvironment()})
if err != nil {
t.Fatalf("Load: %v", err)
}
if cfg.IngestAdvertisedEndpoint != endpoint {
t.Fatalf("IngestAdvertisedEndpoint = %q, want %q", cfg.IngestAdvertisedEndpoint, endpoint)
}
})
}

func TestLoadTreatsEmptyEnvironmentValuesAsAbsent(t *testing.T) {
cfg, err := Load(LoadOptions{Environ: append(validEnvironment(),
"FANOUT_ADDR=",
Expand Down Expand Up @@ -843,7 +813,7 @@ func TestSecureCookies(t *testing.T) {
}
}

func TestRemovedIngestListenersRejected(t *testing.T) {
func TestRemovedListenerAndEndpointSettingsRejected(t *testing.T) {
t.Run("old server address", func(t *testing.T) {
path := filepath.Join(t.TempDir(), "fanout.yaml")
if err := os.WriteFile(path, []byte("server:\n http_addr: ':7520'\n"), 0o600); err != nil {
Expand All @@ -853,7 +823,7 @@ func TestRemovedIngestListenersRejected(t *testing.T) {
t.Fatalf("removed key: %v", err)
}
})
for _, key := range []string{"otlp_grpc_addr", "otlp_http_addr"} {
for _, key := range []string{"otlp_grpc_addr", "otlp_http_addr", "advertised_endpoint"} {
t.Run(key, func(t *testing.T) {
path := filepath.Join(t.TempDir(), "fanout.yaml")
if err := os.WriteFile(path, []byte("ingest:\n "+key+": ':4317'\n"), 0o600); err != nil {
Expand All @@ -864,7 +834,7 @@ func TestRemovedIngestListenersRejected(t *testing.T) {
}
})
}
for _, name := range []string{"FANOUT_HTTP_ADDR", "FANOUT_OTLP_GRPC_ADDR", "FANOUT_OTLP_HTTP_ADDR"} {
for _, name := range []string{"FANOUT_HTTP_ADDR", "FANOUT_OTLP_GRPC_ADDR", "FANOUT_OTLP_HTTP_ADDR", "FANOUT_INGEST_ADVERTISED_ENDPOINT"} {
if _, err := Load(LoadOptions{Environ: append(validEnvironment(), name+"=:4317")}); err == nil || !strings.Contains(err.Error(), name) {
t.Fatalf("removed variable: %v", err)
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading