Skip to main content
Gå til innhold

Getting Started - Puppet-managed VMs

If your application runs on virtual machines managed by Puppet, you can use the pmodule_vector module to ship logs to our logging backend.

Request Access

Contact the Platon team on #platon (Slack) with:

  1. Tenant name: A name for your team or product
  2. EntraID group: The Microsoft Entra ID group that should have access

We will:

  • Create your tenant and store credentials in Vault
  • Set up your Grafana organization and data sources

Configure Puppet

Start by making sure the pmodule_vector module is configured by the node(s) you're trying to configure.
If pmodule_vector is already included and configured, you can skip this step. You must make sure that the pmodule_vector is included, and make sure these parameters are set in hiera:

  • pmodule_vector::loki_credentials_vault_path: must be set to a Vault path containing the Loki credentials, that is accessible by the node (this requires pmodule_vault to be bootstrapped with a token on the node)
  • pmodule_vector::tenant_id: must be set to a default tenant ID for the node

Then add the pmodule_vector::file resource to your Puppet configuration:

pmodule_vector::file { 'myapp':
paths => ['/var/log/myapp/*.log'],
tenant_id => 'your-tenant-name',
}

Parameters

ParameterDescription
pathsArray of log file paths (supports wildcards)
tenant_idYour tenant name (provided by Platon)
parse_as_jsonSet to true if your logs are JSON formatted (optional)

Multiple Log Sources

You can define multiple log sources:

pmodule_vector::file { 'myapp':
paths => ['/var/log/myapp/*.log'],
tenant_id => 'my-team',
}

pmodule_vector::file { 'nginx':
paths => ['/var/log/nginx/access.log', '/var/log/nginx/error.log'],
tenant_id => 'my-team',
}

What the Module Does

The pmodule_vector module:

  1. Installs Vector on your VM
  2. Configures Vector to read from the specified log files
  3. Retrieves credentials from Vault
  4. Ships logs to Loki with the correct tenant header

You don't need to manage authentication - the module handles it.

View Your Logs

After Puppet applies the configuration:

  1. Go to grafana.platon.sikt.no
  2. Log in with Feide
  3. Select your organization
  4. Go to Explore and select your Loki data source

Next Steps