MetaCredo.Check.Observability.MissingTelemetryForExternalHttp (MetaCredo v0.1.0)

View Source

Detects external HTTP client calls (e.g. HTTPoison.get, Req.post, Tesla.request, Finch.request) without telemetry instrumentation. External requests should be wrapped with telemetry to track API latency, failure rates, and service health.

Only module-qualified calls whose module name contains an HTTP library hint are flagged, so local helpers and stdlib functions (e.g. Access.get, Map.fetch!) are never reported.

Category: Observability / Priority: normal

Configuration

Accepts the following parameters via .metacredo.exs:

  • http_client_modules - Fragments matched against the MODULE part of qualified calls (default: {:sigil_W, [delimiter: "[", line: 10, column: 28], [{:<<>>, [line: 10, column: 28], ["\n httpoison req tesla finch mint gun faraday hackney ibrowse\n httpclient webclient restclient http https api client\n "]}, []]})
  • http_methods - HTTP verbs matched against the method (last dot-segment) of calls (default: {:sigil_W, [delimiter: "[", line: 16, column: 21], [{:<<>>, [line: 16, column: 21], ["get post put patch delete head options request fetch send"]}, []]})
  • telemetry_indicators - Function name fragments indicating telemetry wrapping (default: {:sigil_W, [delimiter: "[", line: 17, column: 29], [{:<<>>, [line: 17, column: 29], ["telemetry emit log trace metric record measure span"]}, []]})