# Log Metric

Launch stage: GA

`POST /api/2.0/mlflow/runs/log-metric`

Log a metric for a run. A metric is a key-value pair (string key, float value) with an
 associated timestamp. Examples include the various metrics that represent ML model accuracy.
 A metric can be logged multiple times.

API scopes: mlflow

## Request body

- `run_id` (string, optional)
  ID of the run under which to log the metric. Must be provided.
- `run_uuid` (string, optional)
  [Deprecated, use `run_id` instead] ID of the run under which to log the metric. This field will
   be removed in a future MLflow version.
- `key` (string, optional)
  Name of the metric.
- `value` (double, optional)
  Double value of the metric being logged.
- `timestamp` (int64, optional)
  Unix timestamp in milliseconds at the time metric was logged.
- `step` (int64, optional)
  Step at which to log the metric
  Default: `0`
- `model_id` (string, optional)
  ID of the logged model associated with the metric, if applicable
- `dataset_name` (string, optional)
  The name of the dataset associated with the metric.
   E.g. “my.uc.table@2” “nyc-taxi-dataset”, “fantastic-elk-3”
- `dataset_digest` (string, optional)
  Dataset digest of the dataset associated with the metric,
   e.g. an md5 hash of the dataset that uniquely identifies it
   within datasets of the same name.

## Response

```json
{}
```

