874 Commits

Author SHA1 Message Date
Frederic Branczyk
1751685dd4
Merge pull request #18194 from rexagod/11726
discovery: Introduce `prometheus_sd_last_update_timestamp_seconds`
2026-03-02 17:00:42 +01:00
Frederic Branczyk
bf139a370c
Merge pull request #18006 from rexagod/13525
discovery/kubernetes: Support node role selectors for pod roles
2026-03-02 10:03:26 +01:00
Pranshu Srivastava
c023066ca9
discovery: Introduce prometheus_sd_last_update_timestamp_seconds
The metric tracks the last update sent to SD consumers, and includes the
manager name. This allows for monitoring SD state based on far ago its
last heartbeat was.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2026-02-25 18:45:24 +05:30
Bryan Boreham
d28d33afe0
Merge branch 'main' into fix/consul-filter-health-endpoint
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2026-02-24 11:25:35 +00:00
Aurélien Duboc
1a5da4fbe0
fix(discovery): apply EC2 SD endpoint and guard refreshAZIDs nils (#18133)
Signed-off-by: Aurelien Duboc <aurelienduboc96@gmail.com>
2026-02-24 12:12:57 +01:00
Matt
ce30ae49f3
[FEATURE] AWS SD: Add Elasticache Role (#18099)
* AWS SD: Elasticache

This change adds Elasticache to the AWS SD.

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Matt <small_minority@hotmail.com>

---------

Signed-off-by: Matt <small_minority@hotmail.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2026-02-22 15:56:03 +01:00
Julien Pivotto
7d0a39ac93 chore(lint): enable wg.Go
Since our minimum supported go version is now go 1.25, we can use wg.Go.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-02-17 15:21:51 +01:00
Joe Adams
68df59ba0c
Merge pull request #18029 from matt-gp/ecs-sd-bug-17920
AWS SD: ECS Discover Standalone Tasks
2026-02-10 22:03:28 -05:00
Ganesh Vernekar
847e474bf4 Kubernetes SD: Disable WatchListClient in tests
Signed-off-by: Ganesh Vernekar <ganesh.vernekar@reddit.com>
2026-02-10 12:39:34 -08:00
Ganesh Vernekar
1698aada1e Update Go dependencies for v3.10 release
Signed-off-by: Ganesh Vernekar <ganesh.vernekar@reddit.com>
2026-02-10 12:39:33 -08:00
George Krajcsovits
246341b169
Merge pull request #18041 from matt-gp/aws-sd-msk-optimisations
AWS SD: Optimise MSK Role
2026-02-10 12:17:09 +01:00
Matt
e27bcdf03f
AWS SD: Load Region Fallback (#18019)
* AWS SD: Load Region Fallback

---------

Signed-off-by: matt-gp <small_minority@hotmail.com>
2026-02-10 12:02:24 +01:00
matt-gp
96a87a06ea
AWS SD: Optmise MSK Role
Signed-off-by: matt-gp <small_minority@hotmail.com>
2026-02-08 19:42:12 +00:00
matt-gp
5329355ffb
AWS SD: ECS Standalone Tasks
The current ECS role in AWS SD assumes that a task is part of a service.
This means that tasks that are started as part of AWS Batch will get
missed and not be discovered. This changed fixes this so that standalone
tasks can be discovered as well.

Signed-off-by: matt-gp <small_minority@hotmail.com>
2026-02-08 16:04:17 +00:00
Matt
cf9d093f8f
prw2: Move Remote Write 2.0 CT to be per Sample; Rename to ST (start timestamp) (#17411) (#17600)
Relates to
https://github.com/prometheus/prometheus/issues/16944#issuecomment-3164760343

Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: matt-gp <small_minority@hotmail.com>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
2026-02-05 10:40:45 +01:00
Pranshu Srivastava
99e464c239
discovery/kubernetes: Support node role selectors for pod roles
The node informers for pod roles respected filtering based on selectors
([1]). However, node selectors for pod roles were not allowed. This
patch address that, and additionally adds pod filtering logic, to not
populate their target groups when they belong to a filtered node.

[1]:https://github.com/prometheus/prometheus/pull/10080/changes#diff-e9ca22962ad7d9a7bb4cb82d209dc2dd5301f457d8242da5535557866d2ea1eaR667

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2026-02-04 02:26:50 +05:30
Ben Kochie
9b549fa118
Update Go yaml v3 library (#17913)
Replace archived `gopkg.in/yaml.v3` with supported `go.yaml.in/yaml/v3`.

Fixes: https://github.com/prometheus/prometheus/issues/16415

Signed-off-by: SuperQ <superq@gmail.com>
2026-01-22 16:36:30 +01:00
Matt
39e524088c
Fix(discovery/aws): Create Copies of Default Config (#17769)
Signed-off-by: matt-gp <small_minority@hotmail.com>
2026-01-22 11:34:01 +01:00
dependabot[bot]
99c8351d0e
chore(deps): bump github.com/hetznercloud/hcloud-go/v2 from 2.32.0 to 2.33.0 (#17762)
* chore(deps): bump github.com/hetznercloud/hcloud-go/v2

Bumps [github.com/hetznercloud/hcloud-go/v2](https://github.com/hetznercloud/hcloud-go) from 2.32.0 to 2.33.0.
- [Release notes](https://github.com/hetznercloud/hcloud-go/releases)
- [Changelog](https://github.com/hetznercloud/hcloud-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hetznercloud/hcloud-go/compare/v2.32.0...v2.33.0)

---
updated-dependencies:
- dependency-name: github.com/hetznercloud/hcloud-go/v2
  dependency-version: 2.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

* Use `server.Datacenter` until next minor release - disable linting of it in the meantime

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-01-07 13:21:56 +01:00
VictorFilatov
0a2be81616
Fix link in discovery README.md (#17753)
Signed-off-by: VictorFilatov <phylactus@gmail.com>
2026-01-06 09:55:03 +01:00
Ben Kochie
e14795bbf4
Remove copyright date from headers (#17785)
Remove copyright dates from various files as part of [PROM-50].

[PROM-50]: https://github.com/prometheus/proposals/blob/main/proposals/0050-remove-copyright-dates.md

Signed-off-by: SuperQ <superq@gmail.com>
2026-01-05 13:46:21 +01:00
matt-gp
9b6e244b83
AWS SD: ECS Bridge Mode
Previously the AWS SD ECS Role only discovered instances that used
`awsvpc` network mode, which attaches a dedicated Elastic Network
Interface (ENI). This change adds in additional logic so that we
discover instances that are using `host` and `bridge` networking modes,
where the IP address is that of the EC2 instance that is hosting the
container. Also this change exposes a number of additional labels that
relate to the EC2 instance when the launch type is `EC2`.

Signed-off-by: matt-gp <small_minority@hotmail.com>
2025-12-25 19:26:14 +00:00
Julien
f73aba34cd
Merge pull request #17427 from roidelapluie/roidelapluie/ffapi
API: Add a /api/v1/features endpoint
2025-12-10 10:14:03 +01:00
Julien Pivotto
a5671a002f API: Add a /api/v1/features endpoint
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-12-09 16:13:14 +01:00
intojhanurag
1ccc0fed81 Revert triton_test.go and kuma_test.go to main version
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
2025-12-08 16:51:22 +00:00
intojhanurag
ea072fd56a Added cleanup closure in kuma test
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
2025-12-08 08:35:52 +00:00
intojhanurag
0251e888f9 Refactor Triton tests to simplify metrics cleanup using cleanup closure
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
2025-12-08 08:26:24 +00:00
intojhanurag
025628f272 unregistering RefreshMetrics instances
Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
2025-12-06 19:50:49 +00:00
dongjiang
3239723098
Update golangci-lint and add modernize check (#17640)
* add modernize check

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* fix golangci lint

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
2025-12-05 09:29:10 +01:00
harsh kumar
30be1483d1
instrumentation: add native histograms to complement high-traffic summaries (#17374)
This adds the following native histograms (with a few classic buckets for backwards compatibility), while keeping the corresponding summaries (same name, just without `_histogram`):

- `prometheus_sd_refresh_duration_histogram_seconds`
- `prometheus_rule_evaluation_duration_histogram_seconds`
- `prometheus_rule_group_duration_histogram_seconds`
- `prometheus_target_sync_length_histogram_seconds`
- `prometheus_target_interval_length_histogram_seconds`
- `prometheus_engine_query_duration_histogram_seconds`

Signed-off-by: Harsh <harshmastic@gmail.com>
Signed-off-by: harsh kumar <135993950+hxrshxz@users.noreply.github.com>
Co-authored-by: Björn Rabenstein <github@rabenste.in>
2025-11-27 18:45:35 +01:00
Will Bollock
4aa8941eb1
fix(discovery): aws discovery test fix (#17527)
* fix: aws discovery test fix

Fixes a problem introduced after the merge of this https://github.com/prometheus/prometheus/pull/17138

PR didn't take into account another merged PR!

```
discovery/aws/aws.go:218:54: too many arguments in call to NewEC2Discovery
    have (*EC2SDConfig, *slog.Logger, *ec2Metrics)
    want (*EC2SDConfig, discovery.DiscovererOptions)
discovery/aws/aws.go:222:66: too many arguments in call to NewLightsailDiscovery
    have (*LightsailSDConfig, *slog.Logger, *lightsailMetrics)
    want (*LightsailSDConfig, discovery.DiscovererOptions)
```

Signed-off-by: Will Bollock <wbollock@linode.com>

* fix: align ecs style

ECS was a new service discovery tool added after this PR was merged: https://github.com/prometheus/prometheus/pull/17138

Aligns the style of passing a single "opts" to it like almost all the other
service discovery engines now use

Signed-off-by: Will Bollock <wbollock@linode.com>

---------

Signed-off-by: Will Bollock <wbollock@linode.com>
2025-11-16 10:28:50 +00:00
Julius Hinze
987b28e26c
discovery: fix constructor arguments in aws discovery (#17526)
Signed-off-by: Julius Hinze <julius.hinze@grafana.com>
2025-11-13 15:59:14 +00:00
Bryan Boreham
e02a65b6bd
Merge pull request #17138 from wbollock/feat/prometheus_refresh_config_label
feat(metrics): add config label to refresh metrics
2025-11-13 14:51:39 +01:00
matt-gp
1b52ab9e3b
feat: AWS ECS Service Discovery
Signed-off-by: matt-gp <small_minority@hotmail.com>
2025-11-06 22:48:07 +00:00
Mohammad Varmazyar
63027b6533
Merge branch 'main' into fix/consul-filter-health-endpoint
Signed-off-by: Mohammad Varmazyar <mrvarmazyar@gmail.com>
2025-11-06 19:46:20 +01:00
Ben Kochie
204249fcb5
Update golangci-lint (#17478)
* Update golangci-lint to v2.6.0
* Fixup various linting issues.
* Fixup deprecations.
* Add exception for `labels.MetricName` deprecation.

Signed-off-by: SuperQ <superq@gmail.com>
2025-11-05 13:47:34 +01:00
Ben Kochie
48956f60d7
Update modernize (#17471)
Apply additional Go modernize tool improvements.

Signed-off-by: SuperQ <superq@gmail.com>
2025-11-04 05:13:49 +00:00
György Krajcsovits
fbd5353a19
Merge remote-tracking branch 'origin/release-3.7' into krajo/merge-release-372-to-main 2025-10-22 18:02:22 +02:00
George Krajcsovits
d06c96136d
Merge pull request #17376 from sysadmind/fix-17375
discovery/aws: Fix region load from IMDS
2025-10-22 11:02:56 +02:00
Joe Adams
6f9af6651e
Update lightsail to use IMDS for region
Signed-off-by: Joe Adams <github@joeadams.io>
2025-10-21 20:31:55 -04:00
Joe Adams
7a29bd2cb4
discovery/aws: Fix region load from IMDS
Loading the local region from the Instance MetaData Service broke in v3.7. This adds the IMDS call back in order to load the local region when no other method has set the region.

fixes #17375

Signed-off-by: Joe Adams <github@joeadams.io>
2025-10-20 22:47:07 -04:00
Julien Pivotto
c40a574197 discovery/ec2: Fix AWS SDK v2 credentials handling for EC2 and Lightsail discovery
After the upgrade to AWS SDK v2, the EC2 and Lightsail service discovery
stopped working when using the default AWS credential chain (environment
variables, IAM roles, EC2 instance metadata, etc.).

The issue was that the code unconditionally created a StaticCredentialsProvider
with empty credentials when access_key and secret_key were not configured. In
AWS SDK v2, this causes a "static credentials are empty" error and prevents
the SDK from falling back to its default credential chain.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-10-17 15:52:40 +02:00
Mohammad Varmazyar
5e342d315c discovery/consul: Fix filter parameter not applied to health endpoint
The filter parameter was only being passed to catalog.Services()
but not to health.ServiceMultipleTags(), causing filters on Node
and Node.Meta to be ignored when discovering service instances.

This adds the missing Filter field to QueryOptions in the
consulService.watch() method.

Fixes #16087

Signed-off-by: Mohammad Varmazyar <m.varmazyar@gmail.com>
Signed-off-by: Mohammad Varmazyar <mrvarmazyar@gmail.com>
2025-10-17 00:29:36 +02:00
Will Bollock
e894a22b88 feat: add config label to refresh metrics
Adds a `config` label (similar to `prometheus_sd_discovered_targets`) to
refresh metrics to help identify the source of refresh issues or
performance stats. In particular for HTTP SD, it can be common to have
multiple disparate HTTP SD sources that should be identified and not
lumped together. For example if one HTTP SD service has failures, that
should be evident in its own time series seperate from other HTTP SD
sources.

`config` seemed more appropriate than `endpoint` as a general standard
for `prometheus_sd` metrics.

Docs were also updated for HTTP SD to point at the new refresh metrics
rather than the older metrics.

Signed-off-by: Will Bollock <wbollock@linode.com>
2025-10-14 11:36:14 -04:00
Harsh
24282f7b44 test(discovery/xds): speed up tests with t.Parallel()
Signed-off-by: Harsh <harshmastic@gmail.com>
2025-10-12 15:27:33 +05:30
Michael Shen
1eaddc64d0
Migrate K8s discovery service queues to use strongly typed queues
Signed-off-by: Michael Shen <mishen@umich.edu>
2025-09-23 20:32:11 -07:00
Michael Shen
9c525b84c4
Add deprecation notice to associated K8s endpoints API objects
Signed-off-by: Michael Shen <mishen@umich.edu>
2025-09-23 20:30:37 -07:00
Michael Shen
1703e54dfd
Update to k8s.io v0.33.5
Signed-off-by: Michael Shen <mishen@umich.edu>
2025-09-23 20:30:36 -07:00
Bryan Boreham
26279e5b6d
Merge pull request #17066 from cuiweixie/reflect.TypeFor-discovery
discovery: refactor to use reflect.TypeFor

Use a neater form, introduced in Go 1.22.
2025-09-16 12:22:14 +01:00
Arve Knudsen
913cc8f72b
Replace gopkg.in/yaml.v2 with go.yaml.in/yaml/v2 (#17151)
* Replace gopkg.in/yaml.v2 with go.yaml.in/yaml/v2
* Upgrade to client_golang@v1.23.2

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-09-06 13:04:24 +02:00