You've already forked postgres_exporter
mirror of
https://github.com/prometheus-community/postgres_exporter.git
synced 2025-08-05 06:21:12 +03:00
committed by
Will Rouesnel
parent
37e6dd3bec
commit
8f3088611b
@@ -2,25 +2,24 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"math"
|
"math"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
|
||||||
"time"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"errors"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
|
|
||||||
|
"github.com/blang/semver"
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/prometheus/common/log"
|
"github.com/prometheus/common/log"
|
||||||
"github.com/blang/semver"
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var Version string = "0.0.1"
|
var Version string = "0.0.1"
|
||||||
@@ -358,7 +357,6 @@ var queryOverrides = map[string][]OverrideQuery{
|
|||||||
},
|
},
|
||||||
// No query is applicable for 9.1 that gives any sensible data.
|
// No query is applicable for 9.1 that gives any sensible data.
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the query override file to the version-specific query override file
|
// Convert the query override file to the version-specific query override file
|
||||||
@@ -509,7 +507,7 @@ func makeDescMap(pgVersion semver.Version, metricMaps map[string]map[string]Colu
|
|||||||
// Check column version compatibility for the current map
|
// Check column version compatibility for the current map
|
||||||
// Force to discard if not compatible.
|
// Force to discard if not compatible.
|
||||||
if columnMapping.supportedVersions != nil {
|
if columnMapping.supportedVersions != nil {
|
||||||
if columnMapping.supportedVersions(pgVersion) {
|
if !columnMapping.supportedVersions(pgVersion) {
|
||||||
thisMap[columnName] = MetricMap{
|
thisMap[columnName] = MetricMap{
|
||||||
discard: true,
|
discard: true,
|
||||||
conversion: func(in interface{}) (float64, bool) {
|
conversion: func(in interface{}) (float64, bool) {
|
||||||
|
Reference in New Issue
Block a user