* Add multi-target support
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Update example-prometheus.yml
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Make `es.uri` optional by setting default to empty string check if it's empty and if so, don't parse it
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Update README.md
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Add sanity target scheme validation
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Change yaml package to go.yaml.in/yaml/v3
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Update yaml package to go.yaml.in/yaml/v3
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Update CHANGELOG.md
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Remove whitespaces from README.md
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Add testing for apikey authentication module
Update examples/auth_modules.yml
Fix main.go to apply userpass credentials only if the module type is explicitly set to userpass.
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Add Load-time validation for the auth module config file during startup
Keep light-weight validation for the probe params during runtime
Add AWS SigV4 authentication module support
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Expose error in the logger
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Add TLS config per target support
Add TLS config validation
Update config test to include TLS config
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Indices and Shards collectors now fetch cluster_name once from GET / when no clusterinfo retriever is attached, avoiding the previous "unknown_cluster" label.
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Removed the special-case logic that redirected /metrics?target= requests to /probe.
Updated auth_modules.yml to include AWS SigV4 signing and mTLS support.
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Add license headers to all new files
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Fixes for relative paths in multi-target mode
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Bump github.com/prometheus/client_golang from 1.22.0 to 1.23.0 (#1065)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.22.0...v1.23.0)
---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
dependency-version: 1.23.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Add target schema validation, http/https only
Add tls auth type support in multi-target mode
Update README.md, examples/auth_modules.yml, tests
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Cleanup
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Fix tls auth type validation
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Remove aws.region validation
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Add temp file cleanup in config_test.go
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Add copyright header to config_test.go
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
* Add version metric to the per-probe registry
Update roundtripper.go to use region from config or environment resolver if not provided in config file (AWS_REGION)
Update probe.go to accept module even if region omitted; environment resolver can provide it
Update config.go to use region as optional field
Update main.go to use region from config or environment resolver if not provided in config file (AWS_REGION) and update roundtripper.go to use region from config or environment resolver if not provided in config file (AWS_REGION)
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
---------
Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Yuri Tsuprun <51751791+pincher95@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This brings the common files in line with other prometheus repos. Most of these settings are coppied from prometheus/prometheus. Where it was a small change, I have enabled the new linte
rs and made the fixes. The remaining linters that are commented out deserve to be enabled and the fixes applied as independent changes.
Signed-off-by: Joe Adams <github@joeadams.io>
The bulk of this change set was automated by the following script which
is being used to aid in converting the various exporters/projects to use
slog:
https://gist.github.com/tjhop/49f96fb7ebbe55b12deee0b0312d8434
In addition to the parts that were straightforward conversions, this
also:
- refactors much of the logging config to adopt slog
- removed custom `logger.go` setup for go-kit
- adopt promslog/flag and use that to handle parsing log
level/format flags
- for consistent behavior, keep log output flag to allow toggle
stdout/stderr for output
- adopt promslog for logger setup
- enables sloglint in golangci-lint config
- drops go-kit/log exclusions from lint config
- tidies mods to drop go-kit/log and go-logfmt/logfmt deps
Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
* ci: update deprecated golangci-lint config
Fixes:
```
WARN [config_reader] The configuration option `linters.errcheck.exclude` is deprecated, please use `linters.errcheck.exclude-functions`.
```
Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
---------
Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
* collector: add tasks API collection
This commit adds simple aggregation of Elasticsearch Tasks API.
There are 4 new metrics; though 3 are just bookkeeping.
elasticsearch_task_stats_action_total is a gague reporting the total
number of tasks running for a given action. Because there are no stats
endpoints available for this, this change introduces an aggregation step
to group the number of tasks by action name.
This metric is useful for ensuring long running actions of a specific
kind stay within a specific limit. Of particular use to me is
the action: 'indices:data/write/delete/byquery'.
In my usecase, our ES access patterns mean we have a predefined limit
of these actions running on the cluster.
This change also adds two new CLI flags to manage the collection of tasks API:
--es.tasks (to enable task collection)
--es.tasks.actions (to filter tasks by action param)
Issue #525 proposed addition of collection of these tasks.
Signed-off-by: Aaron Delaney <apd@arista.com>
* collector: use collector interface for tasks
Signed-off-by: Aaron Delaney <apd@arista.com>
* all: fix issues reported by golangci-lint
Signed-off-by: Aaron Delaney <apd@arista.com>
* collector: make task structs private to package
Signed-off-by: Aaron Delaney <apd@arista.com>
* Fix task stats metric name
Signed-off-by: Aaron Delaney <apd@arista.com>
* Fix tasks test
Signed-off-by: Aaron Delaney <apd@arista.com>
---------
Signed-off-by: Aaron Delaney <apd@arista.com>
In the Prometheus ecosystem, info metrics (those with the `_info`
suffix) usually have a value of 1. Although not enforced, this has
become a standard pattern across Prometheus and several exporters (see
`prometheus_build_info`).
Signed-off-by: Jorge Luis Betancourt Gonzalez <jorge-luis.betancourt@trivago.com>
Co-authored-by: Christoph Burmeister <christoph.burmeister@idealo.de>
Signed-off-by: Steve Teuber <steve.teuber@idealo.de>
Signed-off-by: Steve Teuber <steve.teuber@idealo.de>
Co-authored-by: Christoph Burmeister <christoph.burmeister@idealo.de>
Fix a race condition in pkg/clusterinfo mockConsumer by protecting the data with a mutex. This resolves the issue where `make` fails to complete the build and tests.
Signed-off-by: Joe Adams <github@joeadams.io>