Skip to content

DropwizardExports throws NPE if gauge's value is null #301

@DmitryLipiev

Description

@DmitryLipiev

What did you do?

Tried to export Dropwizard metrics

What did you expect to see?

A list of Prometheus metrics in my browser

What did you see instead? Under which circumstances?

Internal server error. Some of our gauge metrics are initialized to null, when DropwizardExports comes across them it throws NPE at line 54:
LOGGER.log(Level.FINE, String.format("Invalid type for Gauge %s: %s", name, obj.getClass().getName()));

Environment

Ubuntu 16.04, Java8

  • System information:

Linux 4.4.0-96-generic x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions