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

implement an agent in go to export metrics from the API directly #7

Open
suyash opened this issue Jul 12, 2016 · 4 comments
Open

implement an agent in go to export metrics from the API directly #7

suyash opened this issue Jul 12, 2016 · 4 comments

Comments

@suyash
Copy link
Collaborator

suyash commented Jul 12, 2016

similar to parfait-agent

@saurvs
Copy link
Contributor

saurvs commented Mar 8, 2017

I'm guessing this need cgo bindings to libpcp_pmda so we can build a daemon PMDA in Go?

@suyash
Copy link
Collaborator Author

suyash commented Mar 8, 2017

No, actually parfait-agent (in the java project) is a standalone Java application that on launch with an application automatically starts exporting important stuff about the application. @natoscott would have more knowledge since he maintains the project. From what I remember correctly it makes use of the JVM instrumentation API and the premain functionality. https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html

@natoscott
Copy link
Member

@suyash @saurvs there's two modes of operation for the Java parfait-agent:

  1. Running as a -javaagent jar (i.e. running directly inside the instrumented application)
  2. "Proxy" mode, where parfait-agent runs as a separate process to the instrumented application, and communicates to the application using JMX protocol.

Both modes use parfait-core, and parfait/dxm to generate MMV format. It is all pure Java code - no native bindings or anything like that.

@saurvs
Copy link
Contributor

saurvs commented Mar 12, 2017

@natoscott Thanks for the clarification.

There is apparently no equivalent of -javaagent for Go, so we can't profile an unmodified Go binary. We could instead implement a PCPInstanceMetric like I mentioned in #42, which updates runtime metrics periodically, and which the user can start or stop anywhere in their code.

There's also https://github.com/davecheney/gmx, which is similar to Java's jmx. When it's imported into a Go program, the package automatically opens a UNIX socket that we can query for runtime metrics from a different process and write them to an MMV file.

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

No branches or pull requests

3 participants