Choosing a Prometheus client library for each language in your estate
A client library is the code inside an application that records metrics and exposes them over HTTP so Prometheus can scrape them. The choice is made per language, because each library is written for one runtime. A platform team with services in several languages and no shared instrumentation rules usually ends up with a mix of libraries, hand-rolled text output, and vendor agents, each naming metrics differently. Prometheus pulls metrics from a /metrics endpoint, so the library's real job is to expose that endpoint correctly: stable metric types, valid text format, and no surprises when a process restarts. The official client libraries are a small set maintained by the Prometheus project, covering Go, Java, Python, Ruby and Rust. Other languages, including Node.js and .NET, are served by libraries maintained outside the core project, so their quality, release cadence and feature coverage need checking before adoption.
Prometheus is licensed under Apache-2.0, so no library carries a license fee. The cost sits in implementation and upkeep: the engineering time to add and test metrics in each service, the review effort to keep naming consistent, and the work to upgrade libraries when they change. Those costs recur, because every new service and every library upgrade repeats them. Start by inventorying the languages and frameworks in production and recording which library each team uses now. For each language, confirm whether an official library exists, whether it is actively released, and whether the team's framework already exposes Prometheus metrics. Then decide whether to standardize on one library per language or to accept a community option where no official one exists.
OpenTelemetry SDKs are a common alternative to native Prometheus client libraries, and a team may choose them to send one telemetry stream to several backends. Before choosing, confirm which metric types, exemplars and export paths each SDK supports with Prometheus, because those details differ between the two approaches and affect dashboards and alert rules. Agree on a shared naming standard before the first service ships, since changing metric names later breaks dashboards and recording rules. Ask each candidate library's maintainers for its current release line and support window, and record the answer in your platform standards so the choice can be reviewed when a language runtime changes.
Client library options by language and when each fits
This table compares the Prometheus client library options for each language in a mixed estate, with the condition under which each one fits. Read each row against the services you already run, and check the project documentation for current status before you commit.
| Language | Library and option | When it fits |
|---|---|---|
| Go | Official Prometheus Go client library | Go services in a Prometheus-only estate, or where teams want the native exposition format with no intermediary |
| Java | Official Prometheus Java client library | Java services without a Spring Boot layer, or custom JVM services that need direct control of metric types |
| Java (Spring Boot) | Micrometer with its Prometheus registry | Spring Boot applications, where metrics are exposed through the actuator endpoint and business metrics use the same API |
| Python | Official Prometheus Python client library | Python web services, workers and batch jobs in a Prometheus-only estate, with custom collectors as needed |
| Ruby | Official Prometheus Ruby client library | Rails or Rack applications and background workers that already expose metrics in the Prometheus text format |
| Rust | Official Prometheus Rust client library | Rust services where the team wants a typed, dependency-light instrumentation layer on the Prometheus data model |
| Node.js | Community or vendor Node.js client options | Node.js services, where you should confirm the library's maintenance status and label support with the project before selection |
| .NET | Community or vendor .NET options, including OpenTelemetry exporters | Applications on .NET, where the team should confirm which library and exporter fit its runtime and existing pipeline |
| Any language with an OpenTelemetry Collector pipeline | OpenTelemetry SDK exporting to a Collector that serves Prometheus | Estates that already send traces and logs through OpenTelemetry and want one instrumentation path for all signals |
When an OpenTelemetry SDK replaces a native Prometheus client
The decision to instrument with an OpenTelemetry SDK instead of a native Prometheus client should be made before any service ships, because it fixes the API your developers write against and the metric types your queries will rely on. A native Prometheus client exposes a metrics-only library that maps directly to Prometheus types such as counters, gauges, histograms and summaries, and it serves a /metrics endpoint that Prometheus scrapes. An OpenTelemetry SDK gives one vendor-neutral API across traces, logs and metrics, and it sends metrics through the OpenTelemetry Collector or another OTLP-compatible path, where a Prometheus-compatible exporter or endpoint converts them for Prometheus to ingest.
The choice changes how histograms and labels are written. OpenTelemetry metrics carry their own instrument types, aggregation defaults and attribute handling, and the conversion to Prometheus names, units and suffixes can differ from what a native client produces. If one team writes OpenTelemetry histograms with one set of bucket boundaries and another team uses a native client with different buckets, cross-service latency queries and SLO rules will not line up. Agree on the instrument types, bucket layout and label policy in the naming standard before the first release, and check that every service emits the same metric names after conversion.
Before committing, confirm the export path and the supported features with the OpenTelemetry and Prometheus documentation for the versions you plan to run. Check which Collector exporter or Prometheus receiver you will use, whether native histograms and exemplars survive the conversion, and how resource attributes become target labels. Ask your implementation partner or internal platform team to build a small proof of concept in each language in your estate, then run promtool check metrics against its output and review the series in your Prometheus server before rolling the choice out.
How to roll out one client library per language
This sequence moves a mixed estate from ad hoc metrics to one agreed client library per language, with shared naming rules checked on a reference service before the rest of the estate follows.
Inventory languages and frameworks in use
List every language, runtime and web or job framework that runs services you plan to monitor, including batch jobs, scripts and vendor-supplied components that expose metrics. Record which team owns each one and whether it already exposes a metrics endpoint. Done means you have a table with one row per runtime, an owner, and a current state such as none, custom, or an existing library. Ask owners to confirm the list, because the gaps usually sit in services nobody thinks of as monitored.
Decide the library or SDK per language
For each runtime, choose the Prometheus client library maintained for that language, or decide that an OpenTelemetry SDK will export to Prometheus instead. Weigh the number of runtimes your teams already operate, whether you already run OpenTelemetry Collector pipelines, and how much of the framework's own metrics support each option covers. Record the decision in a short standard with one line per language. Done means every runtime in the inventory has a named library and an owner, and you have checked the chosen library's current documentation rather than relying on older guides.
Write the shared naming and label rules
Write a short naming standard that every library must follow: a common prefix for your organization or product, base units in the metric name, _total suffixes on counters, and a fixed list of allowed label names. State which label values are forbidden, such as user IDs, request IDs or raw URLs, because these make label cardinality unbounded. Have the platform team and two service owners review it. Done means the standard is versioned in a repository and each library's configuration references it, so the rules apply the same way in every language.
Instrument one reference service per language
Pick one small, representative service in each language and add the chosen library with the shared rules applied. Expose the standard HTTP request metrics and at least one business or job metric, then run the service in a non-production environment. Done means each reference service serves a /metrics endpoint with the agreed prefix on every metric, and the series count stays flat when you send a few hundred requests with varied inputs. Record the output of this check so later teams can compare against it.
Check output with promtool and a test scrape
Save each reference service's /metrics output to a file and run promtool check metrics against it to catch malformed names, missing units and type mismatches. Then point a test Prometheus configuration at the reference services and confirm the targets report as up and the expected series appear with a PromQL query. Also check that no label carries an unbounded value, for example by counting distinct values of each label over a short window. Done means every reference service passes the lint, shows up as a healthy target, and has bounded labels.
Confirm naming and label bounds in review
Before wider rollout, compare each reference service against the naming standard line by line. Confirm that metric names carry the agreed prefix, counters end in _total, durations use seconds, and labels come only from the allowed list. Ask a second engineer to try to break the rules by adding a high-cardinality input in a test branch. Done means the reviewer signs off on each language, and any deviation is either fixed in the library configuration or recorded as an approved exception with an owner.
Roll out to the rest of the estate
Apply the same library setup and naming standard to the remaining services, grouped by language so each batch reuses one tested configuration. Add each service to Prometheus through the normal configuration path, and run the promtool check and cardinality check on its output before it reaches production scrape jobs. Done means every in-scope service exposes metrics that pass the lint, appear as healthy targets, and stay within the label bounds you set, and the inventory from step one is updated to show the new state.
How application libraries, the Collector and Prometheus connect
The diagram starts with two applications. The first is instrumented with a native Prometheus client library and exposes its own /metrics endpoint, which Prometheus scrapes directly over HTTP. The second is instrumented with an OpenTelemetry SDK that exports to an OpenTelemetry Collector, and the Collector exposes a Prometheus endpoint that Prometheus scrapes in the same way. Scrape direction runs from Prometheus to each target, so the reader should check that both paths produce the same metric names and labels, which is where the naming standard applies to both.
Two instrumentation paths converge on one Prometheus scrape, with naming applied to both.
Security and operational considerations for exposed metrics endpoints
Every client library turns your application into a metrics endpoint that Prometheus scrapes over HTTP. The cards below cover what that endpoint reveals, how to limit who can read it, and the operational habits that keep it safe and affordable to run.
Limit the network path to the endpoint
A metrics endpoint is often reachable from more places than intended, because it sits on the same port as the application. Expose it on a path that only the Prometheus servers can reach, such as a dedicated port or an internal network segment, and block it at the load balancer and ingress. Check this from outside the service's own network, not only from inside the cluster. Ask whether your library lets you bind the metrics handler to a separate listener, and confirm that the chosen setup works with your firewall and ingress rules.
Prometheus security modelProtect scrapes with TLS and client certificates
Prometheus supports TLS and client certificate authentication with TLS 1.2 as the minimum version, which is the strongest option the server offers for scrapes. Where mutual TLS is not practical, HTTP basic authentication with bcrypt-hashed passwords is available, but only over TLS, because without it credentials travel in cleartext. Confirm which of these your client library and exporters can use, and plan how certificates or passwords are issued, rotated and stored in the Prometheus configuration.
Review labels for sensitive data
Labels are copied into every scrape and are readable by anyone who can reach the endpoint or the Prometheus query API. Customer identifiers, email addresses, account numbers, file paths and internal hostnames are common accidents when a developer uses request data as a label value. Review label values in code review, and keep personal or business-sensitive data out of label values entirely. For illustrative purposes, a label such as a user email exposes that data to every team with query access.
Watch cardinality as an operational risk
Each unique combination of metric name and label values creates a separate time series, so an unbounded label such as a request ID or raw URL path can grow memory use and storage without warning. The Prometheus docs say the project values reliability over precision, so an overloaded server can degrade in ways that are hard to spot in advance. Ask each team to list the label sets it exposes, set limits on scrape size, and alert on the number of series per target before the server struggles.
Keep the admin and lifecycle surfaces closed
Client libraries expose the metrics handler, but the Prometheus server has its own HTTP APIs that can change data or reload configuration. Admin APIs are disabled by default, and the lifecycle endpoints that reload or shut down the server are off unless enabled. Do not switch these on to make a client library easier to test. Confirm that the Prometheus server, not the application, is the only component allowed to reach its API, and record who can enable these flags.
Patch libraries on the Prometheus release line
Client libraries ship their own release cycles, separate from the Prometheus server. Prometheus minor releases receive bug fixes for only a limited window, and long-term support lines receive fixes for one year, so an old server with a current library, or the reverse, can leave you with unsupported code. Record the library version for each service, match it to a supported Prometheus line in your upgrade plan, and confirm with each library's maintainers which versions they still patch.
- LTS bug-fix window
- 1 year
Questions teams ask before choosing a client library
What does choosing client libraries cost, and is most of it internal effort?
Most of the cost is people time, not licenses, because the Prometheus project is Apache-2.0 licensed and has no paid edition. The main cost components are the engineers who instrument each language, the platform team who reviews naming and label choices, and the people who keep dashboards and alerts aligned with the new metrics. Costs rise with the number of languages, the number of frameworks in each language, how many services already expose metrics in a different shape, and how much naming review you require before anything ships. Ask any partner for a quote that lists these items separately, and confirm which parts are one-time (standards, initial instrumentation) and which recur (upgrades, new services, review of new metrics).
How long does it take to standardize the first language?
The first language usually takes the longest because it sets the naming standard, label rules and review process that later languages follow. Duration depends on how many services use that language, how many frameworks they rely on, and whether metrics already exist in another format that must be migrated or kept in parallel. Agree the naming conventions before instrumenting code, then instrument one representative service end to end and check the output with promtool before rolling the pattern out. Treat any timeline you are given as an estimate tied to a written scope, and ask what is excluded.
What does the work need from platform and development teams?
Development teams need to own the instrumentation inside their services, while the platform team owns the shared standard, the scrape configuration and the review of new metric names and labels. Both groups must agree on who approves a new label, because unbounded label values are the most common cause of cardinality problems. The platform team also needs to confirm where metrics are scraped and how targets are discovered. Development teams should expect to change code during rollout and to test that endpoints expose the expected series after each release.
Can one team handle the client library work alone?
One engineer with Prometheus experience can standardize a small estate, especially if it uses one or two languages. A larger estate with several languages, many frameworks and a separate platform team usually needs a named owner for the standard plus developers in each language group. Whether one team can do it depends on how many services need changes, how much review capacity exists, and how much time the team can give while still delivering product work. If you want to test this yourself, start with one language and measure how long the first service takes before deciding on the rest.
Should we mix native Prometheus clients with OpenTelemetry SDKs?
You can mix them, but each service should expose one consistent set of metrics under one naming standard. Native Prometheus clients expose metrics directly in the Prometheus format, while OpenTelemetry SDKs can export metrics through the OpenTelemetry Collector to Prometheus. Mixing approaches across services with the same metric names creates duplicate or conflicting series, so decide per language and document the choice. Confirm the exporter path, the metric name translation rules and the Collector configuration with your team before rollout, because these details change the final series names.
What do we do for a language that has no official Prometheus library?
Start by checking whether a community library or the OpenTelemetry SDK for that language already covers your needs, and whether it follows the same naming rules. If none fits, you can expose metrics with a simple HTTP endpoint that follows the Prometheus text format, or build a custom exporter for the underlying system. Test the output with promtool check metrics and review the library's maintenance status, release history and license before adopting it. Ask whoever builds the integration to document the chosen approach so future engineers do not reinvent it.
What changes when a Prometheus version upgrade lands?
A Prometheus server upgrade generally does not change client library output, but a client library upgrade can change metric names, label sets or default collectors, so each upgrade needs a check. Prometheus minor releases follow a six-week cycle and generally stop receiving bug fixes after that window, while long-term support lines receive fixes for one year, so plan which line you run and when you move. Before upgrading, confirm that dashboards and alert rules still match the series your services expose, and rerun naming checks against a staging scrape. Ask your partner whether the upgrade plan includes a regression check for the client libraries.
What a scoped client library engagement covers
A scoped client library engagement starts with a language inventory: every service, batch job and exporter in your estate, the language and framework each one uses, and who owns it. DeployOpen would record that inventory in writing, then make a library or SDK decision for each language with the reasons attached. For Go, Java, Python, Ruby and Rust, that usually means the official Prometheus client library for the language. For Node.js and .NET, or for teams already standardizing on OpenTelemetry, the decision compares the community or OpenTelemetry options against the support, metric types and export paths your teams need. Each decision is written down with its trade-offs so the next team that adds a service can follow the same reasoning.
The second part of the scope is a naming standard that every chosen library must follow: metric prefixes, base units, _total suffixes for counters, and a rule set for label names that keeps cardinality under control. DeployOpen would also build reference instrumentation for a small number of chosen services so that teams have working code to copy, and would define how histograms or summaries are used for latency. Checks come next. Metric names are validated with promtool check metrics, and a test scrape confirms that the expected series appear on a non-production Prometheus with the labels you agreed. Scope details, including which services, languages and checks are covered, are agreed in writing before work starts, with deliverables and timelines fixed in that document. A quote follows from the written scope, so the number of languages, services and reviews you ask for is the main driver of cost.
Before you request a quote, confirm three things with your own teams: which languages are actually in production, whether any service already emits metrics through a library or an agent you would need to keep, and who will own the standard after handover. The current Prometheus versions and client library release notes should also be checked at the time of the work, since library behavior changes between releases. DeployOpen does not hold vendor partner status for any of these libraries, so the scope describes what the work delivers, not a vendor relationship. Ask the proposal to state which Prometheus client library version each language will use and how upgrades will be handled after handover.

