docstr: Add a counter metric or increment an existing counter metric
      Default metric type is counter
  Parameters
  ----------
  name: str
      metric name
  value: int or float
      value of the metric
  idx: str
      request id to be associated with the metric
  dimensions: list
      list of Dimension objects for the metric
docstr_tok: ["Add","a","counter","metric","or","increment","an","existing","counter","metric","Default","metric","type","is","counter","Parameters","--","--","--","--","--","name",":","str","metric","name","value",":","int","or","float","value","of","the","metric","idx",":","str","request","id","to","be","associated","with","the","metric","dimensions",":","list","list","of","Dimension","objects","for","the","metric"]
code: def add_counter(
      self,
      name: str,
      value: int or float,
      idx: str = None,
      dimensions: list = [],
  ):
      """
      Add a counter metric or increment an existing counter metric
          Default metric type is counter
      Parameters
      ----------
      name: str
          metric name
      value: int or float
          value of the metric
      idx: str
          request id to be associated with the metric
      dimensions: list
          list of Dimension objects for the metric
      """
      req_id = self._get_req(idx)
      dimensions = self._add_default_dims(req_id, dimensions)
      metric = self._get_or_add_metric(
          name, "count", dimensions, MetricTypes.COUNTER
      )
      metric.add_or_update(
          value, [dim.value for dim in dimensions], req_id
      )
  
imports: import abc
  import os
  import ts.metrics.metric_cache_errors
  from ts.metrics.dimension import Dimension
  from ts.metrics.metric_abstract import MetricAbstract
  from ts.metrics.metric_type_enum import MetricTypes
label_desc: Use image node_id 6 for calling the MetricCacheAbstract obj's underlying member method code with example usage: obj.add_counter(name, value, idx, dimensions) without return types