What is the meaning of the parameter “metrics” in the method model.compile in Keras?

I don't have very clear the meaning of the parameter metrics of the compile method of the class model in Keras:

model.compile(..., metrics = ['accuracy'], ...)


the documentation states:

List of metrics to be evaluated by the model during training and testing

what I don't understand is:

are these the metrics used to evaluate the performance of the network at the end of each training epoch, i.e. at the end of each epoch the code makes the network predict on the training set and calculates the metrics passed

OR

are these the metrics used to train the network, i.e. is the network trained with the goal of obtaining the best possible value for these metrics (I don't know how it could do this, something like: if the recall is low then it corrects the weights more when working with positive samples)?

(or it has another meaning?)

The argument metrics is meant to define your criterion for training evaluation. Let me make an example: if you are training a classifier, you want to evaluate your model based on how accurate (in percentage) it is. Therefore, your metric is accuracy (experessed as a float in the [0, 1] range). The higher the accuracy, the lower the loss, the better the model.
metrics must not be confused with loss. The loss function is something you need in order to "punish" your model when it makes mistakes. The loss function is at the basics of backpropagation and of weight update, it's the loss object what Neural Networks use to learn. Metrics instead is something that humans watch to understand how good a model is and communicate it.