A Go library for collecting sql.DBStats in Prometheus format

Overview

sqlstats

GoDoc Go Report Card License

A Go library for collecting sql.DBStats and exporting them in Prometheus format.

A sql.DB object represents a pool of zero or more underlying connections that get created and freed automatically. Connections in the pool may also be idle. There are a few settings (SetMaxOpenConns(), SetMaxIdleConns() and SetConnMaxLifetime()) that can be used to control the pool of connections. This library exposes stats about this pool in Prometheus format, to aid with understanding of the pool.

Installation

go get github.com/dlmiddlecote/sqlstats

Example

package main

import (
	"database/sql"
	"net/http"

	_ "github.com/lib/pq"
	"github.com/dlmiddlecote/sqlstats"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promhttp"
)

func main() {
	if err := run(); err != nil {
		panic(err)
	}
}

func run() error {
	// Open connection to a DB (could also use the https://github.com/jmoiron/sqlx library)
	db, err := sql.Open("postgres", "postgres://postgres:[email protected]:5432/postgres")
	if err != nil {
		return err
	}

	// Create a new collector, the name will be used as a label on the metrics
	collector := sqlstats.NewStatsCollector("db_name", db)

	// Register it with Prometheus
	prometheus.MustRegister(collector)

	// Register the metrics handler
	http.Handle("/metrics", promhttp.Handler())

	// Run the web server
	return http.ListenAndServe(":8080", nil)
}

Exposed Metrics

Name Description Labels Go Version
go_sql_stats_connections_max_open Maximum number of open connections to the database. db_name 1.11+
go_sql_stats_connections_open The number of established connections both in use and idle. db_name 1.11+
go_sql_stats_connections_in_use The number of connections currently in use. db_name 1.11+
go_sql_stats_connections_idle The number of idle connections. db_name 1.11+
go_sql_stats_connections_waited_for The total number of connections waited for. db_name 1.11+
go_sql_stats_connections_blocked_seconds The total time blocked waiting for a new connection. db_name 1.11+
go_sql_stats_connections_closed_max_idle The total number of connections closed due to SetMaxIdleConns. db_name 1.11+
go_sql_stats_connections_closed_max_lifetime The total number of connections closed due to SetConnMaxLifetime. db_name 1.11+
go_sql_stats_connections_closed_max_idle_time The total number of connections closed due to SetConnMaxIdleTime. db_name 1.15+
Comments
  • Upgrade to GitHub-native Dependabot

    Upgrade to GitHub-native Dependabot

    Dependabot Preview will be shut down on August 3rd, 2021. In order to keep getting Dependabot updates, please merge this PR and migrate to GitHub-native Dependabot before then.

    Dependabot has been fully integrated into GitHub, so you no longer have to install and manage a separate app. This pull request migrates your configuration from Dependabot.com to a config file, using the new syntax. When merged, we'll swap out dependabot-preview (me) for a new dependabot app, and you'll be all set!

    With this change, you'll now use the Dependabot page in GitHub, rather than the Dependabot dashboard, to monitor your version updates, and you'll configure Dependabot through the new config file rather than a UI.

    Your account is using config variables to access private registries. Relevant registries have been included in the new config file but additional steps may be necessary to complete the setup. Ensure that each secret below has been configured in the repository Dependabot secrets by an admin.

    • [ ] GIT_GITHUB_COM_PASSWORD

    If an included registry is not required by this repository you can remove it from the config file.

    If you've got any questions or feedback for us, please let us know by creating an issue in the dependabot/dependabot-core repository.

    Learn more about migrating to GitHub-native Dependabot

    Please note that regular @dependabot commands do not work on this pull request.

    dependencies 
    opened by dependabot-preview[bot] 1
  • Add MaxIdleTimeClosed stat

    Add MaxIdleTimeClosed stat

    Hello,

    Stat "MaxIdleTimeClosed" have been added in Go 1.15. This PR adds support for this, but requires Go 1.15 now, instead of 1.11.

    I am not sure how to manage two Go versions with Go modules, in order to define features that are only available since a specific Go version.

    Can you help me on this ?

    Thanks !

    opened by edebernis 1
  • Bump github.com/prometheus/client_golang from 1.3.0 to 1.5.1

    Bump github.com/prometheus/client_golang from 1.3.0 to 1.5.1

    Bumps github.com/prometheus/client_golang from 1.3.0 to 1.5.1.

    Release notes

    Sourced from github.com/prometheus/client_golang's releases.

    1.5.1 / 2020-03-14

    • [BUGFIX] promhttp: Remove another superfluous WriteHeader call.

    1.5.0 / 2020-03-03

    • [FEATURE] promauto: Add a factory to allow automatic registration with a local registry. #713
    • [FEATURE] promauto: Add NewUntypedFunc. #713
    • [FEATURE] API client: Support new metadata endpoint. #718

    1.4.1 / 2020-02-07

    • [BUGFIX] Fix timestamp of exemplars in CounterVec. #710

    1.4.0 / 2020-01-27

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Changelog

    Sourced from github.com/prometheus/client_golang's changelog.

    1.5.1 / 2020-03-14

    • [BUGFIX] promhttp: Remove another superfluous WriteHeader call.

    1.5.0 / 2020-03-03

    • [FEATURE] promauto: Add a factory to allow automatic registration with a local registry. #713
    • [FEATURE] promauto: Add NewUntypedFunc. #713
    • [FEATURE] API client: Support new metadata endpoint. #718

    1.4.1 / 2020-02-07

    • [BUGFIX] Fix timestamp of exemplars in CounterVec. #710

    1.4.0 / 2020-01-27

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Commits
    • aa9238d Merge pull request #727 from prometheus/beorn7/release
    • bb96a66 Cut v1.5.1
    • 4739e9c Merge pull request #726 from prometheus/beorn7/promhttp
    • 586178b Fix promhttp error handling
    • 346356f Merge pull request #719 from simonpasquier/enable-circleci
    • 5538bed Merge pull request #720 from prometheus/beorn7/release
    • 42eb2da Cut v1.5.0
    • 057bfe8 Merge pull request #718 from gotjosh/support-metric-metadata-endpoint
    • 2725e8e Add Circle CI configuration
    • 2463b8e Address review feedback
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 1
  • Bump github.com/prometheus/client_golang from 1.3.0 to 1.5.0

    Bump github.com/prometheus/client_golang from 1.3.0 to 1.5.0

    Bumps github.com/prometheus/client_golang from 1.3.0 to 1.5.0.

    Release notes

    Sourced from github.com/prometheus/client_golang's releases.

    1.5.0 / 2020-03-03

    • [FEATURE] promauto: Add a factory to allow automatic registration with a local registry. #713
    • [FEATURE] promauto: Add NewUntypedFunc. #713
    • [FEATURE] API client: Support new metadata endpoint. #718

    1.4.1 / 2020-02-07

    • [BUGFIX] Fix timestamp of exemplars in CounterVec. #710

    1.4.0 / 2020-01-27

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Changelog

    Sourced from github.com/prometheus/client_golang's changelog.

    1.5.0 / 2020-03-03

    • [FEATURE] promauto: Add a factory to allow automatic registration with a local registry. #713
    • [FEATURE] promauto: Add NewUntypedFunc. #713
    • [FEATURE] API client: Support new metadata endpoint. #718

    1.4.1 / 2020-02-07

    • [BUGFIX] Fix timestamp of exemplars in CounterVec. #710

    1.4.0 / 2020-01-27

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Commits
    • 5538bed Merge pull request #720 from prometheus/beorn7/release
    • 42eb2da Cut v1.5.0
    • 057bfe8 Merge pull request #718 from gotjosh/support-metric-metadata-endpoint
    • 2463b8e Address review feedback
    • 7810669 Update api/prometheus/v1/api_test.go
    • bd79fe1 Update api/prometheus/v1/api_test.go
    • 7f509dc API Client: Support new metadata endpoint in v1
    • 673e4a1 Merge pull request #717 from prometheus/makefile_common
    • 3ddb45b makefile: update Makefile.common with newer version
    • b25ce26 Merge pull request #713 from prometheus/beorn7/promauto
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 1
  • Bump github.com/prometheus/client_golang from 1.3.0 to 1.4.1

    Bump github.com/prometheus/client_golang from 1.3.0 to 1.4.1

    Bumps github.com/prometheus/client_golang from 1.3.0 to 1.4.1.

    Release notes

    Sourced from github.com/prometheus/client_golang's releases.

    1.4.1 / 2020-02-07

    • [BUGFIX] Fix timestamp of exemplars in CounterVec. #710

    1.4.0 / 2020-01-27

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Changelog

    Sourced from github.com/prometheus/client_golang's changelog.

    1.4.1 / 2020-02-07

    • [BUGFIX] Fix timestamp of exemplars in CounterVec. #710

    1.4.0 / 2020-01-27

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Commits
    • 913f67e Merge pull request #711 from prometheus/beorn7/release
    • c02b77c Cut v1.4.1
    • 6134a11 Merge pull request #710 from shreyassrivatsan/ss/fix
    • bc9e50c Initialize now fn for counters
    • 76dd6c5 Merge pull request #707 from prometheus/beorn7/release
    • 1e64193 Cut v1.4.0
    • 5eb1c10 Update dependencies
    • 9903214 Fix typo in doc comment
    • e951d7b Merge pull request #708 from prometheus/beorn7/exemplars
    • f34b098 Pull out ...WithExemplar methods into separate interfaces
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 1
  • Bump github.com/prometheus/client_golang from 1.3.0 to 1.4.0

    Bump github.com/prometheus/client_golang from 1.3.0 to 1.4.0

    Bumps github.com/prometheus/client_golang from 1.3.0 to 1.4.0.

    Release notes

    Sourced from github.com/prometheus/client_golang's releases.

    1.4.0 / 2020-01-27

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Changelog

    Sourced from github.com/prometheus/client_golang's changelog.

    1.4.0 / 2020-01-27

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Commits
    • 76dd6c5 Merge pull request #707 from prometheus/beorn7/release
    • 1e64193 Cut v1.4.0
    • 5eb1c10 Update dependencies
    • 9903214 Fix typo in doc comment
    • e951d7b Merge pull request #708 from prometheus/beorn7/exemplars
    • f34b098 Pull out ...WithExemplar methods into separate interfaces
    • ba79017 Merge pull request #706 from prometheus/beorn7/exemplars
    • c32ffd1 Add tests for examplars
    • 57d4125 Add exemplars to counter and histogram
    • 803ef2a Merge pull request #703 from prometheus/testutil-metric-count
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

    You can always request more updates by clicking Bump now in your Dependabot dashboard.

    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 1
  • Add support for MaxIdleTimeClosed stat in go version 1.15+

    Add support for MaxIdleTimeClosed stat in go version 1.15+

    DBStats.MaxIdleTimeClosed was added in Go 1.15. This change adds support for exposing this as a Prometheus metric, whilst making sure this module is still compatible with Go 1.11+.

    opened by dlmiddlecote 0
  • Dependabot needs permission to see client_golang

    Dependabot needs permission to see client_golang

    Dependabot couldn't resolve your project's dependencies as it couldn't access client_golang.

    You're using a custom github credential (specified in your Dependabot dashboard). Please ensure that token has read access to prometheus/client_golang.

    View the update logs.

    opened by dependabot-preview[bot] 0
  • Dependabot can't resolve your Go dependency files

    Dependabot can't resolve your Go dependency files

    Dependabot can't resolve your Go dependency files.

    As a result, Dependabot couldn't update your dependencies.

    The error Dependabot encountered was:

    go: github.com/prometheus/[email protected]: reading github.com/prometheus/client_golang/go.mod at revision v1.3.0: unknown revision v1.3.0
    

    If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

    View the update logs.

    opened by dependabot-preview[bot] 0
  • Bump github.com/prometheus/client_golang from 1.3.0 to 1.6.0

    Bump github.com/prometheus/client_golang from 1.3.0 to 1.6.0

    ⚠️ Dependabot Preview has been deactivated ⚠️

    This pull request was created by Dependabot Preview, and you've upgraded to Dependabot. This means it won't respond to dependabot commands nor will it be automatically closed if a new version is found.

    If you close this pull request, Dependabot will re-create it the next time it checks for updates and everything will work as expected.


    Bumps github.com/prometheus/client_golang from 1.3.0 to 1.6.0.

    Release notes

    Sourced from github.com/prometheus/client_golang's releases.

    1.6.0 / 2020-04-28

    • [FEATURE] testutil: Add lint checks for metrics, including a sub-package promlint to expose the linter engine for external usage. #739 #743
    • [ENHANCEMENT] API client: Improve error messages. #731
    • [BUGFIX] process collector: Fix process_resident_memory_bytes on 32bit MS Windows. #734

    1.5.1 / 2020-03-14

    • [BUGFIX] promhttp: Remove another superfluous WriteHeader call.

    1.5.0 / 2020-03-03

    • [FEATURE] promauto: Add a factory to allow automatic registration with a local registry. #713
    • [FEATURE] promauto: Add NewUntypedFunc. #713
    • [FEATURE] API client: Support new metadata endpoint. #718

    1.4.1 / 2020-02-07

    • [BUGFIX] Fix timestamp of exemplars in CounterVec. #710

    1.4.0 / 2020-01-27

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Changelog

    Sourced from github.com/prometheus/client_golang's changelog.

    1.6.0 / 2020-04-28

    • [FEATURE] testutil: Add lint checks for metrics, including a sub-package promlint to expose the linter engine for external usage. #739 #743
    • [ENHANCEMENT] API client: Improve error messages. #731
    • [BUGFIX] process collector: Fix process_resident_memory_bytes on 32bit MS Windows. #734

    1.5.1 / 2020-03-14

    • [BUGFIX] promhttp: Remove another superfluous WriteHeader call. #726

    1.5.0 / 2020-03-03

    • [FEATURE] promauto: Add a factory to allow automatic registration with a local registry. #713
    • [FEATURE] promauto: Add NewUntypedFunc. #713
    • [FEATURE] API client: Support new metadata endpoint. #718

    1.4.1 / 2020-02-07

    • [BUGFIX] Fix timestamp of exemplars in CounterVec. #710

    1.4.0 / 2020-01-27

    • [CHANGE] Go collector: Improve doc string for go_gc_duration_seconds. #702
    • [FEATURE] Support a subset of OpenMetrics, including exemplars. Needs opt-in via promhttp.HandlerOpts. EXPERIMENTAL #706
    • [FEATURE] Add testutil.CollectAndCount. #703
    Commits
    • 6edbbd9 Merge pull request #744 from prometheus/beorn7/release
    • 9c28cb9 Cut v1.6.0
    • 332f324 Update dependencies
    • 00d5f9e Merge pull request #743 from prometheus/beorn7/test
    • dc79bd6 Improve various comments
    • 2f196c7 Merge pull request #742 from simonpasquier/remove-travis
    • 39dbb24 Add helper functions for linting to testutil
    • 6433bcf Add the capability to lint MetricFamilies directly
    • 35355f0 Remove Travis CI
    • a3a5923 Merge pull request #739 from RainbowMango/pr_porting_promlint
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 1
Releases(v1.0.2)
Owner
Daniel Middlecote
Daniel Middlecote
Go fearless SQL. Sqlvet performs static analysis on raw SQL queries in your Go code base.

Sqlvet Sqlvet performs static analysis on raw SQL queries in your Go code base to surface potential runtime errors at build time. Feature highlights:

QP Hou 458 Dec 4, 2022
A Golang library for using SQL.

dotsql A Golang library for using SQL. It is not an ORM, it is not a query builder. Dotsql is a library that helps you keep sql files in one place and

Gustavo Chaín 652 Nov 28, 2022
a golang library for sql builder

Gendry gendry is a Go library that helps you operate database. Based on go-sql-driver/mysql, it provides a series of simple but useful tools to prepar

DiDi 1.4k Nov 28, 2022
SQL builder and query library for golang

__ _ ___ __ _ _ _ / _` |/ _ \ / _` | | | | | (_| | (_) | (_| | |_| | \__, |\___/ \__, |\__,_| |___/ |_| goqu is an expressive SQL bu

Doug Martin 1.7k Nov 30, 2022
Go library for accessing multi-host SQL database installations

hasql hasql provides simple and reliable way to access high-availability database setups with multiple hosts. Status hasql is production-ready and is

Yandex 103 Nov 17, 2022
Database Abstraction Layer (dbal) for Go. Support SQL builder and get result easily (now only support mysql)

godbal Database Abstraction Layer (dbal) for go (now only support mysql) Motivation I wanted a DBAL that No ORM、No Reflect、Concurrency Save, support S

徐佳军 56 Nov 17, 2022
SQL query builder for Go

GoSQL Query builder with some handy utility functions. Documentation For full documentation see the pkg.go.dev or GitBook. Examples // Open database a

Travis Harmon 26 Sep 26, 2022
Type safe SQL builder with code generation and automatic query result data mapping

Jet Jet is a complete solution for efficient and high performance database access, consisting of type-safe SQL builder with code generation and automa

null 912 Dec 2, 2022
A Go (golang) package that enhances the standard database/sql package by providing powerful data retrieval methods as well as DB-agnostic query building capabilities.

ozzo-dbx Summary Description Requirements Installation Supported Databases Getting Started Connecting to Database Executing Queries Binding Parameters

Ozzo Framework 587 Nov 29, 2022
Write your SQL queries in raw files with all benefits of modern IDEs, use them in an easy way inside your application with all the profit of compile time constants

About qry is a general purpose library for storing your raw database queries in .sql files with all benefits of modern IDEs, instead of strings and co

Sergey Treinis 25 Nov 5, 2022
Type safe SQL query builder and struct mapper for Go

sq (Structured Query) ?? ?? sq is a code-generated, type safe query builder and struct mapper for Go. ?? ?? Documentation • Reference • Examples This

null 180 Nov 26, 2022
Fast SQL query builder for Go

sqlf A fast SQL query builder for Go. sqlf statement builder provides a way to: Combine SQL statements from fragments of raw SQL and arguments that ma

Vlad Glushchuk 90 Dec 3, 2022
💥 A lightweight DSL & ORM which helps you to write SQL in Go.

sqlingo is a SQL DSL (a.k.a. SQL Builder or ORM) library in Go. It generates code from the database and lets you write SQL queries in an elegant way.

Qishuai Liu 270 Dec 2, 2022
Fluent SQL generation for golang

sqrl - fat-free version of squirrel - fluent SQL generator for Go Non thread safe fork of squirrel. The same handy fluffy helper, but with extra lette

Ivan Kirichenko 246 Nov 30, 2022
Fluent SQL generation for golang

Squirrel is "complete". Bug fixes will still be merged (slowly). Bug reports are welcome, but I will not necessarily respond to them. If another fork

null 5.4k Dec 5, 2022
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.

GraphJin - Build APIs in 5 minutes GraphJin gives you a high performance GraphQL API without you having to write any code. GraphQL is automagically co

Vikram Rangnekar 2.4k Dec 1, 2022
golang orm and sql builder

gosql gosql is a easy ORM library for Golang. Style: var userList []UserModel err := db.FetchAll(&userList, gosql.Columns("id","name"), gosql.

RushTeam 167 Nov 19, 2022
Analyzer: helps uncover bugs by reporting a diagnostic for mistakes of *sql.Rows usage.

sqlrows sqlrows is a static code analyzer which helps uncover bugs by reporting a diagnostic for mistakes of sql.Rows usage. Install You can get sqlro

GoStaticAnalysis 86 Mar 24, 2022
LBADD: An experimental, distributed SQL database

LBADD Let's build a distributed database. LBADD is an experimental distributed SQL database, written in Go. The goal of this project is to build a dat

Tom Arrell 379 Nov 29, 2022