1
0
mirror of https://github.com/prometheus-community/postgres_exporter.git synced 2025-08-05 06:21:12 +03:00

Use correct SemVer range condition. Fixes #38 (#39)

This commit is contained in:
Dominik Schulz
2016-11-28 15:49:25 +01:00
committed by Will Rouesnel
parent 37e6dd3bec
commit 8f3088611b

View File

@@ -2,25 +2,24 @@ package main
import (
"database/sql"
"errors"
"flag"
"fmt"
"io/ioutil"
"math"
"net/http"
"os"
"strconv"
"time"
"regexp"
"errors"
"strconv"
"sync"
"time"
"gopkg.in/yaml.v2"
"github.com/blang/semver"
_ "github.com/lib/pq"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
"github.com/blang/semver"
)
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.
},
}
// 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
// Force to discard if not compatible.
if columnMapping.supportedVersions != nil {
if columnMapping.supportedVersions(pgVersion) {
if !columnMapping.supportedVersions(pgVersion) {
thisMap[columnName] = MetricMap{
discard: true,
conversion: func(in interface{}) (float64, bool) {