code: def metric_create(self):
          
          body = {
              'dataType': self._metric_data_type,
              'description': self._metric_description,
              'interval': self._metric_interval,
              'name': self._metric_name,
              'keyedValues': self._metric_keyed,
          }
          self.tcex.log.debug('metric body: {}'.format(body))
          r = self.tcex.session.post('/v2/customMetrics', json=body)
  
          if not r.ok or 'application/json' not in r.headers.get('content-type', ''):
              self.tcex.handle_error(700, [r.status_code, r.text])
  
          data = r.json()
          self._metric_id = data.get('data', {}).get('customMetricConfig', {}).get('id')
          self.tcex.log.debug('metric data: {}'.format(data))
docs: Create the defined metric.
  
          .. code-block:: javascript
  
              {
                  "status": "Success",
                  "data": {
                      "customMetricConfig": {
                          "id": 12,
                          "name": "Added Reports",
                          "dataType": "Sum",
                          "interval": "Daily",
                          "keyedValues": false,
                          "description": "Added reports daily count."
                      }
                  }
              }