This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: go-expvar | |
check_module: go_expvar | |
pattern: | |
comm: go-expvar | |
conf: | |
expvar_url: "http://localhost:8080/debug/vars" # automatically match url using the listening port | |
# Add custom metrics if you want | |
metrics: | |
- path: system.numberOfSeconds | |
type: gauge # gauge or rate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface SystemStatusMBean { | |
Integer getNumberOfSecondsRunning(); | |
String getProgramName(); | |
Long getNumberOfUnixSecondsRunning(); | |
Boolean getSwitchStatus(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SystemStatus implements SystemStatusMBean { | |
private Integer numberOfSecondsRunning; | |
private String programName; | |
private Long numberOfUnixSecondsRunning; | |
private Boolean switchStatus; | |
private Thread backgroundThread; | |
public SystemStatus(String programName) { | |
// First we initialize all the metrics | |
this.backgroundThread = new Thread(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.management.*; | |
import java.lang.management.ManagementFactory; | |
public class Main { | |
public static void main(String[] args) { | |
try { | |
String programName = (args.length == 0) ? "Java" : args[0]; | |
// Initialize the object | |
SystemStatus systemStatus = new SystemStatus(programName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jmx: | |
per_process_beans: | |
systemStatus: | |
pattern: "Main" | |
beans: | |
- query: "com.sysdig.app:name=SystemStatusExample" | |
attributes: | |
- name: NumberOfSecondsRunning | |
alias: java.app.numberOfSecondsRunning | |
- name: NumberOfUnixSecondsRunning |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: DaemonSet | |
metadata: | |
labels: | |
app: metallb | |
component: speaker | |
name: speaker | |
namespace: metallb-system | |
spec: | |
selector: |
OlderNewer