Git Product home page Git Product logo

puppet-promtail's Introduction

Promtail

Build Status License

Deploy and configure Grafana's Promtail on a node.

Description

Promtail is an agent which ships the contents of local logs to a private Loki instance or Grafana Cloud. It is usually deployed to every machine that has applications needed to be monitored.

It primarily:

  1. Discovers targets
  2. Attaches labels to log streams
  3. Pushes them to the Loki instance.

Currently, Promtail can tail logs from two sources: local log files and the systemd journal (on AMD64 machines only).

Usage

The simplest way to get started with this module is to add include promtail to a manifest and create your config settings in Hiera. Additional details and examples are contained in REFERENCE.md.

Reference

This module is documented via pdk bundle exec puppet strings generate --format markdown. Please see REFERENCE.md for more info.

Changelog

CHANGELOG.md is generated prior to each release via pdk bundle exec rake changelog. This process relies on labels that are applied to each pull request.

Limitations

At the moment, this module only supports Linux. Future versions will support additional OS's including Windows.

Development

Pull requests are welcome! A Vagrantfile is also included in this repository that can be used during development.

Module Release

Follow the steps below to tag a new release and push to The Forge using GitHub Actions.

  1. Ensure that all closed PRs are labeled appropriately.
  2. Create a "Release Prep" PR with the label "maintenance" containing changes made by the following:
    1. Bump the module version (X.Y.Z) in metadata.json as appropriate based on closed PRs since the previous release. (i.e. "backwards-incomptible" is an X "release", "feature" is a Y release, and "bugfix" is a Z release)
    2. Run pdk bundle exec puppet strings generate --format markdown. Any missing documentation will result in a failed pipeline.
    3. Run pdk bundle exec rake changelog. Any unlabeled PRs will result in a failed pipeline.
  3. Once the PR is merged, navigate to Actions --> Publish Module --> Run workflow --> select the main branch, and Run workflow.

puppet-promtail's People

Contributors

attachmentgenie avatar bastelfreak avatar dmaes avatar genebean avatar heathseals avatar kubicgruenfeld avatar ldaneliukas avatar saz avatar yachub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-promtail's Issues

bin_dir is not set properly in Unit file

Seems like there is an inconsistency.

  1. bin_dir parametr creates symlink in given path
  2. But service unit file always uses /usr/local/bin/promtail

This leads to failed service for any other value of bin_dir, than /usr/local/bin

Parameter 'password_file_content' expects a value of type Undef or Sensitive, got String

Hello, I can't figure out how to get the password_file_content to work properly.

Puppet master server version 5.1. (Dockerized)
puppet promtail version: 0.31

lookup_options:
  promtail::password_file_content:
      convert_to: "Sensitive"

promtail::password_file_path: '/etc/promtail/.gc_pw'
promtail::password_file_content: ENC[PKCS7,...]

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Class[Promtail]: parameter 'password_file_content' expects a value of type Undef or Sensitive, got String at /etc/puppetlabs/code/environments/development/site.pp:1:1 on node (...)
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Using eyaml edit common.eyaml file The output shows as follows:

promtail::password_file_path: '/etc/promtail/.gc_pw'
promtail::password_file_content: DEC(3)::PKCS7[....]!

Just creating a file with the password, the config works, but ideally I want this to work.

The puppet lookup promtail::password_file_content --explain command also sees the password in clear text.

Windows (amd64) Support

Currently, I have my own implementation for Promtail-Windows (amd64) support. But I would appreciate it if the installation and management could be provided by this module.

I actually can offer to partly implement it. Please let us discuss how it should be implemented. In specific I am unclear on where to store the config + installation and how to manage the service (I am using NSSM).

Wrong Example

Hello,

According to the REFERENCE.md the prameter config_hash exists.
According to class promtail this parameter does not exist.
I guess the REFERENCE is outdated.

The parameter is mentioned in two places:

config_hash => $config_hash,

##### `config_hash`

Error Log using mod 'grafana-promtail', '1.0.0'

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Class[Promtail]:
  has no parameter named 'config_hash'
  expects a value for parameter 'clients_config_hash'
  expects a value for parameter 'positions_config_hash'
  expects a value for parameter 'scrape_configs_hash' 
  ...

Greetings

Validate generated configuration before deployment

Since writing nested hash and arrays syntax in puppet is pita and error prone it'd be nice if we could validate the generated promtail config somehow.

since loki 2.7.0 (grafana/loki@0e54477) promtail supports the -check-syntax parameter. so depending the on the promtail version this might be a conditional feature?

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.