• Stars
    star
    5,367
  • Rank 7,693 (Top 0.2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created almost 12 years ago
  • Updated 27 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Prometheus instrumentation library for Go applications

Prometheus Go client library

CI Go Report Card Go Reference Slack

This is the Go client library for Prometheus. It has two separate parts, one for instrumenting application code, and one for creating clients that talk to the Prometheus HTTP API.

This library requires Go1.20 or later.

The library mandates the use of Go1.20 or subsequent versions. While it has demonstrated functionality with versions as old as Go 1.17, our commitment remains to offer support and rectifications for only the most recent three major releases.

Important note about releases and stability

This repository generally follows Semantic Versioning. However, the API client in prometheus/client_golang/api/… is still considered experimental. Breaking changes of the API client will not trigger a new major release. The same is true for selected other new features explicitly marked as EXPERIMENTAL in CHANGELOG.md.

Features that require breaking changes in the stable parts of the repository are being batched up and tracked in the v2 milestone. The v2 development happens in a separate branch for the time being. v2 releases off that branch will happen once sufficient stability is reached. In view of the widespread use of this repository, v1 and v2 will coexist for a while to enable a convenient transition.

Instrumenting applications

Go Reference

The prometheus directory contains the instrumentation library. See the guide on the Prometheus website to learn more about instrumenting applications.

The examples directory contains simple examples of instrumented code.

Client for the Prometheus HTTP API

Go Reference

The api/prometheus directory contains the client for the Prometheus HTTP API. It allows you to write Go applications that query time series data from a Prometheus server. It is still in alpha stage.

Where is model, extraction, and text?

The model packages has been moved to prometheus/common/model.

The extraction and text packages are now contained in prometheus/common/expfmt.

Contributing and community

See the contributing guidelines and the Community section of the homepage.

client_golang community is also present on the CNCF Slack #prometheus-client_golang.

For Maintainers: Release Process

To cut a minor version:

  1. Create a new branch release-<major>.<minor> on top of the main commit you want to cut the version from and push it.
  2. Create a new branch on top of the release branch, e.g. <yourname>/cut-<major>.<minor>.<patch>,
  3. Change the VERSION file.
  4. Update CHANGELOG (only user-impacting changes to mention).
  5. Create PR, and get it reviewed.
  6. Once merged, create a release with the release-<major>.<minor> tag on GitHub with the <version> title.
  7. Announce on the prometheus-announce mailing list, slack and Twitter.
  8. Merge the release branch back to the main using the "merge without squashing" approach (!).

NOTE: In case of merge conflicts, you can checkout the release branch in a new branch, e.g. <yourname>/resolve-conflicts, fix the merge problems there, and then do a PR into main from the new branch. In that way, you still get all the commits in the release branch back into main, but leave the release branch alone.

To cut the patch version:

  1. Create a branch on top of the release branch you want to use.
  2. Cherry-pick the fixes from the main branch (or add new commits) to fix critical bugs for that patch release.
  3. Follow steps 3-8 as above.

More Repositories

1

prometheus

The Prometheus monitoring system and time series database.
Go
54,496
star
2

node_exporter

Exporter for machine metrics
Go
10,870
star
3

alertmanager

Prometheus Alertmanager
Go
6,540
star
4

blackbox_exporter

Blackbox prober exporter
Go
4,532
star
5

client_python

Prometheus instrumentation library for Python applications
Python
3,914
star
6

jmx_exporter

A process for exposing JMX Beans via HTTP for Prometheus consumption
Java
3,005
star
7

pushgateway

Push acceptor for ephemeral and batch jobs.
Go
2,969
star
8

client_java

Prometheus instrumentation library for JVM applications
Java
2,166
star
9

mysqld_exporter

Exporter for MySQL server metrics
Go
2,097
star
10

snmp_exporter

SNMP Exporter for Prometheus
Go
1,634
star
11

statsd_exporter

StatsD to Prometheus metrics exporter
Go
912
star
12

cloudwatch_exporter

Metrics exporter for Amazon AWS CloudWatch
Java
892
star
13

procfs

procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc.
Go
767
star
14

docs

Prometheus documentation: content and static site generator
SCSS
645
star
15

haproxy_exporter

Simple server that scrapes HAProxy stats and exports them via HTTP for Prometheus consumption
Go
615
star
16

promlens

PromLens – The query builder, analyzer, and explainer for PromQL
TypeScript
552
star
17

client_ruby

Prometheus instrumentation library for Ruby applications
Ruby
510
star
18

client_rust

Prometheus / OpenMetrics client library in Rust
Rust
462
star
19

consul_exporter

Exporter for Consul metrics
Go
436
star
20

prom2json

A tool to scrape a Prometheus client and dump the result as JSON.
Go
364
star
21

graphite_exporter

Server that accepts metrics via the Graphite protocol and exports them as Prometheus metrics
Go
350
star
22

promu

Prometheus Utility Tool
Go
268
star
23

influxdb_exporter

A server that accepts InfluxDB metrics via the HTTP API and exports them via HTTP for Prometheus consumption
Go
261
star
24

exporter-toolkit

Utility package to build exporters
Go
261
star
25

common

Go libraries shared across Prometheus components and libraries.
Go
261
star
26

collectd_exporter

A server that accepts collectd stats via HTTP POST and exports them via HTTP for Prometheus consumption
Go
255
star
27

memcached_exporter

Exports metrics from memcached servers for consumption by Prometheus.
Go
182
star
28

test-infra

Prometheus E2E benchmarking tool
Go
153
star
29

compliance

A set of tests to check compliance with various Prometheus interfaces
Go
127
star
30

nagios_plugins

Nagios plugins for alerting on Prometheus query results
Shell
103
star
31

demo-site

Demo site auto-deployed with Ansible and Travis CI.
HTML
96
star
32

client_model

Data model artifacts for Prometheus.
Makefile
74
star
33

golang-builder

Prometheus Golang builder Docker images
Shell
69
star
34

codemirror-promql

PromQL support for the CodeMirror code editor
TypeScript
39
star
35

busybox

Prometheus Busybox Docker base images
Makefile
37
star
36

prometheus_api_client_ruby

A Ruby library for reading metrics stored on a Prometheus server
Ruby
36
star
37

talks

Track Prometheus talks
20
star
38

lezer-promql

A lezer-based PromQL grammar
JavaScript
12
star
39

proposals

Design documents for Prometheus Ecosystem
Makefile
9
star
40

host_exporter

See the "node_exporter" repository instead!
8
star
41

circleci

7
star
42

snmp_exporter_mibs

4
star
43

promci

GitHub Actions repository
4
star
44

kube-demo-site

Kubernetes Demo Site
Go
1
star
45

client_java-benchmarks

1
star
46

sigv4

A http.RoundTripper that will sign requests using Amazon's Signature Verification V4 signing procedure
1
star