Skip to content

Handle 404's for PuppetDB metrics #74

@jarretlavallee

Description

@jarretlavallee

Describe the Bug

There are three counters that do not exist until there is an error. This causes 3 errors in each PuppetDB request unless there is an error in PuppetDB that creates the counter exists.

Expected Behavior

There should only be errors in the output when there is something wrong. These errors show up every time, which skews the error counters. The 404's should be properly handled for the counters so they are not included in the metrics.

Steps to Reproduce

Classify a 2019.8.0 master with the class and notice the errors below.

                "error": [
                    "HTTP Error 404 for puppetlabs.puppetdb.mq:name=global.generate-retry-message-time",
                    "HTTP Error 404 for puppetlabs.puppetdb.mq:name=global.retry-persistence-time",
                    "HTTP Error 404 for puppetlabs.puppetdb.ha:name=failed-request-counter"
                ],
                "error_count": 3,

Environment

6.1.1 with 2019.8.4

https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/blob/master/manifests/service/puppetdb.pp#L31-L35
https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/blob/master/manifests/service/puppetdb.pp#L51-L55
https://github.com/puppetlabs/puppetlabs-puppet_metrics_collector/blob/master/manifests/service/puppetdb.pp#L290-L294

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions