{"id":10215,"date":"2023-06-23T01:43:43","date_gmt":"2023-06-23T08:43:43","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/configure-prometheus\/"},"modified":"2023-06-23T01:43:43","modified_gmt":"2023-06-23T08:43:43","slug":"configure-prometheus","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/configure-prometheus\/","title":{"rendered":"Prometheus \uad6c\uc131\ud558\uae30"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Prometheus is configured through a single YAML file called <code>prometheus.yml<\/code>. When we configured Prometheus to run as a service, we specified the path of <code>\/etc\/prometheus\/prometheus.yml<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After changing the file, the prometheus service will need to be restarted to pickup the changes.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When we installed prometheus we configured an additional tool called <code>promtool<\/code>. It can be used to interact with prometheus, execute queries as well as validate configuration files.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>promtool check config \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Prometheus ingests stats via scrape jobs, we will configure 10 different scrape jobs for the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Prometheus<\/li>\n\n\n<li>Node Exporter<\/li>\n\n\n<li>Process Exporter<\/li>\n\n\n<li>Buckets<\/li>\n\n\n<li>Indexes<\/li>\n\n\n<li>Query<\/li>\n\n\n<li>XDCR<\/li>\n\n\n<li>System<\/li>\n\n\n<li>Eventing<\/li>\n\n\n<li>Analytics<\/li>\n\n\n<li>FTS<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">You do not have to restart Prometheus after adding each job listed below. The restarts and validation are simply added for verification purposes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A full <code>prometheus.yml<\/code> file can be found at <a href=\"https:\/\/github.com\/couchbaselabs\/cbprometheus_python\/blob\/master\/prometheus\/prometheus.yml\">https:\/\/github.com\/couchbaselabs\/cbprometheus_python\/blob\/master\/prometheus\/prometheus.yml<\/a><\/p>\n\n\n\n<h3 id=\"h-configure-prometheus-to-monitor-itself\" class=\"wp-block-heading\">Configure Prometheus to Monitor Itself<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the prometheus configuration file<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following contents<\/p>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>global:\n  scrape_interval: 60s # How frequently to scrape targets by default.\n  scrape_timeout: 10s # How long until a scrape request times out.\n  evaluation_interval: 60s # How frequently to evaluate rules.\n\n# A scrape configuration\nscrape_configs:\n  - job_name: prometheus\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 60s\n    scrape_timeout: 55s\n    metrics_path: \/metrics\n    static_configs:\n    - targets: [&#039;localhost:9090&#039;]\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Validate the target has been added and is being monitored.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The new job <code>prometheus<\/code> should be listed with a status of &#8220;Up&#8221;. If the status shows as &#8220;Unknown&#8221; give it a few seconds and refresh.<\/p>\n\n\n\n<h3 id=\"h-setup-file-service-discovery\" class=\"wp-block-heading\">Setup File Service Discovery<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When configuring Prometheus to monitor itself, a <a href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/configuration\/configuration\/#static_config\">static config<\/a> was used. For the remaining jobs, a <a href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/configuration\/configuration\/#file_sd_config\">file_sd_config<\/a> will be used.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the following directory and file with the appropriate permissions.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo mkdir \/etc\/prometheus\/file_sd\nsudo touch \/etc\/prometheus\/file_sd\/couchbase.yml\nsudo chown prometheus:prometheus \/etc\/prometheus\/file_sd\nsudo chown prometheus:prometheus \/etc\/prometheus\/file_sd\/couchbase.yml\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>\/etc\/prometheus\/file_sd\/couchbase.yml<\/code> with each of the Couchbase Exporter instances that have been configured.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/file_sd\/couchbase.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>- targets:\n  - node1.cluster1.example.org\n  - node2.cluster1.example.org\n  - node3.cluster1.example.org\n  - node1.cluster2.example.org\n  - node2.cluster2.example.org\n  - node3.cluster2.example.org\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once Prometheus has been fully configured, anytime new nodes are added edit the <code>\/etc\/prometheus\/file_sd\/couchbase.yml<\/code> file with the new nodes. The nodes will automatically be picked up by Prometheus and monitored without a restart of Prometheus being required.<\/p>\n\n\n\n<h3 id=\"h-configure-node-exporter-job\" class=\"wp-block-heading\">Configure Node Exporter Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you have not <a href=\"\/tutorial-node-exporter-setup?learningPath=learn\/couchbase-prometheus-integration-guide\">configured Node Exporter<\/a>, skip this step and proceed to the next step. Here we will configure the Node Exporter job to gather system metrics from each of our nodes in each of the clusters.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Couchbase Exporter will be used as a proxy to Node Exporter, the Couchbase Exporter will add the labels of <code>cluster=\"...\", node=\"...\"<\/code> to the metrics returned by Node Exporter, this way the Node Exporter metrics can be associated with Couchbase metrics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following job.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: node_exporter\n    honor_labels: true\n    scheme: http\n    scrape_interval: 10s\n    scrape_timeout: 9s\n    metrics_path: \/metrics\/node_exporter\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Spacing is very important in YAML and we want to validate our changes before they take effect. You can validate your Prometheus config by issuing the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>promtool check config \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-configure-process-exporter-job\" class=\"wp-block-heading\">Configure Process Exporter Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you have not <a href=\"\/tutorial-process-exporter-setup?learningPath=learn\/couchbase-prometheus-integration-guide\">configured Process Exporter<\/a>, skip this step and proceed to the next step. Here we will configure the Process Exporter to gather system metrics from each of our nodes in each of the clusters.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Couchbase Exporter will be used as a proxy to Process Exporter, the Couchbase Exporter will add the labels of <code>cluster=\"...\", node=\"...\"<\/code> to the metrics returned by Process Exporter, this way the Process Exporter metrics can be associated with Couchbase metrics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following job.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: process_exporter\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 10s\n    scrape_timeout: 9s\n    metrics_path: \/metrics\/process_exporter\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-configure-couchbase-buckets-job\" class=\"wp-block-heading\">Configure Couchbase Buckets Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following under the <code>scrape_configs:<\/code> block.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: couchbase-buckets\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 60s\n    scrape_timeout: 55s\n    metrics_path: \/metrics\/buckets\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n    metric_relabel_configs:\n      # if the stat name starts with data_* strip off index_\n      - source_labels: [__name__]\n        regex: &#039;data_(.*)&#039;\n        replacement: &#039;$1&#039;\n        target_label: __name__\n      # add data_ to the start of every stat\n      - source_labels: [__name__]\n        regex: &#039;(.*)&#039;\n        replacement: &#039;data_$1&#039;\n        target_label: __name__\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Notice in this instance there are 2 targets configured, one on port <code>5000<\/code> and one on <code>5001<\/code> this is to illustrate monitoring multiple clusters. In Step 3 we demonstrated how to configure multiple clusters and configure the appropriate ini files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Additionally, for this job we are leveraging a metric_renamer. This takes an existing Couchbase stat as exposed by the exporter and renames it. This ensures for this job, every stat that is ingested is prefixed with <code>data_<\/code>. This is useful when using issuing PromQL statements or querying in Grafana which we will cover later.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-configure-couchbase-indexes-job\" class=\"wp-block-heading\">Configure Couchbase Indexes Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following under the <code>scrape_configs:<\/code> block.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: couchbase-indexes\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 60s\n    scrape_timeout: 55s\n    metrics_path: \/metrics\/indexes\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n    metric_relabel_configs:\n      # if the stat name starts with index_* strip off index_\n      - source_labels: [__name__]\n        regex: &#039;index_(.*)&#039;\n        replacement: &#039;$1&#039;\n        target_label: __name__\n      # add index_ to the start of every stat\n      - source_labels: [__name__]\n        regex: &#039;(.*)&#039;\n        replacement: &#039;index_$1&#039;\n        target_label: __name__\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-configure-couchbase-queries-job\" class=\"wp-block-heading\">Configure Couchbase Queries Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following under the <code>scrape_configs:<\/code> block.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: couchbase-queries\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 60s\n    scrape_timeout: 55s\n    metrics_path: \/metrics\/query\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n    metric_relabel_configs:\n      # if the stat name starts with query_* strip off index_\n      - source_labels: [__name__]\n        regex: &#039;query_(.*)&#039;\n        replacement: &#039;$1&#039;\n        target_label: __name__\n      # add query_ to the start of every stat\n      - source_labels: [__name__]\n        regex: &#039;(.*)&#039;\n        replacement: &#039;query_$1&#039;\n        target_label: __name__\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you do not want slow queries to be returned from the <code>\/metrics\/queries<\/code> endpoint, you can add the following block to the job:<\/p>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>    params:\n      slow_queries: false\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-configure-couchbase-xdcr-job\" class=\"wp-block-heading\">Configure Couchbase XDCR Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following under the <code>scrape_configs:<\/code> block.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: couchbase-xdcr\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 60s\n    scrape_timeout: 55s\n    metrics_path: \/metrics\/xdcr\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n    metric_relabel_configs:\n      # if the stat name starts with xdcr_* strip off index_\n      - source_labels: [__name__]\n        regex: &#039;xdcr_(.*)&#039;\n        replacement: &#039;$1&#039;\n        target_label: __name__\n      # add xdcr_ to the start of every stat\n      - source_labels: [__name__]\n        regex: &#039;(.*)&#039;\n        replacement: &#039;xdcr_$1&#039;\n        target_label: __name__\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-configure-couchbase-system-job\" class=\"wp-block-heading\">Configure Couchbase System Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following under the <code>scrape_configs:<\/code> block.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: couchbase-system\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 60s\n    scrape_timeout: 55s\n    metrics_path: \/metrics\/system\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n    metric_relabel_configs:\n      # if the stat name starts with system_* strip off index_\n      - source_labels: [__name__]\n        regex: &#039;system_(.*)&#039;\n        replacement: &#039;$1&#039;\n        target_label: __name__\n      # add system_ to the start of every stat\n      - source_labels: [__name__]\n        regex: &#039;(.*)&#039;\n        replacement: &#039;system_$1&#039;\n        target_label: __name__\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-configure-couchbase-eventing-job\" class=\"wp-block-heading\">Configure Couchbase Eventing Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Even if you are not currently using Eventing in your deployment, it is suggested to monitor it via Prometheus and the Couchbase Exporter. This way if it is ever enabled, you will begin to immediately start to monitor it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following under the <code>scrape_configs:<\/code> block.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: couchbase-eventing\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 60s\n    scrape_timeout: 55s\n    metrics_path: \/metrics\/eventing\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n    metric_relabel_configs:\n      # if the stat name starts with eventing_* strip off index_\n      - source_labels: [__name__]\n        regex: &#039;eventing_(.*)&#039;\n        replacement: &#039;$1&#039;\n        target_label: __name__\n      # add eventing_ to the start of every stat\n      - source_labels: [__name__]\n        regex: &#039;(.*)&#039;\n        replacement: &#039;eventing_$1&#039;\n        target_label: __name__\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-configure-couchbase-analytics-job\" class=\"wp-block-heading\">Configure Couchbase Analytics Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Even if you are not currently using Analytics in your deployment, it is suggested to monitor it via Prometheus and the Couchbase Exporter. This way if it is ever enabled, you will begin to immediately start to monitor it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following under the <code>scrape_configs:<\/code> block.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: couchbase-analytics\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 60s\n    scrape_timeout: 55s\n    metrics_path: \/metrics\/analytics\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n    metric_relabel_configs:\n      # if the stat name starts with analytics_* strip off index_\n      - source_labels: [__name__]\n        regex: &#039;analytics_(.*)&#039;\n        replacement: &#039;$1&#039;\n        target_label: __name__\n      # add analytics_ to the start of every stat\n      - source_labels: [__name__]\n        regex: &#039;(.*)&#039;\n        replacement: &#039;analytics_$1&#039;\n        target_label: __name__\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-configure-couchbase-fts-job\" class=\"wp-block-heading\">Configure Couchbase FTS Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Even if you are not currently using FTS in your deployment, it is suggested to monitor it via Prometheus and the Couchbase Exporter. This way if it is ever enabled, you will begin to immediately start to monitor it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following under the <code>scrape_configs:<\/code> block.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: couchbase-fts\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 60s\n    scrape_timeout: 55s\n    metrics_path: \/metrics\/fts\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n    metric_relabel_configs:\n      # if the stat name starts with fts_* strip off index_\n      - source_labels: [__name__]\n        regex: &#039;fts_(.*)&#039;\n        replacement: &#039;$1&#039;\n        target_label: __name__\n      # add fts_ to the start of every stat\n      - source_labels: [__name__]\n        regex: &#039;(.*)&#039;\n        replacement: &#039;fts_$1&#039;\n        target_label: __name__\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n\n\n\n<h3 id=\"h-configure-couchbase-cbstats-job\" class=\"wp-block-heading\">Configure Couchbase cbstats Job<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This job will execute cbstats against each node in the cluster. These metrics are different than the ones that have been previously gathered and should be queried at an independent interval as the values returned are point in time without a history. This requires that every node in the cluster is configured with a public\/private key pair and that the system variables are set in the exporter configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the <code>prometheus.yml<\/code> file and add the following under the <code>scrape_configs:<\/code> block.<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo vi \/etc\/prometheus\/prometheus.yml\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code language-yaml\"><code>  - job_name: couchbase-cbstats\n    honor_labels: true\n    honor_timestamps: true\n    scheme: http\n    scrape_interval: 60s\n    scrape_timeout: 55s\n    metrics_path: \/metrics\/cbstats\n    file_sd_configs:\n      - files:\n        - \/etc\/prometheus\/file_sd\/couchbase.yml\n    metric_relabel_configs:\n      # if the stat name starts with fts_* strip off index_\n      - source_labels: [__name__]\n        regex: &#039;cbstats_(.*)&#039;\n        replacement: &#039;$1&#039;\n        target_label: __name__\n      # add fts_ to the start of every stat\n      - source_labels: [__name__]\n        regex: &#039;(.*)&#039;\n        replacement: &#039;cbstats_$1&#039;\n        target_label: __name__\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Prometheus<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>sudo systemctl restart prometheus\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Prometheus UI and validate the new job is listed and is &#8220;Up&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code language-bash\"><code>http:\/\/&lt;prometheus-ip&gt;:9090\/targets\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Prometheus is configured through a single YAML file called prometheus.yml. When we configured Prometheus to run as a service, we specified the path of \/etc\/prometheus\/prometheus.yml. After changing the file, the prometheus service will need to be restarted to pickup the changes. When we installed prometheus we configured an additional tool called promtool. It can be [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"tutorial-languages":[551],"tutorial-tags":[553,571,563,570],"tutorial-technologies":[559,554],"tutorial-types":[555],"class_list":["post-10215","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-any","tutorial-tags-configuration","tutorial-tags-monitoring","tutorial-tags-observability","tutorial-tags-prometheus","tutorial-technologies-connectors","tutorial-technologies-server","tutorial-types-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Configure Prometheus - Couchbase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/configure-prometheus\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Configure Prometheus\" \/>\n<meta property=\"og:description\" content=\"Prometheus is configured through a single YAML file called prometheus.yml. When we configured Prometheus to run as a service, we specified the path of \/etc\/prometheus\/prometheus.yml. After changing the file, the prometheus service will need to be restarted to pickup the changes. When we installed prometheus we configured an additional tool called promtool. It can be [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/configure-prometheus\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Couchbase\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2548\" \/>\n\t<meta property=\"og:image:height\" content=\"1171\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@couchbase\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"11\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/configure-prometheus\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/configure-prometheus\\\/\",\"name\":\"Configure Prometheus - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#website\"},\"datePublished\":\"2023-06-23T08:43:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/configure-prometheus\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/configure-prometheus\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/developers\\\/tutorials\\\/configure-prometheus\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Configure Prometheus\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/\",\"name\":\"Couchbase\",\"description\":\"The Operational Data Platform for AI\u2122\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#organization\"},\"alternateName\":\"Couchbase, Inc.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#organization\",\"name\":\"Couchbase\",\"alternateName\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"width\":1129,\"height\":1129,\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/ko\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Couchbase\\\/\",\"https:\\\/\\\/x.com\\\/couchbase\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/CouchbaseServer\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/couchbase\\\/\",\"https:\\\/\\\/github.com\\\/couchbase\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Couchbase,_Inc.\"],\"description\":\"Couchbase is a database software company headquartered in San Jose, California, providing an operational data platform for AI used by hundreds of global enterprises.\",\"legalName\":\"Couchbase, Inc.\",\"foundingDate\":\"2011-01-01\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Configure Prometheus - Couchbase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/configure-prometheus\/","og_locale":"ko_KR","og_type":"article","og_title":"Configure Prometheus","og_description":"Prometheus is configured through a single YAML file called prometheus.yml. When we configured Prometheus to run as a service, we specified the path of \/etc\/prometheus\/prometheus.yml. After changing the file, the prometheus service will need to be restarted to pickup the changes. When we installed prometheus we configured an additional tool called promtool. It can be [&hellip;]","og_url":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/configure-prometheus\/","og_site_name":"Couchbase","article_publisher":"https:\/\/www.facebook.com\/Couchbase\/","og_image":[{"width":2548,"height":1171,"url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@couchbase","twitter_misc":{"Est. reading time":"11\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/configure-prometheus\/","url":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/configure-prometheus\/","name":"Configure Prometheus - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/ko\/#website"},"datePublished":"2023-06-23T08:43:43+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/configure-prometheus\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/configure-prometheus\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/ko\/developers\/tutorials\/configure-prometheus\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"Configure Prometheus"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/ko\/#website","url":"https:\/\/www.couchbase.com\/ko\/","name":"\ucf54\uc6b0\uce58\ubca0\uc774\uc2a4","description":"The Operational Data Platform for AI\u2122","publisher":{"@id":"https:\/\/www.couchbase.com\/ko\/#organization"},"alternateName":"Couchbase, Inc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/ko\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/ko\/#organization","name":"\ucf54\uc6b0\uce58\ubca0\uc774\uc2a4","alternateName":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/ko\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/ko\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","width":1129,"height":1129,"caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/ko\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Couchbase\/","https:\/\/x.com\/couchbase","https:\/\/www.youtube.com\/c\/CouchbaseServer","https:\/\/www.linkedin.com\/company\/couchbase\/","https:\/\/github.com\/couchbase\/","https:\/\/en.wikipedia.org\/wiki\/Couchbase,_Inc."],"description":"Couchbase\ub294 \uce98\ub9ac\ud3ec\ub2c8\uc544\uc8fc \uc0cc\ud638\uc138\uc5d0 \ubcf8\uc0ac\ub97c \ub454 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \ud68c\uc0ac\ub85c, \uc218\ubc31 \uac1c\uc758 \uae00\ub85c\ubc8c \uae30\uc5c5\uc5d0\uc11c \ud65c\uc6a9\ud558\ub294 \uc778\uacf5\uc9c0\ub2a5\uc744 \uc704\ud55c \uc6b4\uc601 \ub370\uc774\ud130 \ud50c\ub7ab\ud3fc\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.","legalName":"Couchbase, Inc.","foundingDate":"2011-01-01"}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorials\/10215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorials\/10215\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/media?parent=10215"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-languages?post=10215"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-tags?post=10215"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-technologies?post=10215"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/ko\/wp-json\/wp\/v2\/tutorial-types?post=10215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}