Code Monkey home page Code Monkey logo

Comments (7)

rwallinterset avatar rwallinterset commented on June 12, 2024

Ok so I confirmed that was the issue. I created a new thread class and if I spin a thread with a sleep in it which then executes the ParfaitAgent premain method all works fine.

from parfait.

tallpsmith avatar tallpsmith commented on June 12, 2024

@natoscott will have to comment directly here on the current state, but I believe right now parfait-agent will only export some known JVM metrics, there's not yet a mechanism to export custom (application-specific) metrics as yet (though that is definitely the plan).

Part of the Parfait lifecycle requires a 'quiet' period for new metrics to appear - it waits up to 5 seconds after the last detected metric has been registered before (re)starting the export. This prevents a large application starting up, registering a lot from tripping a blitz of registrations to PCP. Once the application has quieted down, Parfait will begin exporting to PCP.

Eventually your own JMX/custom metrics will be registered by a mechanism like an XML config.

You might also want to look at the Parfait-DropWizard integration (part of this module). If you are using DropWizard metrics in the application, it's pretty easy to have these exported to PCP.

from parfait.

natoscott avatar natoscott commented on June 12, 2024

@tallpsmith that's correct - addition of user-defined metrics, as described, is WIP (as is exposing the Parfait delayed initialization concept). With the earlier reference to proxy.xml, that's just a placeholder at this stage - also WIP.

from parfait.

natoscott avatar natoscott commented on June 12, 2024

Just a bit more followup here - parfait-agent has always used the DynamicMonitoringView Parfait class, which performs the delayed-initialisation-if-needed @tallpsmith referred to above (re 'quiet' period). I've just added some code to allow the application startup time to be set to something different to the default 5 seconds if need be. I'll be looking into the proxying mode shortly too.

from parfait.

myllynen avatar myllynen commented on June 12, 2024

The above startup delay time solves the issue of application MBeans not being available when Parfait is starting or if the application is somewhat deterministically slow to create them when starting up.

The problem with a simple delay based approach is that applications may do lazy or on-demand initialization, i.e., MBeans are created later during the application lifecycle (for example, due to an external configuration management event or a dynamically attached tracing tool making new MBeans available, both approaches are used to avoid the need for restarting applications in production). In cases like this all metrics should be collected if available and without Parfait forcing to restart the application if the application itself (or possible troubleshooting tools) support MBean (metrics) creation on demand basis.

So, ideally, there would be a configuration option to ask Parfait to continue with those metrics available in the beginning and then periodically or via an event to check whether the other configured metrics have appeared.

from parfait.

tallpsmith avatar tallpsmith commented on June 12, 2024

This isn't just a simple Delay, it's a period of which any new metric added, at any time will wait up to 5 seconds before the DynamicMonitoringView re-configures & re-writes out the new MMV values.

What it seems might be needed (without looking at the current state) is an MBeanListener that is detecting MBeans being added/removed and wrapping with PCP metrics (if matched).

I don't think it's the MonitoringView that's the issue here, but the MBean detections.

from parfait.

myllynen avatar myllynen commented on June 12, 2024

If you think delay is wrong term here, please fix parfait(1) man page accordingly which uses delay as well.

from parfait.

Related Issues (20)

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.