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

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

Comments

Projects
None yet
3 participants
Collaborator

suyash commented Jul 12, 2016

similar to parfait-agent

Contributor

saurvs commented Mar 8, 2017 edited

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

Collaborator

suyash commented Mar 8, 2017 edited

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

Contributor

natoscott commented Mar 8, 2017

@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.

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