Commit Graph

1803 Commits

Author SHA1 Message Date
bwplotka bffa92259b api: Add remote API with write client; add remote handler.
Signed-off-by: bwplotka <bwplotka@gmail.com>
2024-10-21 14:18:10 +01:00
Arthur Silva Sens e1675ced80
Merge pull request #1651 from prometheus/arianna-maintainer
Add Arianna as maintainer 💪
2024-10-15 10:01:20 -03:00
Arthur Silva Sens e265df7a36
Merge pull request #1647 from prometheus/release-1.20
Merge release 1.20 to main
2024-10-15 09:50:03 -03:00
Arthur Silva Sens ffcf34fec0
Add Arianna as maintainer 💪
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2024-10-15 09:36:59 -03:00
Bartlomiej Plotka 48e12a1855
Merge pull request #1645 from prometheus/cut-1204-pr1424
undefined
2024-10-15 11:44:04 +02:00
bwplotka 504ad9bf5c Cut 1.20.5; update comments.
Signed-off-by: bwplotka <bwplotka@gmail.com>

# Conflicts:
#	CHANGELOG.md
2024-10-14 21:56:44 +01:00
bwplotka 584a7ce3d9 Revert "testutil compareMetricFamilies: make less error-prone (#1424)"
This reverts commit c7c7509669.
2024-10-14 21:52:04 +01:00
Ying WANG 9c67f6190c
process_collector: Merge wasip1 and js into a single implementation (#1644)
Signed-off-by: Ying WANG <ying.wang@grafana.com>
2024-10-14 15:32:03 +01:00
Arthur Silva Sens 284ca0ff58
Optinally print OM created lines (#1408)
Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
Co-authored-by: Arthur Silva Sens <arthur.sens@coralogix.com>
2024-10-14 15:31:13 +01:00
dependabot[bot] 93c851f0b3
build(deps): bump the github-actions group with 4 updates (#1634)
Bumps the github-actions group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action), [dagger/dagger-for-github](https://github.com/dagger/dagger-for-github) and [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request).


Updates `actions/checkout` from 4.1.6 to 4.2.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.6...d632683dd7b4114ad314bca15554477dd762a938)

Updates `github/codeql-action` from 3.26.6 to 3.26.10
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4dd16135b6...e2b3eafc8d)

Updates `dagger/dagger-for-github` from 6.6.0 to 6.11.0
- [Release notes](https://github.com/dagger/dagger-for-github/releases)
- [Commits](8ab204f3cf...fc945fa66f)

Updates `peter-evans/create-pull-request` from 6.1.0 to 7.0.5
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](c5a7806660...5e914681df)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: dagger/dagger-for-github
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 18:28:10 +01:00
PrometheusBot ae6e5d0fe2
Update common Prometheus files (#1635)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2024-10-08 18:27:35 +01:00
Ying WANG b2ef833442
process_collector: Add Platform-Specific Describe for processCollector (#1625)
* process_collector: Add Platform-Specific Describe for processCollector

Signed-off-by: Ying WANG <ying.wang@grafana.com>

* add changelog entry

Signed-off-by: Ying WANG <ying.wang@grafana.com>

* Address comments

Signed-off-by: Ying WANG <ying.wang@grafana.com>

---------

Signed-off-by: Ying WANG <ying.wang@grafana.com>
2024-10-07 12:08:32 +02:00
github-actions[bot] a9c0488390
Merge pull request #1632 from prometheus/dependabot/go_modules/golang.org/x/sys-0.25.0
build(deps): bump golang.org/x/sys from 0.24.0 to 0.25.0
2024-10-01 09:30:05 +00:00
github-actions[bot] 38fb2b1818
Merge pull request #1633 from prometheus/dependabot/go_modules/github.com/klauspost/compress-1.17.10
build(deps): bump github.com/klauspost/compress from 1.17.9 to 1.17.10
2024-10-01 09:29:50 +00:00
dependabot[bot] cb4b0c6a9d
build(deps): bump github.com/klauspost/compress from 1.17.9 to 1.17.10
Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.17.9 to 1.17.10.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml)
- [Commits](https://github.com/klauspost/compress/compare/v1.17.9...v1.17.10)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 09:22:25 +00:00
dependabot[bot] 9cd37f90ea
build(deps): bump golang.org/x/sys from 0.24.0 to 0.25.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.24.0 to 0.25.0.
- [Commits](https://github.com/golang/sys/compare/v0.24.0...v0.25.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 09:22:16 +00:00
Matt Harbison 25bda7ceb5
process_collector: fill in virtual and resident memory values on macOS using optional cgo (#1616)
Unfortunately, these values aren't available from getrusage(2), or any other
builtin Go API.  Go itself doesn't provide a mechanism (like on Windows) to call
into system libraries.  Using a 3rd party package[1] to dynamically call system
libraries was proposed and rejected, to avoid adding to the number of
dependencies.  That leaves using cgo, which is used here when available.  When
not available (either because of cross compiling or explicitly disabling it), a
stub function is linked instead, and the metrics are not exported.  That way,
cross compiling of other platforms is unaffected (and can also still be done
with Darwin too, but at the cost of not exporting these metrics).

Note that building an amd64 image on an arm64 mac or vice-versa is cross
compiling, and will use the stub method by default.  This can be avoided by
setting `CGO_ENABLED=1` in the environment to force the use of cgo for both
architectures.

I'm unsure of the usefulness of the potential adjustment made to the virtual
memory value after calling `mach_vm_region()`.  I've not seen that code get run
with a native amd64 or arm64 image, or with an amd64 image running under
Rosetta.  But that's what the `ps(1)` command does, and I think we should report
what the system tools do.

When I was testing this on a beta of macOS 15 with Go 1.21.13 (the current
minimum support for this module), the amd64 image ran fine under Rosetta, but
the arm64 image immediately printed a message that it was killed, even prior to
the cgo call.  This seems to be a recurring issue on macOS[2][3], and passing
`-ldflags -s` to `go build` avoided the issue.  Go 1.23.1 worked out of the box,
without fiddling with linker flags, so I don't think this is an issue- Go 1.21
is simply too old to support macOS 15, but I thought it was worth noting.  I
supposed we could gate the cgo code with an additional build flag, if anyone is
concerned about this.

[1] https://github.com/ebitengine/purego
[2] https://github.com/golang/go/issues/19841#issuecomment-293334802
[3] https://github.com/golang/go/issues/11887#issuecomment-125694604

Signed-off-by: Matt Harbison <mharbison72@gmail.com>
2024-09-27 17:29:44 +01:00
PrometheusBot 86f3496868
Update common Prometheus files (#1628)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2024-09-23 15:02:05 +01:00
Arianna Vespri ff60566f1b
Refactor default runtime metrics tests for Go collector so that default runtime metric set autogenerates (#1631)
* Enable autogeneration for default runtime metrics list in collectors tests according to Go version

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Adapt withDefaultRuntimeMetrics function to work regardless of the Go version

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Autogenerate go collector test for go1.23

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Modify gen_go_collector_set.go to please linter and regenerate files

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Simplify gen_go_collector_set.go logic by modifying func computeMetricsList

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Slight simplification of withDefaultRuntimeMetrics func

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

* Refactor withDefaultRuntimeMetrics with generated default runtime metrics subsets

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>

---------

Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it>
2024-09-23 14:55:38 +01:00
Arthur Silva Sens 64158c5c00
Merge pull request #1626 from ying-jeanne/add-example-for-customlabels
examples: Add custom labels example
2024-09-19 09:09:16 +01:00
Ying WANG 86cdda8cb1
Merge branch 'main' into add-example-for-customlabels 2024-09-18 09:22:59 +02:00
Ying WANG 6efd27deef
Update examples/customlabels/main.go
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Ying WANG <74549700+ying-jeanne@users.noreply.github.com>
2024-09-18 09:20:45 +02:00
Arthur Silva Sens 39e7c23b95
Merge pull request #1627 from prometheus/release-1.20
Merge Release 1.20 back to main
2024-09-17 10:39:34 +02:00
Ying WANG b079872c87
examples: Add custom labels example
Signed-off-by: Ying WANG <ying.wang@grafana.com>
2024-09-16 00:15:30 +02:00
George Krajcsovits 05fcde9fe4
Merge pull request #1623 from krajorama/data-race-in-histogram-write
native histogram: Fix race between Write and addExemplar
2024-09-07 07:57:39 +02:00
György Krajcsovits 209f4c041e Add changelog
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-09-06 12:41:51 +02:00
György Krajcsovits 1e398ccb12 native histogram: Fix race between Write and addExemplar
Follow-up to 1608

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-09-06 11:01:04 +02:00
PrometheusBot ac114f315e
Update common Prometheus files (#1622)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2024-09-06 07:55:35 +01:00
Owen Williams c29b98675f
Merge pull request #1618 from prometheus/owilliams/utf8-testing
Set allow-utf-8 in Format during tests to avoid escaping.
2024-09-05 15:24:18 -04:00
Owen Williams 4d20de5bfa Set allow-utf-8 in Format during tests to avoid escaping.
For https://github.com/open-telemetry/opentelemetry-go/pull/5755

Signed-off-by: Owen Williams <owen.williams@grafana.com>
2024-09-05 15:16:46 -04:00
Arthur Silva Sens ef2f87ea98
Merge pull request #1620 from prometheus/arthursens/prepare-1.20.3
Add changelog entry for 1.20.3
2024-09-05 09:29:29 -03:00
Arthur Silva Sens 937ac63d3d
Add changelog entry for 1.20.3
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2024-09-05 09:23:41 -03:00
George Krajcsovits 6e9914db5a
Merge pull request #1608 from krajorama/index-out-of-range-native-histogram-exemplar
bugfix: native histogram: exemplars index out of range
2024-09-04 21:21:43 +02:00
György Krajcsovits d6b8c8925b Update comments with more explanations
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-09-04 21:10:22 +02:00
György Krajcsovits 504566f07c Use simplified solution from #1609 for the data race
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-09-04 21:10:22 +02:00
György Krajcsovits dc8e9a4d8a fix: native histogram: Simplify and fix addExemplar
mdIdx was redundant when len(exemplars)>1, so got rid of it, rIdx
is enough.

Don't compare timestamp of incoming exemplar to timestamp of
minimal distance exemplar. Most of the time the incoming exemplar
will be newer. And if not, the previous code just replaced an
exemplar one index after the minimal distance exemplar. Which had
an index out of range bug, plus is essentially random.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-09-04 21:10:22 +02:00
György Krajcsovits dc819ceb1b Use a trivial solution to #1605
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-09-04 21:10:22 +02:00
György Krajcsovits e061dfae88 native histogram: use exemplars in concurrency test
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-09-04 21:10:22 +02:00
cuisongliu 89f21b2cba
api: Add ability to CloseIdleConnection for one-off httpClient use cases. (#1513)
Signed-off-by: cuisongliu <cuisongliu@qq.com>
2024-09-04 16:00:55 +01:00
Matt Harbison a5e134014f
process_collector: fill in most statistics on macOS (#1600)
* process_collector: fill in most statistics on macOS

Unfortunately, the virtual memory, resident memory, and network stats will
require access to undocumented C functions.  I was warned off of cgo in IRC
because it would then have to be enabled in a bunch of different projects that
use this module, but I already was against it because that would break the
ability to cross-compile.  There is no interface to `dlopen` built into golang.
The `github.com/ebitengine/purego` module looks promising (I can cross-compile
and call these methods), but I'm currently getting unexpected results.  I'll
follow up with that separately if I can get it working, but hopefully this stuff
is pretty uncontroversial.

Tested on macOS 10.14.6 (amd64), macOS 14.6.1 (amd64), and macOS 15.0 (arm64)
by spawning `/usr/bin/ulimit -a -S` and `/usr/sbin/lsof -c $my_process` from
the test exporter process, and `ps -o lstart,vsize,rss,utime,stime,command` from
the shell, and comparing results with the exported metrics.

I can't find documentation for `RLIMIT_AS` on macOS (specifically if it's in
bytes or pages).  It's currently being reported back as `RLIM_INFINITY`, which
seems reasonable, because I've come across reports that the value is ignored
anyway[1].  The bash 3.2 code for the built-in `ulimit` divides the value
reported by `getrusage(2)` by 1024 when printing, as it does for `RLIMIT_DATA`,
which is documented as being bytes in `getrusage(2)`.  The help for `ulimit`
indicates it prints both in kbytes, so it's reasonable to assume this is already
in bytes.

[1] https://issues.chromium.org/issues/40581251#comment3

Signed-off-by: Matt Harbison <mharbison72@gmail.com>

* Update prometheus/process_collector_darwin.go

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Matt Harbison <57785103+mharbison72@users.noreply.github.com>

---------

Signed-off-by: Matt Harbison <mharbison72@gmail.com>
Signed-off-by: Matt Harbison <57785103+mharbison72@users.noreply.github.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
2024-09-04 15:56:01 +01:00
PrometheusBot 97aa0493eb
Update common Prometheus files (#1615)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2024-09-03 10:00:24 +01:00
Bartlomiej Plotka fa4f164b6d
examples: Improved GoCollector example. (#1589)
Signed-off-by: bwplotka <bwplotka@gmail.com>
2024-09-02 16:43:16 +02:00
github-actions[bot] 30da80dfe1
Merge pull request #1614 from prometheus/dependabot/github_actions/github-actions-aadb7c6e64
build(deps): bump github/codeql-action from 3.25.15 to 3.26.6 in the github-actions group across 1 directory
2024-09-02 11:48:22 +00:00
dependabot[bot] fd3057a6e0
build(deps): bump github/codeql-action
Bumps the github-actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.25.15 to 3.26.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](afb54ba388...4dd16135b6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 11:41:39 +00:00
Ben Kochie 2cc3a2f5e8
Update Dagger and build. (#1610)
* Update Dagger and build

* Update dagger actions to use pinnning.
* Add /dagger to dependabot to keep the Dagger modules up-to-date.
* Update dagger default Go version.
* Update tutorials/whatsup Go version.
* Update actions to use pinning.

Signed-off-by: SuperQ <superq@gmail.com>

---------

Signed-off-by: SuperQ <superq@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
2024-09-02 11:40:53 +00:00
Parth Lawania 850b6c0898
changed the name of all variables with min/max name (#1606)
* changed the name of all variables with min/max name

Signed-off-by: Parth Lawania <parthlawania@gmail.com>

* removed predeclared ignore condition for min and max identifiers

Signed-off-by: Parth Lawania <parthlawania@gmail.com>

---------

Signed-off-by: Parth Lawania <parthlawania@gmail.com>
Co-authored-by: Parth Lawania <parth.lawania@super.money>
2024-09-02 07:41:40 -03:00
github-actions[bot] 67683fd07e
Merge pull request #1612 from prometheus/dependabot/go_modules/github.com/prometheus/common-0.57.0
build(deps): bump github.com/prometheus/common from 0.55.0 to 0.57.0
2024-09-01 09:09:58 +00:00
github-actions[bot] 0ac5bf38af
Merge pull request #1611 from prometheus/dependabot/go_modules/golang.org/x/sys-0.24.0
build(deps): bump golang.org/x/sys from 0.22.0 to 0.24.0
2024-09-01 09:09:45 +00:00
dependabot[bot] 25ed766abc
build(deps): bump github.com/prometheus/common from 0.55.0 to 0.57.0
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.55.0 to 0.57.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/RELEASE.md)
- [Commits](https://github.com/prometheus/common/compare/v0.55.0...v0.57.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-01 09:02:44 +00:00
dependabot[bot] 4c369166c3
build(deps): bump golang.org/x/sys from 0.22.0 to 0.24.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.22.0 to 0.24.0.
- [Commits](https://github.com/golang/sys/compare/v0.22.0...v0.24.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-01 09:02:39 +00:00