beam-telemetry / telemetry_metrics_statsd

Telemetry.Metrics reporter for StatsD-compatible metric servers
https://hexdocs.pm/telemetry_metrics_statsd
MIT License
75 stars 44 forks source link

Warning on startup when using with nimble_options 0.4 #68

Closed hoyon closed 2 years ago

hoyon commented 2 years ago

Hi!

We're getting this warning on startup

warning: :rename_to is deprecated. Handle renaming after validation.
  (nimble_options 0.4.0) lib/nimble_options.ex:451: NimbleOptions.validate_value/3
  (nimble_options 0.4.0) lib/nimble_options.ex:437: NimbleOptions.validate_option/3
  (nimble_options 0.4.0) lib/nimble_options.ex:409: NimbleOptions.reduce_options/2
  (elixir 1.12.3) lib/enum.ex:4286: Enumerable.List.reduce/3
  (elixir 1.12.3) lib/enum.ex:2431: Enum.reduce_while/3
  (nimble_options 0.4.0) lib/nimble_options.ex:402: NimbleOptions.validate_options/2
  (nimble_options 0.4.0) lib/nimble_options.ex:377: NimbleOptions.validate_options_with_schema_and_path/3
  (nimble_options 0.4.0) lib/nimble_options.ex:409: NimbleOptions.reduce_options/2
  (elixir 1.12.3) lib/enum.ex:4286: Enumerable.List.reduce/3
  (elixir 1.12.3) lib/enum.ex:2431: Enum.reduce_while/3
  (nimble_options 0.4.0) lib/nimble_options.ex:402: NimbleOptions.validate_options/2
  (nimble_options 0.4.0) lib/nimble_options.ex:377: NimbleOptions.validate_options_with_schema_and_path/3
  (nimble_options 0.4.0) lib/nimble_options.ex:302: NimbleOptions.new!/1
  (nimble_options 0.4.0) lib/nimble_options.ex:278: NimbleOptions.validate/2
  (telemetry_metrics_statsd 0.6.1) lib/telemetry_metrics_statsd/options.ex:76: TelemetryMetricsStatsd.Opt
ions.validate/1
  (telemetry_metrics_statsd 0.6.1) lib/telemetry_metrics_statsd.ex:377: TelemetryMetricsStatsd.start_link
/1
  (stdlib 3.16.1) supervisor.erl:414: :supervisor.do_start_child_i/3
  (stdlib 3.16.1) supervisor.erl:400: :supervisor.do_start_child/2

This seems to be due to nimble_options deprecating the :rename_to option. See: https://github.com/dashbitco/nimble_options/blob/main/CHANGELOG.md#v040

I guess the options are to pin the nimble_options to version 0.3 or remove the deprecated :rename_to option from the options schema.

arkgil commented 2 years ago

Hey @hoyon, thanks for opening an issue, good catch! Do you think you could contribute a fix? I think removing the usage of the :rename_to option is the best way forward.

ximura commented 2 years ago

Hi! @arkgil are you planning making release with this fix?

arkgil commented 2 years ago

Just did https://github.com/beam-telemetry/telemetry_metrics_statsd/pull/69#issuecomment-1003351111 😄