Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gauge is run() method not showing up in datadog #81

Open
DevOpsJon opened this issue Jul 5, 2017 · 1 comment
Open

Gauge is run() method not showing up in datadog #81

DevOpsJon opened this issue Jul 5, 2017 · 1 comment

Comments

@DevOpsJon
Copy link

DevOpsJon commented Jul 5, 2017

I have a dropwizard app running metrics-datadog 1.1.13. I added a metrics section to my yaml file with a datadog reporter session. My service endpoints are reporting like magic.

What isn't reporting is a gauge I placed in the run() method of my application class.
The gauge looks like

environment.metrics().register(MetricRegistry.name(Application.class, "version"),
                new Gauge<String>() {
                    @Override
                    public String getValue() {
                        return "1.1.1";
                    }
                });

The gauge shows up fine when I curl the /metrics endpoint of the admin servlet.
I'm wondering if perhaps it has to do with the dropwizard lifecycle, or metrics-datadog not being initialized when the gauge is used in the run() method.

The gauge does show up in the console reporter.

@nickdella
Copy link

@DevOpsJon Sorry for the delay in getting back to you. The Gauge you've set up looks correct. The initialization order shouldn't really matter, as the MetricsRegistry is polled on every reporting cycle (defaults to every 10 seconds). That said, I'm not really familiar with the Dropwizard framework, so I may be missing something here.

What transport are you using, by the way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants