Skip to main content
GET
/
metrics
cURL
curl \
  -X GET 'MEILISEARCH_URL/metrics'
import requests

url = "http://localhost:7700/metrics"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('http://localhost:7700/metrics', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_PORT => "7700",
  CURLOPT_URL => "http://localhost:7700/metrics",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:7700/metrics"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("http://localhost:7700/metrics")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("http://localhost:7700/metrics")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
"\n# HELP meilisearch_db_size_bytes Meilisearch DB Size In Bytes\n# TYPE meilisearch_db_size_bytes gauge\nmeilisearch_db_size_bytes 1130496\n# HELP meilisearch_batch_running_progress_trace The currently running progress trace\n# TYPE meilisearch_batch_running_progress_trace gauge\nmeilisearch_batch_running_progress_trace{batch_uid=\"0\",step_name=\"document\"} 0.710618582519409\nmeilisearch_batch_running_progress_trace{batch_uid=\"0\",step_name=\"extracting word proximity\"} 0.2222222222222222\nmeilisearch_batch_running_progress_trace{batch_uid=\"0\",step_name=\"indexing\"} 0.6666666666666666\nmeilisearch_batch_running_progress_trace{batch_uid=\"0\",step_name=\"processing tasks\"} 0\n# HELP meilisearch_http_requests_total Meilisearch HTTP requests total\n# TYPE meilisearch_http_requests_total counter\nmeilisearch_http_requests_total{method=\"GET\",path=\"/metrics\",status=\"400\"} 1\nmeilisearch_http_requests_total{method=\"PATCH\",path=\"/experimental-features\",status=\"200\"} 1\n# HELP meilisearch_http_response_time_seconds Meilisearch HTTP response times\n# TYPE meilisearch_http_response_time_seconds histogram\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"0.005\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"0.01\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"0.025\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"0.05\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"0.075\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"0.1\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"0.25\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"0.5\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"0.75\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"1\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"2.5\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"5\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"7.5\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"10\"} 0\nmeilisearch_http_response_time_seconds_bucket{method=\"GET\",path=\"/metrics\",le=\"+Inf\"} 0\nmeilisearch_http_response_time_seconds_sum{method=\"GET\",path=\"/metrics\"} 0\nmeilisearch_http_response_time_seconds_count{method=\"GET\",path=\"/metrics\"} 0\n# HELP meilisearch_last_finished_batches_progress_trace_ms The last few batches progress trace in milliseconds\n# TYPE meilisearch_last_finished_batches_progress_trace_ms gauge\nmeilisearch_last_finished_batches_progress_trace_ms{batch_uid=\"0\",step_name=\"processing tasks\"} 19360\nmeilisearch_last_finished_batches_progress_trace_ms{batch_uid=\"0\",step_name=\"processing tasks > computing document changes\"} 368\nmeilisearch_last_finished_batches_progress_trace_ms{batch_uid=\"0\",step_name=\"processing tasks > computing document changes > preparing payloads\"} 367\nmeilisearch_last_finished_batches_progress_trace_ms{batch_uid=\"0\",step_name=\"processing tasks > computing document changes > preparing payloads > payload\"} 367\nmeilisearch_last_finished_batches_progress_trace_ms{batch_uid=\"0\",step_name=\"processing tasks > indexing\"} 18970\n# HELP meilisearch_index_count Meilisearch Index Count\n# TYPE meilisearch_index_count gauge\nmeilisearch_index_count 1\n# HELP meilisearch_index_docs_count Meilisearch Index Docs Count\n# TYPE meilisearch_index_docs_count gauge\nmeilisearch_index_docs_count{index=\"mieli\"} 2\n# HELP meilisearch_is_indexing Meilisearch Is Indexing\n# TYPE meilisearch_is_indexing gauge\nmeilisearch_is_indexing 0\n# HELP meilisearch_last_update Meilisearch Last Update\n# TYPE meilisearch_last_update gauge\nmeilisearch_last_update 1726675964\n# HELP meilisearch_nb_tasks Meilisearch Number of tasks\n# TYPE meilisearch_nb_tasks gauge\nmeilisearch_nb_tasks{kind=\"indexes\",value=\"mieli\"} 39\nmeilisearch_nb_tasks{kind=\"statuses\",value=\"canceled\"} 0\nmeilisearch_nb_tasks{kind=\"statuses\",value=\"enqueued\"} 0\nmeilisearch_nb_tasks{kind=\"statuses\",value=\"failed\"} 4\nmeilisearch_nb_tasks{kind=\"statuses\",value=\"processing\"} 0\nmeilisearch_nb_tasks{kind=\"statuses\",value=\"succeeded\"} 35\nmeilisearch_nb_tasks{kind=\"types\",value=\"documentAdditionOrUpdate\"} 9\nmeilisearch_nb_tasks{kind=\"types\",value=\"documentDeletion\"} 0\nmeilisearch_nb_tasks{kind=\"types\",value=\"documentEdition\"} 0\nmeilisearch_nb_tasks{kind=\"types\",value=\"dumpCreation\"} 0\nmeilisearch_nb_tasks{kind=\"types\",value=\"indexCreation\"} 0\nmeilisearch_nb_tasks{kind=\"types\",value=\"indexDeletion\"} 8\nmeilisearch_nb_tasks{kind=\"types\",value=\"indexSwap\"} 0\nmeilisearch_nb_tasks{kind=\"types\",value=\"indexUpdate\"} 0\nmeilisearch_nb_tasks{kind=\"types\",value=\"settingsUpdate\"} 22\nmeilisearch_nb_tasks{kind=\"types\",value=\"snapshotCreation\"} 0\nmeilisearch_nb_tasks{kind=\"types\",value=\"taskCancelation\"} 0\nmeilisearch_nb_tasks{kind=\"types\",value=\"taskDeletion\"} 0\n# HELP meilisearch_used_db_size_bytes Meilisearch Used DB Size In Bytes\n# TYPE meilisearch_used_db_size_bytes gauge\nmeilisearch_used_db_size_bytes 409600\n# HELP meilisearch_last_indexed_documents_count The last number of indexed documents in a batch\n# TYPE meilisearch_last_indexed_documents_count gauge\nmeilisearch_last_indexed_documents_count{batch_uid=\"0\",index=\"movies\"} 31944\n# HELP meilisearch_last_indexed_documents_duration_ms The duration in ms of the last batch that indexed documents\n# TYPE meilisearch_last_indexed_documents_duration_ms gauge\nmeilisearch_last_indexed_documents_duration_ms{batch_uid=\"0\",index=\"movies\"} 17904\n"
{
  "message": "The Authorization header is missing. It must use the bearer authorization method.",
  "code": "missing_authorization_header",
  "type": "auth",
  "link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}

Authorizations

Authorization
string
header
required

An API key is a token that you provide when making API calls. Read more about how to secure your project.

Include the API key to the Authorization header, for instance:

-H 'Authorization: Bearer 6436fc5237b0d6e0d64253fbaac21d135012ecf1'

If you use a SDK, ensure you instantiate the client with the API key, for instance with JS SDK:

const client = new MeiliSearch({
  host: 'MEILISEARCH_URL',
  apiKey: '6436fc5237b0d6e0d64253fbaac21d135012ecf1'
});

Response

The metrics of the instance.

The response is of type string.