Git Product home page Git Product logo

ansible-grafana-agent's Introduction

Ansible Role: Grafana Cloud Agent

Ansible Lint

Installs Grafana Cloud Agent on RedHat/CentOS or Debian/Ubuntu servers to collect observability data and sends it to Grafana Cloud.

This role installs and configures the latest version of Grafana Cloud Agent from GitHub releases. It also creates a Supervisor process.

It optionally installs Promtail, which is an agent which ships the contents of local logs to Grafana Cloud (Loki).

Requirements

None. Other than an account on Grafana Cloud -> Create account.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml). You can get the values for your enviroment from the Grafana Cloud Portal.

Required

prometheus_user: <username>

Each service in Grafana Cloud has a unique service id or user. Once in the Grafana Cloud Portal click on Prometheus to get the value you need to provide for prometheus_user.

grafana_api_key: <key>

You can generate a new API Key in the API Keys section of the Grafana Cloud Portal. The role has to be MetricsPublisher.

metric_label: <label>

target_host: <host>

target_port: <port>

Above variables define scraping targets and labels for your endpoints. Endpoint name is /metrics by default.

Defaults

agent_version: latest

You can change the default version of the agent by specifying the agent_version variable. If not defined, will fallback to the latest Grafana Agent install. Change it to eg. "v0.18.1".

agent_location: /usr/local/bin

Location where the Grafana Cloud Agent's binary will be installed. The default location (/usr/local/bin) is preferred in systems where SELinux is enabled.

config_location: /etc/grafana

Location where the Grafana Cloud Agent's config will be stored. The default location (/etc/grafana) is preferred in systems where SELinux is enabled.

By default, this role will ensure Grafana Cloud Agent is running and enabled at boot.

loki_user: <username>

Each service in Grafana Cloud has a unique service id or user. Once in the Grafana Cloud Portal click on Loki to get the value you need to provide for loki_user. If this value is present, this role will install the Promtail agent and create a Supervisor process for it. It will scrape messages from /var/log and journald. For reference, see Journal Scraping.

Dependencies

None.

License

GPL-3.0 License

Author Information

This role was created in 2021 by Nicolas Leiva.

In this fork we modified the role to be compatible for setting up the agent in containers.

ansible-grafana-agent's People

Contributors

agnesk92 avatar nleiva avatar

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.