Coder Social home page Coder Social logo

ansible-systemd-exporter's Introduction

systemd logo

Ansible Role: systemd exporter

CircleCI License Ansible Role GitHub tag

Description

Deploy prometheus systemd exporter using ansible.

Requirements

  • Ansible >= 2.7 (It might work on previous versions, but we cannot guarantee it)
  • gnu-tar on Mac deployer host (brew install gnu-tar)

Role Variables

All variables which can be overridden are stored in defaults/main.yml file as well as in table below.

Name Default Value Description
systemd_exporter_version 0.4.0 SystemD exporter package version. Also accepts latest as parameter.
systemd_exporter_binary_local_dir "" Allows to use local packages instead of ones distributed on github. As parameter it takes a directory where systemd_exporter binary is stored on host on which ansible is ran. This overrides systemd_exporter_version parameter
systemd_exporter_web_listen_address "0.0.0.0:9558" Address on which systemd exporter will listen
systemd_exporter_enable_restart_count false Enables service restart count metrics. This feature only works with systemd 235 and above
systemd_exporter_enable_ip_accounting false Enables service ip accounting metrics. This feature only works with systemd 235 and above
systemd_exporter_enable_file_descriptor_size false Enables file descriptor size metrics. This feature will cause exporter to run as root as it needs access to /proc/X/fd
systemd_exporter_unit_allowlist "" Include some systemd units. Expects a regex. More in https://github.com/povilasv/systemd_exporter#configuration
systemd_exporter_unit_denylist "" Exclude some systemd units. Expects a regex. More in https://github.com/povilasv/systemd_exporter#configuration

Example

Playbook

Use it in a playbook as follows:

- hosts: all
  roles:
    - cloudalchemy.systemd_exporter

Local Testing

The preferred way of locally testing the role is to use Docker and molecule (v3.x). You will have to install Docker on your system. See "Get started" for a Docker package suitable to for your system. Running your tests is as simple as executing molecule test.

Continuous Intergation

Combining molecule and circle CI allows us to test how new PRs will behave when used with multiple ansible versions and multiple operating systems. This also allows use to create test scenarios for different role configurations. As a result we have a quite large test matrix which can take more time than local testing, so please be patient.

Contributing

See contributor guideline.

Troubleshooting

See troubleshooting.

License

This project is licensed under MIT License. See LICENSE for more details.

ansible-systemd-exporter's People

Contributors

cloudalchemybot avatar paulfantom avatar superq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ansible-systemd-exporter's Issues

Update flag syntax passed to the exporter

What happened?
edit the long arguments to the command in the systemd unit file; they need to be prefixed by systemd. for systemd_exporter version 0.5.0, which uses this different syntax. Also this issue template should probably have a field for the systemd_exporter version being used.

output from help from the exporter:

--systemd.collector.enable-restart-count  
                                Enables service restart count metrics. This feature only works with systemd 235 and above.
      --systemd.collector.enable-file-descriptor-size  
                                Enables file descriptor size metrics. Systemd Exporter needs access to /proc/X/fd for this to work.
      --systemd.collector.enable-ip-accounting  
                                Enables service ip accounting metrics. This feature only works with systemd 235 and above.

Did you expect to see some different?

How to reproduce it (as minimally and precisely as possible):

Environment

  • Role version:

    1.0.0

  • Ansible version information:

ansible [core 2.14.1]
 config file = /home/bryant/src/api_guys/ansible-deploy-vst/config/machines/localhost_owsus_aws.ansible.cfg
 configured module search path = ['/home/bryant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
 ansible python module location = /home/bryant/.pyenv/versions/3.10.0/envs/ansible-deploy-vst/lib/python3.10/site-packages/ansible
 ansible collection location = /home/bryant/.ansible/collections:/usr/share/ansible/collections
 executable location = /home/bryant/.pyenv/versions/ansible-deploy-vst/bin/ansible
 python version = 3.10.0 (default, Nov  2 2021, 13:53:11) [GCC 9.3.0] (/home/bryant/.pyenv/versions/3.10.0/envs/ansible-deploy-vst/bin/python3.10)
 jinja version = 3.1.2
 libyaml = False
  • Variables:
insert role variables relevant to the issue
  • Ansible playbook execution Logs:
insert Ansible logs relevant to the issue here

Anything else we need to know?:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.