Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
prometheus_exporter_hcloud_sd
Advanced tools
prometheus_exporter_hcloud_sd is a CLI tool that discovers Prometheus exporters in your Hetzner Cloud project and generates a Prometeus file-based service discovery YAML configuration for them.
This tool is particularly useful when running multiple Prometheus exporters in a Hetzner Cloud environment and you want to automate the discovery and configuration process.
prometheus_exporter_hcloud_sd
utilizes the Hetzner Cloud API for exporter discovery. Therefore, it should be executed within the same network as the servers (it discovers exporters using the servers' private IP).
By default, the tool will discover the following exporters:
You can specify additional exporters to discover with the --exporter
flag, followed by the service name and port, formatted as: <service_name>=<port>
.
Install the gem with:
gem install prometheus_exporter_hcloud_sd
If you use bundler to manage dependencies, install the gem by executing:
bundle add prometheus_exporter_hcloud_sd
Before using prometheus_exporter_hcloud_sd
, ensure the HCLOUD_READ_TOKEN
environment variable is set with a Hetzner Cloud API token that has read permissions.
export HCLOUD_READ_TOKEN=your-read-token
Run the following command to discover exporters:
prometheus_exporter_hcloud_sd discover
The following is an example of a generated YAML configuration:
- targets: ["10.15.1.1:9104"]
labels:
job: "mysql"
- targets: ["10.15.1.2:9121","10.15.1.3:9121"]
labels:
job: "redis"
This YAML configuration can be used to set up the a file-based service discovery in Prometheus. For example, you can create a file called hcloud_sd.yml
with the above content and then configure Prometheus to use it:
scrape_configs:
- job_name: 'node'
file_sd_configs:
- files:
- 'hcloud_sd.yml'
To discover additional exporters, use the --exporter flag (can be used multiple times):
prometheus_exporter_hcloud_sd discover --exporter traefik=80
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/dunkelbraun/prometheus_exporter_hcloud_sd.
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the PrometheusExporterHcloudSd project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that prometheus_exporter_hcloud_sd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.