Update dependencies, with some changes worth noting:
* Adjusted code for memlimit API change
* moved from go.yaml.in/yaml/v4 to github.com/pb33f/go-yaml
* custom js resolver to fix build issue
---------
Signed-off-by: Owen Williams <owen.williams@grafana.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Bump github.com/prometheus/sigv4 from v0.4.1 to v0.5.0.
The new release adds SessionName and Tags fields for STS AssumeRole
(prometheus/sigv4#76). The updated NewSigV4RoundTripper signature uses
variadic options and remains backward-compatible, so no Prometheus code
changes are required beyond the version bump.
service_name was already part of the struct in v0.4.1 but was missing
from the documentation — it is now documented alongside the new fields.
Also replace deprecated expfmt.Fmt* constants with expfmt.NewFormat
(expfmt.Type*) in web/federate.go to fix the SA1019 staticcheck failure
introduced by the prometheus/common v0.71.0 transitive bump.
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
* fix(deps): update kubernetes go dependencies to v0.36.4
* build: bump minimum Go version to 1.26.0
Align all workspace modules with the Kubernetes v0.36.4 requirement and adopt errors.AsType where required by the Go 1.26 lint baseline.
---------
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Deps that require go >= 1.26 (consul/api, k8s.io/*) were kept at
their previous versions to maintain the go 1.25 directive.
Signed-off-by: Ayoub Mrini <ayoubmrini424@gmail.com>
Upgrade consul/api to v1.33.7, as well as serf to v0.10.4, to get rid of
vulnerable mapstructure dependency.
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
* fix(deps): update module github.com/pb33f/libopenapi-validator to v0.13.11
* build: bump go.work go directive to 1.25.7 to match go.mod
libopenapi v0.38.1 and libopenapi-validator v0.13.11 declare go 1.25.7, which raised the root go.mod directive in the previous commit. The tracked go.work was left at 1.25.0.
A workspace's go directive must be >= every member module's, so Go commands (build, test, mod verify, lint) fail in workspace mode until go.work matches.
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
---------
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Run `make update-all-go-deps` with the Go toolchain pinned to 1.25.0
(`GOTOOLCHAIN=go1.25.0`) so the `go` directive stays at 1.25.0 and the
project keeps building with any Go 1.25.x. Dependency updates that would
raise their own minimum Go past 1.25.0 (Kubernetes v0.36.x, Consul
api >= v1.34, bufbuild/buf v1.70, google.golang.org/api v0.284) are left at
their current versions and can be picked up once the project moves to Go 1.26.
github.com/prometheus/common is updated to v0.68.1, which removed the
expfmt.WithUnit() encoder option (the unit is now written automatically when
set). Drop the now-removed option from the scrape manager test; it was a
no-op there because the test metric does not set a unit.
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add OpenAPI 3.2 specification generation for Prometheus HTTP API
This commit introduces an OpenAPI specification for the Prometheus API.
After testing multiple code-generation servers with built-in APIs, this
implementation uses an independent spec file outside of the critical path.
This spec file is tested with a framework present in this pull request.
The specification helps clients know which parameters they can use and is
served at /api/v1/openapi.yaml. The spec file will evolve with the
Prometheus API and has the same version number.
Downstream projects can tune the APIs presented in the spec file with
configuration options using the IncludePaths setting for path filtering.
In the future, there is room to generate a server from this spec file
(e.g. with interfaces), but this is out of scope for this pull request.
Architecture:
- Core OpenAPI infrastructure (openapi.go): Dynamic spec building,
caching, and thread-safe spec generation
- Schema definitions (openapi_schemas.go): Complete type definitions
for all API request and response types
- Path specifications (openapi_paths.go): Endpoint definitions with
parameters, request bodies, and response schemas
- Examples (openapi_examples.go): Realistic request/response examples
- Helper functions (openapi_helpers.go): Reusable builders for common
OpenAPI structures
Testing:
- Comprehensive test suite with golden file validation
- Test helpers package for API testing infrastructure
- OpenAPI compliance validation utilities
The golden file captures the complete specification for snapshot testing.
Update with: go test -run TestOpenAPIGolden -update-openapi-spec
REVIEWERS: The most important thing to check would be the OpenAPI golden
file (web/api/v1/testdata/openapi_golden.yaml). Test scenarios are important
as they test the actual OpenAPI spec validity.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
* Add OpenAPI 3.1 support with version selection
Add support for both OpenAPI 3.1 and 3.2 specifications with version
selection via openapi_version query parameter. Defaults to 3.1 for
broader compatibility
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
* Enhance OpenAPI examples and add helper functions
- Add timestampExamples helper for consistent time formatting
- Add exampleMap helper to simplify example creation
- Improve example summaries with query details
- Add matrix result example for range vector queries
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
* web/api: Add AtST method to test helper iterators
Implement the AtST() method required by chunkenc.Iterator interface
for FakeSeriesIterator and FakeHistogramSeriesIterator test helpers.
The method returns 0 as these test helpers don't use start timestamps
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
* OpenAPI: Add minimum coverage test
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
* OpenAPI: Improve examples handling
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
---------
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
By running `make update-all-go-deps`.
`hashicorp/consul/api` must be held at v1.32.1 because later versions
require Go 1.25 and we choose to ensure that Promethes builds with the
last two versions of Go.
Also: fix compilation errors in remote-write example.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
It doesn't reflect the version we use for CI builds, which is controlled
by `.promu.yml`.
As such, I cannot see any justification to keep this line: it isn't
necessary and it could confuse people.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>