class_docstr: The parent class of custom metrics.
  
  Ray's custom metrics APIs are rooted from this class and share
  the same public methods.
class_docstr_tok: ["The","parent","class","of","custom","metrics",".","Ray","'s","custom","metrics","APIs","are","rooted","from","this","class","and","share","the","same","public","methods","."]
docstr: Set default tags of metrics.
  
  Example:
      >>> from ray.util.metrics import Counter
      >>> # Note that set_default_tags returns the instance itself.
      >>> counter = Counter("name", tag_keys=("a",))
      >>> counter2 = counter.set_default_tags({"a": "b"})
      >>> assert counter is counter2
      >>> # this means you can instantiate it in this way.
      >>> counter = Counter("name", tag_keys=("a",)).set_default_tags({"a": "b"})
  
  Args:
      default_tags: Default tags that are
          used for every record method.
  
  Returns:
      Metric: it returns the instance itself.
docstr_tok: ["Set","default","tags","of","metrics",".","Example",":",">",">",">","from","ray.util.metrics","import","Counter",">",">",">","#","Note","that","set_default_tags","returns","the","instance","itself",".",">",">",">","counter","=","Counter","(","``","name","''",",","tag_keys=","(","``","a","''",",",")",")",">",">",">","counter2","=","counter.set_default_tags","(","{","``","a","''",":","``","b","''","}",")",">",">",">","assert","counter","is","counter2",">",">",">","#","this","means","you","can","instantiate","it","in","this","way",".",">",">",">","counter","=","Counter","(","``","name","''",",","tag_keys=","(","``","a","''",",",")",")",".set_default_tags","(","{","``","a","''",":","``","b","''","}",")","Args",":","default_tags",":","Default","tags","that","are","used","for","every","record","method",".","Returns",":","Metric",":","it","returns","the","instance","itself","."]
code: def set_default_tags(self, default_tags: Dict[str, str]):
      """Set default tags of metrics.
  
      Example:
          >>> from ray.util.metrics import Counter
          >>> # Note that set_default_tags returns the instance itself.
          >>> counter = Counter("name", tag_keys=("a",))
          >>> counter2 = counter.set_default_tags({"a": "b"})
          >>> assert counter is counter2
          >>> # this means you can instantiate it in this way.
          >>> counter = Counter("name", tag_keys=("a",)).set_default_tags({"a": "b"})
  
      Args:
          default_tags: Default tags that are
              used for every record method.
  
      Returns:
          Metric: it returns the instance itself.
      """
      for key, val in default_tags.items():
          if key not in self._tag_keys:
              raise ValueError(f"Unrecognized tag key {key}.")
          if not isinstance(val, str):
              raise TypeError(
                  f"Tag values must be str, got {type(val)}."
              )
  
      self._default_tags = default_tags
      return self
  
imports: import logging
  from typing import Dict, Any, List, Optional, Tuple, Union
  from ray._raylet import Sum, Histogram, Gauge
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 2 for calling the Metric obj's underlying member method code with example usage: obj.set_default_tags(default_tags) and returns: self