You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: usage_metric_definition_generator.rb
    path of file: ./repos/gitlabhq/lib/generators/gitlab
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# DEPRECATED. Consider using using Internal Events tracking framework
# https://docs.gitlab.com/ee/development/internal_analytics/internal_event_instrumentation/quick_st
    
    def validate!
      raise "--dir option is required" unless input_dir.present?
      raise "Invalid dir #{input_dir}, allowed options are #{VALID_INPUT_DIRS.join(', ')}" unless directory.present?

      key_paths.each do |key_path|
        raise "Metric definition with key path '#{key_path}' already exists" if metric_definition_exists?(key_path)
      end
    end