Skip to content

Commit

Permalink
Merge pull request #819 from grafana/julienduchesne/latest-head
Browse files Browse the repository at this point in the history
Sync upstream prometheus to latest HEAD
  • Loading branch information
julienduchesne authored Jan 10, 2025
2 parents 114aaaa + c7f1945 commit a1e2bcf
Show file tree
Hide file tree
Showing 34 changed files with 1,776 additions and 604 deletions.
6 changes: 3 additions & 3 deletions cmd/prometheus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func main() {

_, err := a.Parse(os.Args[1:])
if err != nil {
fmt.Fprintln(os.Stderr, fmt.Errorf("Error parsing command line arguments: %w", err))
fmt.Fprintf(os.Stderr, "Error parsing command line arguments: %s\n", err)
a.Usage(os.Args[1:])
os.Exit(2)
}
Expand All @@ -548,7 +548,7 @@ func main() {
notifs.AddNotification(notifications.StartingUp)

if err := cfg.setFeatureListOptions(logger); err != nil {
fmt.Fprintln(os.Stderr, fmt.Errorf("Error parsing feature list: %w", err))
fmt.Fprintf(os.Stderr, "Error parsing feature list: %s\n", err)
os.Exit(1)
}

Expand Down Expand Up @@ -1742,7 +1742,7 @@ func (s *readyStorage) WALReplayStatus() (tsdb.WALReplayStatus, error) {
}

// ErrNotReady is returned if the underlying scrape manager is not ready yet.
var ErrNotReady = errors.New("Scrape manager not ready")
var ErrNotReady = errors.New("scrape manager not ready")

// ReadyScrapeManager allows a scrape manager to be retrieved. Even if it's set at a later point in time.
type readyScrapeManager struct {
Expand Down
9 changes: 4 additions & 5 deletions cmd/promtool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/prometheus/client_golang/api"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/testutil/promlint"
config_util "github.com/prometheus/common/config"
"github.com/prometheus/common/expfmt"
"github.com/prometheus/common/model"
"github.com/prometheus/common/promslog"
"github.com/prometheus/common/version"
Expand All @@ -45,7 +45,6 @@ import (

dto "github.com/prometheus/client_model/go"
promconfig "github.com/prometheus/common/config"
"github.com/prometheus/common/expfmt"

"github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/discovery"
Expand Down Expand Up @@ -312,12 +311,12 @@ func main() {
kingpin.Fatalf("Cannot set base auth in the server URL and use a http.config.file at the same time")
}
var err error
httpConfig, _, err := config_util.LoadHTTPConfigFile(httpConfigFilePath)
httpConfig, _, err := promconfig.LoadHTTPConfigFile(httpConfigFilePath)
if err != nil {
kingpin.Fatalf("Failed to load HTTP config file: %v", err)
}

httpRoundTripper, err = promconfig.NewRoundTripperFromConfig(*httpConfig, "promtool", config_util.WithUserAgent("promtool/"+version.Version))
httpRoundTripper, err = promconfig.NewRoundTripperFromConfig(*httpConfig, "promtool", promconfig.WithUserAgent("promtool/"+version.Version))
if err != nil {
kingpin.Fatalf("Failed to create a new HTTP round tripper: %v", err)
}
Expand Down Expand Up @@ -702,7 +701,7 @@ func checkConfig(agentMode bool, filename string, checkSyntaxOnly bool) ([]strin
return ruleFiles, nil
}

func checkTLSConfig(tlsConfig config_util.TLSConfig, checkSyntaxOnly bool) error {
func checkTLSConfig(tlsConfig promconfig.TLSConfig, checkSyntaxOnly bool) error {
if len(tlsConfig.CertFile) > 0 && len(tlsConfig.KeyFile) == 0 {
return fmt.Errorf("client cert file %q specified without client key file", tlsConfig.CertFile)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/http_sd.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sort_rank: 7
Prometheus provides a generic [HTTP Service Discovery](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config),
that enables it to discover targets over an HTTP endpoint.

The HTTP Service Discovery is complimentary to the supported service
The HTTP Service Discovery is complementary to the supported service
discovery mechanisms, and is an alternative to [File-based Service Discovery](https://prometheus.io/docs/guides/file-sd/#use-file-based-service-discovery-to-discover-scrape-targets).

## Comparison between File-Based SD and HTTP SD
Expand Down
4 changes: 4 additions & 0 deletions docs/querying/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ URL query parameters:
- `time=<rfc3339 | unix_timestamp>`: Evaluation timestamp. Optional.
- `timeout=<duration>`: Evaluation timeout. Optional. Defaults to and
is capped by the value of the `-query.timeout` flag.
- `limit=<number>`: Maximum number of returned series. Doesn’t affect scalars or strings but truncates the number of series for matrices and vectors. Optional. 0 means disabled.

The current server time is used if the `time` parameter is omitted.

Expand Down Expand Up @@ -154,6 +155,7 @@ URL query parameters:
- `step=<duration | float>`: Query resolution step width in `duration` format or float number of seconds.
- `timeout=<duration>`: Evaluation timeout. Optional. Defaults to and
is capped by the value of the `-query.timeout` flag.
- `limit=<number>`: Maximum number of returned series. Optional. 0 means disabled.

You can URL-encode these parameters directly in the request body by using the `POST` method and
`Content-Type: application/x-www-form-urlencoded` header. This is useful when specifying a large
Expand Down Expand Up @@ -1158,6 +1160,8 @@ $ curl http://localhost:9090/api/v1/status/runtimeinfo
"data": {
"startTime": "2019-11-02T17:23:59.301361365+01:00",
"CWD": "/",
"hostname" : "DESKTOP-717H17Q",
"serverTime": "2025-01-05T18:27:33Z",
"reloadConfigSuccess": true,
"lastConfigTime": "2019-11-02T17:23:59+01:00",
"timeSeriesCount": 873,
Expand Down
Loading

0 comments on commit a1e2bcf

Please sign in to comment.