Skip to content

Stop depending on WEBrick to serve metrics #277

Open

Description

@Watson1978

WEBrick is not meant for production use. Its README says:

WEBrick is intended for use in testing and local development. It is not intended for production use, and it is not intended to receive traffic from untrusted sources.

A WEBrick maintainer also said that WEBrick issues are not handled as vulnerabilities for this reason (ruby/webrick#145 (comment)). Fluentd is moving away from WEBrick for the same reason (fluent/fluentd#4648).

in_prometheus still serves metrics with WEBrick in two cases.

  • The deprecated <ssl> section with extra_conf. extra_conf is passed to WEBrick as SSL options, so it has no meaning without WEBrick.
  • An IPv6 bind address (fix: Add IPv6 support for bind parameter #240). The http_server helper could not build a URI for IPv6 addresses at that time.

# Use webrick for IPv6 or SSL extra_conf
# The http_server helper has issues with IPv6 URI construction
if (@ssl && @ssl['enable'] && @ssl['extra_conf']) || @bind.include?(':')
start_webrick
return

The gemspec does not declare webrick. It is installed only because fluentd depends on it, and Ruby does not bundle it since 3.0. Once fluentd drops the dependency, both cases will fail with LoadError: cannot load such file -- webrick.

Possible direction:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions