{"id":3006,"date":"2023-10-30T12:43:23","date_gmt":"2023-10-30T19:43:23","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/"},"modified":"2023-10-30T12:43:23","modified_gmt":"2023-10-30T19:43:23","slug":"scraping-database-metrics-from-couchbase-capella-with-prometheus","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/","title":{"rendered":"Scraping Database Metrics from Couchbase Capella with Prometheus"},"content":{"rendered":"\n<p><span>In this blog post, the first in a series, we&#8217;re going to show you how to set up a Prometheus server and connect it to your Couchbase Capella Database in order to collect metrics.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span>What is Prometheus?<\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/prometheus.io\/\"><span>Prometheus<\/span><\/a><span> is a very popular open-source systems monitoring and alerting toolkit, with a very active developer and user community. It was originally built at <\/span><a href=\"https:\/\/soundcloud.com\/\"><span>SoundCloud<\/span><\/a><span>, but is now a standalone open source project, maintained independently of any company, and it joined the <\/span><a href=\"https:\/\/cncf.io\/\"><span>Cloud Native Computing Foundation<\/span><\/a><span> in 2016 as the second hosted project, after <\/span><a href=\"https:\/\/kubernetes.io\/\"><span>Kubernetes<\/span><\/a><span>.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span>What is Couchbase Capella?<\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/cloud.couchbase.com\/\"><span>Couchbase Capella<\/span><\/a><span> is our fully-managed Database as a Service (DBaaS) offering, the easiest and fastest way to begin with Couchbase and to eliminate ongoing database management efforts. Your Capella Database contains a native Prometheus scrape target, allowing you to connect your Prometheus (or Prometheus-compatible) monitoring systems to collect metrics.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span>Prerequisites<\/span><\/h2>\n\n\n\n<p><span>To follow the steps in this guide, you&#8217;ll need a working Docker installation (which we&#8217;ll use to deploy Prometheus), a Capella Database, and some common shell utilities.<\/span><\/p>\n\n\n\n<p><i><span>Note: It is outside of the scope of this post to show how to install and configure <\/span><\/i><a href=\"https:\/\/www.docker.com\/\"><i><span>Docker<\/span><\/i><\/a><i><span>. There are many tutorials out there, including Docker&#8217;s own <\/span><\/i><a href=\"https:\/\/www.docker.com\/get-started\/\"><i><span>Get Started with Docker<\/span><\/i><\/a><i><span>. We&#8217;ll assume at this point that you have successfully installed and tested it (with e.g. <\/span><\/i><a href=\"https:\/\/hub.docker.com\/_\/hello-world\"><i><span>Hello, World!<\/span><\/i><\/a><i><span>).<\/span><\/i><\/p>\n\n\n\n<p><i><span>At the time of writing, the latest version of Prometheus was 2.46. The steps here were carried out using Rancher Desktop 1.9.1, with the Container Engine set to dockerd (moby), and using the provided docker CLI. The expectation is that the steps should work as is on any current Docker installation, or an equivalent stack such as containerd with the nerdctl CLI.<\/span><\/i><\/p>\n\n\n\n<p><i><span>Lastly, the commands shared here are suitable for short-lived, standalone development environments &#8211; you should of course follow your local best practices for networking and security where appropriate.<\/span><\/i><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span>Running a Prometheus Server in Docker<\/span><\/h2>\n\n\n\n<p><span>Let&#8217;s just jump right in and run the latest Prometheus container (<\/span><a href=\"https:\/\/hub.docker.com\/r\/prom\/prometheus\"><span>prom\/prometheus<\/span><\/a><span>) with its default settings.<\/span><\/p>\n\n\n\n<p><span>The <\/span><span>docker run<\/span><span> command has many options, but for this example we&#8217;ll just use a <\/span><span><em>-p<\/em> \/ <em>&#8211;publish<\/em><\/span><span> to expose the Prometheus port (which defaults to <em>9090<\/em>) so that we can access it from our local browser, and an <\/span><em><span>&#8211;rm<\/span><\/em><span> to make sure that the container is cleaned up when it exits.<\/span><\/p>\n\n\n\n<p><span>By default the running container will remain &#8220;attached&#8221;, streaming the logs to Standard Output (in this case, your terminal). Let&#8217;s do that for the first run so we can make sure it starts up correctly:<\/span><\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n\n\n\n<p><span>Unless you see any errors in the console output, you should now have a Prometheus server running at <\/span><a href=\"https:\/\/localhost:9090\/\"><span><em>https:\/\/localhost:9090\/<\/em><\/span><\/a><span>. Open it up in a browser window, and you should see something like this:<\/span><\/p>\n\n\n\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/10\/01.Prometheus.Console.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-14999\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/01.Prometheus.Console-1024x260-1.png\" alt=\"\" width=\"900\" height=\"229\"><\/a><\/p>\n\n\n\n<p><span>Now go back to your terminal window and hit <em>Ctrl+C<\/em> to kill the running container, then we&#8217;ll start it again, but this time using a <\/span><span><em>-d<\/em> \/ <em>&#8211;detach<\/em><\/span><span> to background it and free up our terminal:<\/span><\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n\n\n\n<p><span>On success, Docker will print out the Container ID, and you can also find it with <\/span><span><em>docker ps<\/em>.<\/span><span>\u00a0As you&#8217;ll need it for some of the later steps anyway, let&#8217;s filter (with <\/span><span><em>-f<\/em> \/<em> &#8211;filter<\/em><\/span><span>) the output of <\/span><em><span>docker ps<\/span><\/em><span> to show just the container ID that we want, based on the network ports that we&#8217;re using (in this case we&#8217;re publishing port <em>9090<\/em>):<\/span><\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker ps &#8211;filter publish=9090[\/crayon]<\/p>\n\n\n\n<p><span>We can add a <\/span><span><em>-q<\/em> \/<em> &#8211;quiet<\/em><\/span><span> to <\/span><i><span>only<\/span><\/i><span> output the Container ID, and use the result in another command. For example, to view the logs of the Prometheus container you just started:<\/span><\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker logs $(docker ps &#8211;quiet &#8211;filter publish=9090)[\/crayon]<\/p>\n\n\n\n<p><span>That command will output something similar to when you started the Prometheus server the first time, when the container was still attached to the terminal. You can use the same technique with (for example) <\/span><em><span>docker exec<\/span><\/em><span> (if you want to start a shell in a running container), or <\/span><em><span>docker kill<\/span><\/em><span> (to send a signal to the container).<\/span><\/p>\n\n\n\n<p><span>Let&#8217;s take a deeper look at the Prometheus server you have running on <\/span><em><a href=\"https:\/\/localhost:9090\/\"><span>https:\/\/localhost:9090\/<\/span><\/a><\/em><span>. If you navigate to <strong>Status -&gt; Targets<\/strong>, you can see that there is already a job running:<\/span><\/p>\n\n\n\n<p><span><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/10\/02.Prometheus.Targets.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-15000\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/02.Prometheus.Targets-1024x208-1.png\" alt=\"\" width=\"900\" height=\"183\"><\/a><\/span><\/p>\n\n\n\n<p><span>This Prometheus server has been configured to scrape <\/span><i><span>itself<\/span><\/i><span> as a target, which you can confirm by viewing its configuration (<strong>Status -&gt; Configuration<\/strong>):<\/span><\/p>\n\n\n\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/10\/03.Prometheus.Config.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-15001\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/03.Prometheus.Config-1024x417-1.png\" alt=\"\" width=\"900\" height=\"367\"><\/a><\/p>\n\n\n\n<p><span>You can see in the above that there is a job named <\/span><em><span>prometheus<\/span><\/em><span>, which is targeting <\/span><em><span>localhost:9090\/metrics<\/span><\/em><span> (<\/span><em><span>targets + metrics_path<\/span><\/em><span>). See <\/span><a href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/getting_started\/#configuring-prometheus-to-monitor-itself\"><span>Configuring Prometheus to monitor itself<\/span><\/a><span> for a sample configuration.<\/span><\/p>\n\n\n\n<p><span>Before we go back to our terminal, let&#8217;s take a quick look at metrics being scraped in the above job. If you click on Graph, you&#8217;ll find the <\/span><a href=\"https:\/\/prometheus.io\/docs\/visualization\/browser\/\"><span>Expression Browser<\/span><\/a><span>, which allows you to enter PromQL expressions (see <\/span><a href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/querying\/basics\/\"><span>Querying Prometheus<\/span><\/a><span> for an overview), and view the results.<\/span><\/p>\n\n\n\n<p><span>Note the <strong>Expression Browser<\/strong> is only meant for adhoc usage &#8211; the recommendation is to use <\/span><a href=\"https:\/\/prometheus.io\/docs\/visualization\/grafana\/\"><span>Grafana<\/span><\/a><span> as a fully-fledged graphing solution, and we&#8217;ll look at that in a future post. In the meantime, as a quick example, this is the number of time series currently stored in its own database (<\/span><em><span>prometheus_tsdb_head_series<\/span><\/em><span>):<\/span><\/p>\n\n\n\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/10\/04.Prometheus.Graphs.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-15002\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/04.Prometheus.Graphs-1024x590-1.png\" alt=\"\" width=\"900\" height=\"519\"><\/a><\/p>\n\n\n\n<p><span>If we want to add our Capella Database as a Scrape Job in our Prometheus server, this means we need to make changes to the configuration we saw above, but the configuration is baked into our container image. Once we have a final configuration we can rebuild the image, but for now it would be much more convenient if we could apply new configuration options and test without going to that much effort.<\/span><\/p>\n\n\n\n<p><span>Let&#8217;s make use of Docker&#8217;s<\/span><span><em> -v<\/em> \/ <em>&#8211;volume<\/em><\/span><span> option, which allows you to mount a local file or directory in the container. The Prometheus configuration file in the container is <\/span><em><span>\/etc\/prometheus\/prometheus.yml<\/span><\/em><span> &#8211; if that was the only file we needed then we could simply mount the file directly, but we&#8217;ll need a few more than that so we&#8217;ll mount a directory instead.<\/span><\/p>\n\n\n\n<p><span>In your working directory, create a sub-directory that we&#8217;ll use to keep our configuration (<\/span><em><span>prometheus.yml<\/span><\/em><span>) and other associated files.<\/span><\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;miva&#8221; decode=&#8221;true&#8221;]mkdir prometheus[\/crayon]<\/p>\n\n\n\n<p><span>Now we need a copy of the configuration file that we can work with. As always, there&#8217;s more than one way to do this, but by far the simplest is to use the <\/span><span>docker cp<\/span><span> command, to copy <\/span><em><span>\/etc\/prometheus\/prometheus.yml<\/span><\/em><span> from your running container, out to a local file:<\/span><\/p>\n\n\n<p>[crayon wrap=&#8221;true&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker cp $(docker ps &#8211;quiet &#8211;filter publish=9090):\/etc\/prometheus\/prometheus.yml prometheus\/[\/crayon]<\/p>\n\n\n\n<p><span>Now kill your currently-running container:<\/span><\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker kill $(docker ps &#8211;quiet &#8211;filter publish=9090)[\/crayon]<\/p>\n\n\n\n<p><span>And then start a new container, this time mounting your local <\/span><em><span>prometheus<\/span><\/em><span> directory as <\/span><em><span>\/etc\/prometheus\/<\/span><\/em><span> in the container:<\/span><\/p>\n\n\n<p>[crayon wrap=&#8221;true&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 &#8211;volume $(pwd)\/prometheus\/:\/etc\/prometheus\/ prom\/prometheus[\/crayon]<\/p>\n\n\n\n<p><span>If, like the author, you find yourself wondering how to tell if the Prometheus server is really using your copy of <\/span><em><span>prometheus.yml<\/span><\/em><span> or not, you can check the mounts inside the container to make sure that <\/span><em><span>\/etc\/prometheus\/ <\/span><\/em><span>is specifically mounted with:<\/span><\/p>\n\n\n<p>[crayon wrap=&#8221;true&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker exec $(docker ps &#8211;quiet &#8211;filter publish=9090) mount | grep &#8216;\/etc\/prometheus'[\/crayon]<\/p>\n\n\n\n<p><span>You could also make a small change to the configuration (for example, the name of the existing scrape job), and this should be reflected in the console (at <\/span><a href=\"https:\/\/localhost:9090\/config\"><span>https:\/\/localhost:9090\/config<\/span><\/a><span>).<\/span><\/p>\n\n\n\n<p><span>Lastly for this section, as we&#8217;ll be making a few changes to our configuration file, it would be good if we didn&#8217;t have to recreate the container to apply the changes. Prometheus does have a built-in API method for this, discussed in <\/span><a href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/configuration\/configuration\/\"><span>Configuration<\/span><\/a><span>, but the <\/span><em><span>&#8211;web.enable-lifecycle<\/span><\/em><span> option is not enabled by default in the official container. Fortunately (for MacOS and Linux users at least), there is the option to send a SIGHUP with <\/span><em><span>docker kill<\/span><\/em><span> (resulting in a &#8220;Loading configuration file&#8221; message in the logs):<\/span><\/p>\n\n\n<p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker kill &#8211;signal SIGHUP $(docker ps &#8211;quiet &#8211;filter publish=9090)[\/crayon]<\/p>\n\n\n\n<p><span>In summary so far then, we now have a running Prometheus server, we know how to check its logs, browse the metrics that it is scraping, and how to update and reload its configuration, making it easy for us to add in our Capella Database as a scrape target.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span>Adding a Capella Database to your Prometheus Server<\/span><\/h2>\n\n\n\n<p><span>Now we have a Prometheus server, let&#8217;s take a look at adding a Couchbase Capella database.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span>Prerequisites<\/span><\/h3>\n\n\n\n<p><span>For each database that you want to collect metrics from, you&#8217;re going to need:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span>The Connection Hostname<\/span><\/li>\n\n\n<li><span>User Credentials with the appropriate Database Access<\/span><\/li>\n\n\n<li><span>A Security Certificate<\/span><\/li>\n\n\n<li><span>One or more Allowed IP Addresses<\/span><\/li>\n\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><span>Connection Hostname<\/span><\/h4>\n\n\n\n<p><span>This is the hostname from your Connection String. Go to the <\/span><strong>Connect<\/strong><span> tab on your Database in the Capella UI and copy everything after the <\/span><em><span>couchbases:\/\/<\/span><\/em><span> scheme prefix. The one we&#8217;re using in our examples is: <\/span><span><em>cb.plmvshfqolmyxvpt.cloud.couchbase.com<\/em>.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span>User Credentials<\/span><\/h4>\n\n\n\n<p><span>A set of credentials (<\/span><span>username<\/span><span>\/<\/span><span>password<\/span><span>) that has <\/span><i><span>Read Access<\/span><\/i><span> to <\/span><i><span>All Buckets<\/span><\/i><span> and <\/span><i><span>All Scopes <\/span><\/i><span>in your Database (as <\/span><a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/manage-database-users.html#_footnoteref_1\"><span>noted<\/span><\/a><span>, the required <\/span><em><span>external_stats_reader<\/span><\/em><span> role is only granted when a <\/span><span>Database Credential is given Read Access to <\/span><i><span>all<\/span><\/i><span> Buckets in a Database<\/span><span>). If you don&#8217;t have one, you can create one from <strong>Settings -&gt; Database Access -&gt; Create Database Access<\/strong> (see <\/span><a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/manage-database-users.html\"><span>Configure Database Credentials<\/span><\/a><span>). In our examples, we&#8217;ll use <\/span><em><span>metrics_user<\/span><\/em><span> \/ <\/span><em><span>metrics_Passw0rd<\/span><\/em><span>.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span>Security Certificate<\/span><\/h4>\n\n\n\n<p><span>The Security Certificate for your Database. From your Database, go to <strong>Settings -&gt; Security Certificate<\/strong>, and click on Download. This will give you a PEM-formatted text file named after your cluster (in our case <\/span><em><span>bravetimbernerslee-root-certificate.txt<\/span><\/em><span>). Actually, the same signing certificate is used for all Capella Databases, so you only need to download it once, and can use the same Root Certificate to verify all your Capella Databases. To that end, we&#8217;ve renamed our local certificate file to <\/span><em><span>couchbase-cloud-root-certificate.pem<\/span><\/em><span> for clarity, and copied into our <\/span><em><span>prometheus<\/span><\/em><span> directory (in a subdirectory named <\/span><em><span>certs<\/span><\/em><span>) so that Prometheus can access it later.<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span>Allowed IP Addresses<\/span><\/h4>\n\n\n\n<p><span>Before any client can connect to a Capella Database, the client&#8217;s IP address must be added to the Database&#8217;s <\/span><a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/allow-ip-address.html\"><span>Allowed IP list<\/span><\/a><span>. For the purposes of following the steps here you most likely want to add your current IP address, in which case you can use the <strong>Add My IP<\/strong> button. For a production deployment you will need the public-facing IP address of your Prometheus server(s).<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span>Defining a new Scrape Config<\/span><\/h3>\n\n\n\n<p><span>Let&#8217;s start by taking a look at the existing job, that tells Prometheus to scrape from itself.<\/span><\/p>\n\n\n\n<p><span>If we ignore the global settings and defaults, it becomes the following:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n0<\/p>\n\n\n\n<p><span>If you look at the documentation for <\/span><a href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/configuration\/configuration\/#scrape_config\"><span>scrape_config<\/span><\/a><span> you can see that this is essentially the smallest possible definition of a job. There&#8217;s no TLS, no authentication, just a name and a single target (which with the defaults added becomes <\/span><em><span>https:\/\/localhost:9090\/metrics<\/span><\/em><span>).<\/span><\/p>\n\n\n\n<p><span>As an aside, you can test this out if you&#8217;re interested by loading up that URL in your browser, or by using <\/span><em><span>curl<\/span><\/em><span> on the CLI. The resulting output is in Prometheus&#8217; text-based <\/span><a href=\"https:\/\/prometheus.io\/docs\/instrumenting\/exposition_formats\/\"><span>Exposition Format<\/span><\/a><span>.<\/span><\/p>\n\n\n\n<p><span>Our new job will need a name &#8211; this needs to be unique across all scrape definitions, which is worth bearing in mind if you&#8217;re planning on adding multiple Capella Databases. For our example we&#8217;ll use the unique component of our Connection Hostname to differentiate, giving us:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n1<\/p>\n\n\n\n<p><span>We know that we&#8217;ll need to authenticate to access the metrics endpoint, using the credentials above:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n2<\/p>\n\n\n\n<p><span>All Capella communication is encrypted with TLS, so we&#8217;ll need to add a <\/span><a href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/configuration\/configuration\/#tls_config\"><span>tls_config<\/span><\/a><span> parameter using the certificate we downloaded earlier:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n3<\/p>\n\n\n\n<p><span>And relatedly, <\/span><span>scheme<\/span><span> defaults to <\/span><span>http<\/span><span>, so we&#8217;ll need:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n4<\/p>\n\n\n\n<p><span>The last thing we need to do is tell Prometheus the hostname(s)\/address(es) to use to connect to your Database, otherwise known as <\/span><em><span>targets<\/span><\/em><span>.<\/span><\/p>\n\n\n\n<p><span>In the <\/span><em><span>prometheus<\/span><\/em><span> job above, a single hostname is provided using the <\/span><em><span>static_config<\/span><\/em><span> parameter. As the name suggests, this is a way to statically define one or more <\/span><em><span>targets<\/span><\/em><span>, and these will not be updated or refreshed unless the Prometheus server is restarted, or its configuration file is reloaded.<\/span><\/p>\n\n\n\n<p><span>This is fine in this case, as the hostname (<\/span><em><span>localhost<\/span><\/em><span>) is never going to change. It might also be manageable if you have hostnames that change occasionally, and are only updated under controlled circumstances (for example a scheduled maintenance period where you can update your Prometheus configuration at the same time).<\/span><\/p>\n\n\n\n<p><span>But what if your hostnames do change frequently, and the timing of those changes is out of your control?\u00a0 If the application you are monitoring is hosted in any kind of cloud environment, where there is on-demand scaling, server replacement on failure, automated upgrades, then you&#8217;ll need a much more flexible method of specifying your <\/span><em><span>targets<\/span><\/em><span>.<\/span><\/p>\n\n\n\n<p><span>This is where Service Discovery comes in.<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span>Service Discovery<\/span><\/h3>\n\n\n\n<p><span>Prometheus Service Discovery (SD) is a mechanism that allows your Prometheus server to dynamically discover (and update) the list of targets to monitor for a particular application or service. At time of writing there are 28 different mechanisms, including generic options such as <\/span><a href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/configuration\/configuration\/#file_sd_config\"><span>File-<\/span><\/a><span> and <\/span><a href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/configuration\/configuration\/#http_sd_config\"><span>HTTP-based<\/span><\/a><span> Service Discovery, as well specific implementations for a large number of cloud platforms and applications (see the Prometheus <\/span><a href=\"https:\/\/prometheus.io\/docs\/prometheus\/latest\/configuration\/configuration\/\"><span>configuration documentation<\/span><\/a><span> for the full list).<\/span><\/p>\n\n\n\n<p><span>Let&#8217;s look at those two generic options in relation to your Couchbase Capella Database.<\/span><\/p>\n\n\n\n<p><i><span>File-based Service Discovery<\/span><\/i><span> (<\/span><em><span>file_sd_configs<\/span><\/em><span>) is where one or more filenames are provided to Prometheus, each file containing zero or more <\/span><em><span>static_config<\/span><\/em><span> entries. Prometheus will apply any well-formed <\/span><em><span>targets<\/span><\/em><span> it finds in those files, and will automatically load any changes when the files are updated.<\/span><\/p>\n\n\n\n<p><span>This mechanism is useful in that you can use it to connect to any arbitrary system, as long as you can get the host details into a correctly-formatted file (either manually or by any appropriate automation). However, you do need to make sure that the automation to update the file(s) is reliable.<\/span><\/p>\n\n\n\n<p><i><span>HTTP-based Service Discovery<\/span><\/i><span> (<\/span><em><span>http_sd_configs<\/span><\/em><span>) is similar to File-based, in that it provides a generic interface, with a payload containing zero or more <\/span><em><span>static_config<\/span><\/em><span> entries, but uses an HTTP connection to fetch the payload rather than reading a local file. This removes the dependency on any automation or human intervention, and as long as your target application provides the relevant API, would be preferred over the File-based option.<\/span><\/p>\n\n\n\n<p><span>At time of writing, we are in the process of upgrading the Capella estate from Couchbase Server 7.1 to 7.2 (see <a href=\"https:\/\/docs.couchbase.com\/cloud\/clusters\/upgrade-database.html\">Upgrading a Database<\/a> for more details). Server 7.1 only provides a basic File-based Service Discovery API, but in Server 7.2 we have added HTTP-based SD, as well as improved File-based SD.<\/span><\/p>\n\n\n\n<p>We&#8217;ll look first at the File-based Service Discovery method in Server 7.1. Feel free to skip ahead one section if you&#8217;re already running Server 7.2.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">File-based Service Discovery in Couchbase Server 7.1<\/h4>\n\n\n\n<p><span>The endpoint is <\/span><em><span>prometheus_sd_config.yaml<\/span><\/em><span>, you&#8217;ll need to authenticate with the same credentials as above, and provide the Capella Root Certificate we downloaded earlier.<\/span><\/p>\n\n\n\n<p><span>First, we&#8217;ll just use <\/span><em><span>curl<\/span><\/em><span> and stream the result to our terminal:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n5<\/p>\n\n\n\n<p>For our cluster this gives:<\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n6<\/p>\n\n\n\n<p><span>Here we can see the limitation of the current Service Discovery API &#8211; it will always return the insecure port (8091), which is no use to us in Capella as all communication is over the secure port (18091). This issue is fixed with the improvements in Server 7.2, but until those are available we need to add an extra step to update those port numbers.<\/span><\/p>\n\n\n\n<p>For the sake of this demo we&#8217;ll just pipe through <em>sed<\/em>, but you can do whatever is most appropriate for your environment:<\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n7<\/p>\n\n\n\n<p><span>For our cluster this now gives:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n8<\/p>\n\n\n\n<p><span>Now we have the correct output, we can redirect it to a file to use later in our job definition.<\/span><\/p>\n\n\n\n<p><span>In our working directory, we&#8217;ll use a subdirectory to keep our targets together, naming the files after the job name (in our case <\/span><em><span>capella-plmvshfqolmyxvpt<\/span><\/em><span>):<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker run &#8211;detach &#8211;rm &#8211;publish 9090:9090 prom\/prometheus[\/crayon]<\/p>\n9<\/p>\n\n\n\n<p><span>This is fine for our demo, but obviously you&#8217;ll want to make sure it&#8217;s robust and suitable for your own environment, adding error handling as appropriate. And crucially, you&#8217;ll need to schedule this to be run regularly to make sure that the list of targets is updated with any topology changes as they happen (running once per minute via <\/span><em><span>cron<\/span><\/em><span> for example, would be sufficient).<\/span><\/p>\n\n\n\n<p><span>We can now take everything we have above, add in our <\/span><em><span>file_sd_configs<\/span><\/em><span>, and our new job looks like this:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker ps &#8211;filter publish=9090[\/crayon]<\/p>\n0<\/p>\n\n\n\n<p>\u00a0<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span>HTTP-based Service Discovery in Couchbase Server 7.2<\/span><\/h4>\n\n\n\n<p><span>In Server 7.2 we&#8217;ve added a new endpoint (<\/span><em><span>prometheus_sd_config<\/span><\/em><span>), and similar to above you&#8217;ll need to authenticate with the credentials that you created, and provide the Capella Root Certificate we downloaded earlier.<\/span><\/p>\n\n\n\n<p><span>First, we&#8217;ll use <\/span><em><span>curl<\/span><\/em><span> and stream the result to our terminal. In the new API the default output is JSON, so we&#8217;re piping to <\/span><em><span>jq<\/span><\/em><span> for clarity:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker ps &#8211;filter publish=9090[\/crayon]<\/p>\n1<\/p>\n\n\n\n<p><span>For our upgraded cluster (where the hostnames have changed during the upgrade process), this gives:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker ps &#8211;filter publish=9090[\/crayon]<\/p>\n2<\/p>\n\n\n\n<p><span>This output is exactly what Prometheus is expecting, so we can take the arguments we used in the <\/span><em><span>curl<\/span><\/em><span> command and use them in an <\/span><em><span>http_sd_configs<\/span><\/em><span> scrape configuration in our new Prometheus job:\u00a0\u00a0<\/span><\/p>\n\n\n\n<p>\u00a0<\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker ps &#8211;filter publish=9090[\/crayon]<\/p>\n3<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span>Running your new Job<\/span><\/h3>\n\n\n\n<p><span>At this point you should have all you need to add the new scrape job to your Prometheus server.\u00a0 If you&#8217;re still using Couchbase Server 7.1 then it&#8217;ll be the <\/span><em><span>file_sd_configs<\/span><\/em><span> based one (with whatever steps you need to create the <\/span><span>targets<\/span><span> file), and if you&#8217;re running Server 7.2 then the <\/span><em><span>http_sd_configs<\/span><\/em><span> based version.<\/span><\/p>\n\n\n\n<p><span>Add the new job to your <\/span><em><span>prometheus.yml<\/span><\/em><span>, then reload the configuration with the <\/span><em><span>kill<\/span><\/em><span> command we used earlier:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker ps &#8211;filter publish=9090[\/crayon]<\/p>\n4<\/p>\n\n\n\n<p><span>You can then check the logs to make sure that the configuration loaded cleanly:<\/span><\/p>\n\n\n\n<p><p>[crayon nums=&#8221;false&#8221; lang=&#8221;sh&#8221; decode=&#8221;true&#8221;]docker ps &#8211;filter publish=9090[\/crayon]<\/p>\n5<\/p>\n\n\n\n<p><span>Remember you&#8217;re looking for a <em>Loading configuration file<\/em> log message, and as long as your config is valid, you should see a <em>Completed loading of configuration file<\/em>\u00a0message immediately after. If you don&#8217;t have a successful reload, then you need to address any issues and try again. Once you do, let&#8217;s go back over and look at the Prometheus console\u00a0 at <\/span><a href=\"https:\/\/localhost:9090\/\"><span>https:\/\/localhost:9090\/<\/span><\/a><span>.<\/span><\/p>\n\n\n\n<p><span>First let&#8217;s look at our new configuration (<strong>Status -&gt; Configuration<\/strong>), which should show the extra job we just added.<\/span><\/p>\n\n\n\n<p>This is the full configuration using File-based Service Discovery:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/10\/05.Prometheus.Config.with_.Capella.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-15003\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/05.Prometheus.Config.with_.Capella-1024x642-1.png\" alt=\"\" width=\"900\" height=\"564\"><\/a><\/p>\n\n\n\n<p>And here&#8217;s a snippet showing the HTTP-based scrape instead:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/10\/image_2023-11-02_172542859.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15037\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/image_2023-11-02_172542859-1024x140-1.png\" alt=\"\" width=\"885\" height=\"121\"><\/a><\/p>\n\n\n\n<p><span>Now, if we look at <strong>Status -&gt; Targets<\/strong>, it should show all the nodes from your Capella Database. For example, this is our cluster before the upgrade to Server 7.2:<\/span><\/p>\n\n\n\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/10\/06.Prometheus.Targets.with_.Capella.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-15004\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/06.Prometheus.Targets.with_.Capella-1024x469-1.png\" alt=\"\" width=\"900\" height=\"412\"><\/a><\/p>\n\n\n\n<p>Relatedly, if the Targets aren&#8217;t what you expected, <strong>Status -&gt; Service Discovery<\/strong> will show you where each endpoint comes from. Here&#8217;s the Service Discovery status for our upgraded cluster, where we&#8217;re using HTTP SD (snipped to show just the first few nodes):<\/p>\n\n\n\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/10\/image_2023-11-02_172853103.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-15038 size-large\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/image_2023-11-02_172853103-1024x413-1.png\" alt=\"\" width=\"900\" height=\"363\"><\/a><\/p>\n\n\n\n<p><span>Now that we&#8217;ve added our Capella Database, how do we check that we&#8217;re actually getting anything useful?<\/span><\/p>\n\n\n\n<p><span>First, if we revisit the graph from earlier, we can see that the number of time series being stored (<\/span><em><span>prometheus_tsdb_head_series<\/span><\/em><span>) has grown considerably:<\/span><\/p>\n\n\n\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/10\/07.Prometheus.Graphs.with_.Capella.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-15005\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/07.Prometheus.Graphs.with_.Capella-1024x590-1.png\" alt=\"\" width=\"900\" height=\"519\"><\/a><\/p>\n\n\n\n<p><span>Then we can confirm that we do indeed have some Couchbase Server metrics captured. We have the <\/span><em><span>travel-sample<\/span><\/em><span> dataset loaded in our database, which contains just over 63,000 items. If we query <\/span><em><span>kv_curr_items<\/span><\/em><span> we can see that each of our three Data Service nodes have ~21,000 items each:<\/span><\/p>\n\n\n\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/10\/08.Prometheus.Graphs.travel-sample.kv_curr_items.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-15006\" src=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/sites\/5\/2026\/05\/08.Prometheus.Graphs.travel-sample.kv_curr_items-1024x625-1.png\" alt=\"\" width=\"900\" height=\"549\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span>Conclusion<\/span><\/h2>\n\n\n\n<p><span>In this article we&#8217;ve shown you how to run a simple Prometheus server in your local development environment, and how you can add your Couchbase Capella Database so that you can begin to monitor it. In the following posts in this series, we&#8217;ll show you what you can do with those metrics now that you have them.<\/span><\/p>\n\n\n\n<p><span>As always, we appreciate any and all feedback, please feel free to reach out by leaving a comment here, or you can find us on our <\/span><a href=\"https:\/\/www.couchbase.com\/forums\/\"><span>Forums<\/span><\/a><span>, or our <\/span><a href=\"https:\/\/discord.gg\/hFF3tUyhD3\"><span>Discord<\/span><\/a><span>.<\/span><\/p>\n\n\n\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post, the first in a series, we&#8217;re going to show you how to set up a Prometheus server and connect it to your Couchbase Capella Database in order to collect metrics. What is Prometheus? Prometheus is a very popular open-source systems monitoring and alerting toolkit, with a very active developer and user [&hellip;]<\/p>\n","protected":false},"author":84547,"featured_media":3005,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[301,54],"tags":[486,758,687,489],"ppma_author":[694],"class_list":["post-3006","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-couchbase-server","tag-grafana","tag-metrics","tag-monitoring","tag-prometheus"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.6 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Scraping Database Metrics from Couchbase Capella with Prometheus - The Couchbase Blog<\/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\/blog\/pt\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Scraping Database Metrics from Couchbase Capella with Prometheus\" \/>\n<meta property=\"og:description\" content=\"In this blog post, the first in a series, we&#8217;re going to show you how to set up a Prometheus server and connect it to your Couchbase Capella Database in order to collect metrics. What is Prometheus? Prometheus is a very popular open-source systems monitoring and alerting toolkit, with a very active developer and user [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-30T19:43:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/00.Cover_.Image_-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Chris Malarky\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chris Malarky\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/\"},\"author\":{\"name\":\"Chris Malarky\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f0c497c9566079f9b522e37181f77b4\"},\"headline\":\"Scraping Database Metrics from Couchbase Capella with Prometheus\",\"datePublished\":\"2023-10-30T19:43:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/\"},\"wordCount\":3635,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/00.Cover_.Image_-1.png\",\"keywords\":[\"Grafana\",\"metrics\",\"monitoring\",\"Prometheus\"],\"articleSection\":[\"Couchbase Capella\",\"Couchbase Server\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/\",\"name\":\"Scraping Database Metrics from Couchbase Capella with Prometheus - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/00.Cover_.Image_-1.png\",\"datePublished\":\"2023-10-30T19:43:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/00.Cover_.Image_-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/00.Cover_.Image_-1.png\",\"width\":1024,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/scraping-database-metrics-from-couchbase-capella-with-prometheus\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Scraping Database Metrics from Couchbase Capella with Prometheus\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"width\":\"1024\",\"height\":\"1024\",\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f0c497c9566079f9b522e37181f77b4\",\"name\":\"Chris Malarky\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d3be458e2bfa84dfb7d92a892615748309bcb553322018b073ec003ee3e91276?s=96&d=mm&r=g94dafb25331f3cf831d51a9833e8e665\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d3be458e2bfa84dfb7d92a892615748309bcb553322018b073ec003ee3e91276?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d3be458e2bfa84dfb7d92a892615748309bcb553322018b073ec003ee3e91276?s=96&d=mm&r=g\",\"caption\":\"Chris Malarky\"},\"description\":\"Chris Malarky is a Senior Product Manager in the Platform and Security Product Management team at Couchbase, with responsibilities covering Reliability, Availability, Serviceability (RAS), and Monitoring and Observabilty, across both Couchbase Server and Capella, Couchbase's SaaS Database offering. Chris is also the Product Manager for Cloud Native technologies at Couchbase, including the Couchbase Autonomous Operator for Kubernetes\\\/OpenShift. Prior to Product Management, Chris was a Senior Technical Support Engineer and Manager in Couchbase's global Technical Support team, and before joining Couchbase they had experience in Software Engineering, Application Support, System Administration, and Network Management across a wide range of industries and technologies. https:\\\/\\\/www.linkedin.com\\\/in\\\/malarky\\\/\",\"sameAs\":[\"https:\\\/\\\/linkedin.com\\\/in\\\/malarky\"],\"honorificPrefix\":\"Mx\",\"gender\":\"non-binary\",\"jobTitle\":\"Senior Product Manager\",\"worksFor\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/pt\\\/author\\\/chrismalarky\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Scraping Database Metrics from Couchbase Capella with Prometheus - The Couchbase Blog","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\/blog\/pt\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/","og_locale":"pt_BR","og_type":"article","og_title":"Scraping Database Metrics from Couchbase Capella with Prometheus","og_description":"In this blog post, the first in a series, we&#8217;re going to show you how to set up a Prometheus server and connect it to your Couchbase Capella Database in order to collect metrics. What is Prometheus? Prometheus is a very popular open-source systems monitoring and alerting toolkit, with a very active developer and user [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/","og_site_name":"The Couchbase Blog","article_published_time":"2023-10-30T19:43:23+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/00.Cover_.Image_-1.png","type":"image\/png"}],"author":"Chris Malarky","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Chris Malarky","Est. reading time":"16 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/"},"author":{"name":"Chris Malarky","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/6f0c497c9566079f9b522e37181f77b4"},"headline":"Scraping Database Metrics from Couchbase Capella with Prometheus","datePublished":"2023-10-30T19:43:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/"},"wordCount":3635,"commentCount":2,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/00.Cover_.Image_-1.png","keywords":["Grafana","metrics","monitoring","Prometheus"],"articleSection":["Couchbase Capella","Couchbase Server"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/","url":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/","name":"Scraping Database Metrics from Couchbase Capella with Prometheus - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/00.Cover_.Image_-1.png","datePublished":"2023-10-30T19:43:23+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/00.Cover_.Image_-1.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/00.Cover_.Image_-1.png","width":1024,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/scraping-database-metrics-from-couchbase-capella-with-prometheus\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Scraping Database Metrics from Couchbase Capella with Prometheus"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","width":"1024","height":"1024","caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/6f0c497c9566079f9b522e37181f77b4","name":"Chris Malarky","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/secure.gravatar.com\/avatar\/d3be458e2bfa84dfb7d92a892615748309bcb553322018b073ec003ee3e91276?s=96&d=mm&r=g94dafb25331f3cf831d51a9833e8e665","url":"https:\/\/secure.gravatar.com\/avatar\/d3be458e2bfa84dfb7d92a892615748309bcb553322018b073ec003ee3e91276?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d3be458e2bfa84dfb7d92a892615748309bcb553322018b073ec003ee3e91276?s=96&d=mm&r=g","caption":"Chris Malarky"},"description":"Chris Malarky is a Senior Product Manager in the Platform and Security Product Management team at Couchbase, with responsibilities covering Reliability, Availability, Serviceability (RAS), and Monitoring and Observabilty, across both Couchbase Server and Capella, Couchbase's SaaS Database offering. Chris is also the Product Manager for Cloud Native technologies at Couchbase, including the Couchbase Autonomous Operator for Kubernetes\/OpenShift. Prior to Product Management, Chris was a Senior Technical Support Engineer and Manager in Couchbase's global Technical Support team, and before joining Couchbase they had experience in Software Engineering, Application Support, System Administration, and Network Management across a wide range of industries and technologies. https:\/\/www.linkedin.com\/in\/malarky\/","sameAs":["https:\/\/linkedin.com\/in\/malarky"],"honorificPrefix":"Mx","gender":"non-binary","jobTitle":"Senior Product Manager","worksFor":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/chrismalarky\/"}]}},"acf":[],"authors":[{"term_id":694,"user_id":84547,"is_guest":0,"slug":"chrismalarky","display_name":"Chris Malarky","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/d3be458e2bfa84dfb7d92a892615748309bcb553322018b073ec003ee3e91276?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/3006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/84547"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=3006"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/3006\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/3005"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=3006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=3006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=3006"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=3006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}