Comments (7)
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.
@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.
@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.
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.
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.
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.
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)
- parfait agent stuck in busy loop after Java app restarts
- Support for missing data types - arrays
- Support for missing data types - TabularData
- Add all supported JVM JMX metrics to default JSON file
- Support for missing data types - non-primitive numbers HOT 1
- Incorrect units for metrics
- parfait --name not working
- Metrics with default jvm.json not working HOT 6
- Update counters to LongAdder as appropriate
- Attach API support
- Fix default configuration for recent Java versions HOT 4
- unable to delete metrics HOT 3
- Upgrade to JSR 385 HOT 2
- Upgrade Dependencies - 2020
- Ensure Parfait builds against latest PCP versions HOT 1
- Upgrade Parfait to support log4j2 HOT 1
- Streamline Log4j and SLF4J or replace SLF4J with Log4J2 HOT 3
- Support Micrometer HOT 2
- Parfait appears to leak TimerTasks
- Parfait does not work with Tomcat, Cassandra HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parfait.