@@ -2,29 +2,39 @@ import Config
22
33# Per-node resource budget. Lives in runtime config because it builds `Unit.*`
44# values, which are only loadable once the app's modules are on the code path.
5- config :hyper , Hyper.Node.Config .Budget ,
5+ config :hyper , Hyper.Cfg .Budget ,
66 mem_max: Unit.Information . gib ( 4 ) ,
77 disk_max: Unit.Information . gib ( 4 ) ,
88 cpu_max_load: 0.8 ,
9+ cpu_max_cap: 4.0 ,
910 disk_bw_cap: Unit.Bandwidth . gibps ( 1 ) ,
1011 disk_bw_max_load: 0.8 ,
1112 net_bw_cap: Unit.Bandwidth . gibps ( 1 ) ,
1213 net_bw_max_load: 0.8
1314
14- # Where to send traces. Defaults to Honeycomb; override OTEL_EXPORTER_OTLP_*
15- # to point at any OTLP/HTTP backend (Collector, Grafana, etc).
15+ # Operator overrides from a well-known location. An optional Elixir config file
16+ # at /etc/hyper/config.exs (override the path with HYPER_CONFIG) is merged in
17+ # last, so its values win over every default set above. An absent file is a
18+ # no-op — the normal case in dev and CI. Skipped under :test so the suite never
19+ # reads host state.
20+ #
21+ # OpenTelemetry exporter wiring is resolved through Hyper.Cfg.Otel so that the
22+ # operator's `config :hyper, Hyper.Cfg.Otel, ...` stanza (if present) takes
23+ # precedence over the TOML table and environment variables.
1624if config_env ( ) != :test do
17- endpoint = System . get_env ( "OTEL_EXPORTER_OTLP_ENDPOINT" , "https://api.honeycomb.io" )
25+ hyper_config = System . get_env ( "HYPER_CONFIG" ) || "/etc/hyper/config.exs"
1826
19- headers =
20- case System . get_env ( "HONEYCOMB_API_KEY" ) do
21- nil -> [ ]
22- "" -> [ ]
23- key -> [ { "x-honeycomb-team" , key } ]
24- end
27+ operator =
28+ if File . exists? ( hyper_config ) ,
29+ do: Config.Reader . read! ( hyper_config , env: config_env ( ) ) ,
30+ else: [ ]
2531
26- config :opentelemetry_exporter ,
27- otlp_protocol: :http_protobuf ,
28- otlp_endpoint: endpoint ,
29- otlp_headers: headers
32+ otel_exs = get_in ( operator , [ :hyper , Hyper.Cfg.Otel ] ) || [ ]
33+
34+ case Hyper.Cfg.Otel . exporter_options ( otel_exs ) do
35+ { :ok , opts } -> config :opentelemetry_exporter , opts
36+ :none -> config :opentelemetry , traces_exporter: :none
37+ end
38+
39+ for { app , kw } <- operator , do: config ( app , kw )
3040end
0 commit comments