prop/lib/microwaveprop/weather
Graham McIntire 38ef716a7c
fix(logging): suppress /metrics logs and harden scorer hot path
- endpoint.ex log_level/1 now filters by conn.request_path instead of
  conn.path_info. Plug.Router.forward/2 (deps/plug/lib/plug.ex:170)
  rewrites path_info to the unmatched remainder and extends script_name
  with the matched prefix before dispatching to the forwarded plug.
  /metrics is routed via forward "/metrics", MetricsPlug; by the time
  Plug.Telemetry's before_send callback fires inside MetricsPlug.call/2
  the conn it observes has path_info: [] and script_name: ["metrics"],
  so the old log_level(%{path_info: ["metrics" | _]}) clause never
  matched and the default :info level fired. request_path is set by
  the adapter at entry and is never rewritten, making it the correct
  discriminator. New regression test in metrics_log_suppression_test.exs
  captures both the direct shape and the integration path via Plug.Test.

- Scorer.dbz_to_rain_rate_mmhr/1 now uses a compile-time @mp_inv_b
  constant (1 / 1.6) instead of dividing on every rain pixel.
  composite_score/2's band-invariant fallback switched from four
  separate  short-circuits (which silently
  mixed cached and freshly-computed values if only some keys were
  passed) to a single Map.has_key?/2 branch that honors the "all or
  none" contract. Dropped unused band_invariant_tod/1 helper.

- Propagation.replace_scores span scope tightened: the
  Instrument.span([:db, :replace_scores]) now wraps only the per-band
  ScoresFile.write! loop, not the upstream Enum.group_by grouping
  phase. The span name + metadata stay unchanged so Grafana panels
  keep working, but the fixed telemetry dispatch cost (~100µs x 2)
  is no longer paid for trivially small result sets.

- Added @type t :: %__MODULE__{...} to Accounts.UserToken and
  Weather.HrrrClimatology — the last two schemas that lacked one.
  Elixir 1.19's set-theoretic inference benefits from every struct
  having an explicit t/0 so callers can flow through tightly.

mix dialyzer --format short | grep ^lib/ | wc -l -> 0
mix test: 2165 tests, 3 pre-existing flakes, 0 new regressions.
2026-04-21 10:44:25 -05:00
..
grib2 fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
frontal_analysis.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
gefs_client.ex feat(telemetry): wide instrumentation + bump hrrr to 2 per pod 2026-04-18 16:33:34 -05:00
gefs_profile.ex feat(gefs): scaffold extended-horizon forecast ingestion 2026-04-18 14:28:44 -05:00
grid_cache.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
hrrr_client.ex perf: reduce per-pod RSS and HRRR chain wall time 2026-04-19 14:56:48 -05:00
hrrr_climatology.ex fix(logging): suppress /metrics logs and harden scorer hot path 2026-04-21 10:44:25 -05:00
hrrr_native_client.ex Fix credo warnings: struct specs, length/1, and test patterns 2026-04-12 10:26:53 -05:00
hrrr_native_profile.ex Extend skew-T plot to cover the full troposphere 2026-04-14 17:25:58 -05:00
hrrr_point_enqueuer.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
hrrr_profile.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
iem_client.ex perf(weather): token-bucket IEM limiter + parallel HRRR surface/pressure 2026-04-19 12:57:30 -05:00
iem_rate_limiter.ex perf(weather): token-bucket IEM limiter + parallel HRRR surface/pressure 2026-04-19 12:57:30 -05:00
iemre_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
metar_5min_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
narr_client.ex feat(telemetry): wide instrumentation + bump hrrr to 2 per pod 2026-04-18 16:33:34 -05:00
narr_profile.ex Rename ERA5 → NARR across the codebase 2026-04-16 09:22:23 -05:00
ncei_metar_client.ex feat(telemetry): broaden Instrument span coverage 2026-04-18 17:25:33 -05:00
nexrad_cache.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
nexrad_client.ex perf(nexrad): route fetch_decoded_frame through NexradCache 2026-04-19 09:05:55 -05:00
nexrad_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
rtma_client.ex feat(telemetry): broaden Instrument span coverage 2026-04-18 17:25:33 -05:00
rtma_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
solar_client.ex feat(telemetry): broaden Instrument span coverage 2026-04-18 17:25:33 -05:00
solar_index.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
sounding.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
sounding_params.ex Fix credo warnings: struct specs, length/1, and test patterns 2026-04-12 10:26:53 -05:00
station.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
surface_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
theta_e.ex Guard against zero specific humidity in theta-e computation 2026-04-11 12:52:32 -05:00
uwyo_sounding_client.ex feat(telemetry): wide instrumentation + bump hrrr to 2 per pod 2026-04-18 16:33:34 -05:00
weather_layers.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00