eiiches / scriptable-jmx-exporter Goto Github PK
View Code? Open in Web Editor NEWA javaagent for scraping and exposing MBeans to Prometheus
License: MIT License
A javaagent for scraping and exposing MBeans to Prometheus
License: MIT License
E.g. jmx("java.lang:type=OperatingSystem"; "Version"}
.
I'd like to use this value in metric labels.
Related: #1
These would be useful to detect and diagnose problems of the exporter and its configuration.
An option to directly send samples to Prometheus remote endpoint might be useful for short-lived processes, etc.
https://github.com/prometheus/prometheus/blob/main/prompb/remote.proto
Some MBeans such as GarbageCollectorMXBean implements NotificationEmitter. If we can listen to the notifications, we might be able to compute and expose more useful metrics such as 99th percentile of GC duration not just LastGCInfo.duration.
I believe we can also support JFR Event Streaming in a similar manner.
While OpenMetrics is still in the early stage, Prometheus (>=2.5) already accepts application/openmetrics-text
.
GET /metrics HTTP/1.1
Host: foo.example.com:18090
User-Agent: Prometheus/2.19.2
Accept: application/openmetrics-text; version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1
Accept-Encoding: gzip
X-Prometheus-Scrape-Timeout-Seconds: 10.000000
I get this message in the logs:
WARNING: Got unsupported type "java.lang.Number" while processing <redacted>.
Even though java.lang.Number is not an open MBean data type ( https://docs.oracle.com/cd/E19206-01/816-4178/6madjde4v/index.html ), I don't think of any reason not to support it.
Cassandra exposes these attributes which are java.util.Set.
org.apache.cassandra.db:type=DisallowedDirectories:UnreadableDirectories
org.apache.cassandra.db:type=DisallowedDirectories:UnwritableDirectories
While these attributes can be handled by a transform script, it's probably worth supporting them natively.
More and more libraries don't support Java 8 anymore.
Apache Solr exposes these java.util.Date attributes.
solr:dom1=core,dom2=demo,category=SEARCHER,scope=searcher,name=registeredAt:Value
solr:dom1=core,dom2=demo,category=SEARCHER,scope=searcher,name=openedAt:Value
solr:dom1=core,dom2=demo,category=CORE,name=startTime:Value
It's easy to handle these in a transform script, but it may be worth supporting java.util.Date natively.
Tbh, I still can't come up with good use cases, but I kinda feel we will need this feature at some point.
We need a way to override .server.bind_address
externally to a configuration file. For example, if you have an exporter configuration file baked in docker image, it's hard to override the port number, etc. on runtime. Usually, there's no need to change the port number because each Pod gets its own IP address, however, if you want to run multiple containers on the Pod, they need different port numbers to avoid conflict.
One obvious way to solve this problem is to allow users to override configuration entries by multiple configuration files or JSONs.
-javaagent:[email protected],{"server":{"bind_address":"localhost:19639"}},...
-javaagent:[email protected],@override.yaml,...
We need to come up with a (ideally generic) strategy to merge multiple configuration trees.
Thanks in advance for entertaining my request.
For exposing metrics from puppetserver, all searches were pointing towards JMX Exporter. I tried it out, (naively in my production puppetserver) and ended up with /metrics
endpoint going silent after a few minutes of successfully returning metrics.
Since existing grafana dashboards are available for those metrics, would you be able to guide me to translate JMX exporter rules to scriptable JMX exporter (here is an example)?
Cheers.
V1
APIs changed from :
to more conventional _
.V1.snakeCase()
changed to keep :
instead of escaping it to _
.V1.snakeCase()
now converts FooSSL
โ foo_ssl
, not foo_s_s_l
.java
.V1.transform(in, out, "type")
.The following command never ends:
java -javaagent:target/scriptable-jmx-exporter-1.0.0-SNAPSHOT.jar
Undertow threads should be setDaemon(true).
Scraper#mbeanInfoCache is not properly configured to expire stale cache entries for unregistered MBeans. This can cause heap OOM in some environments where new MBeans are added/removed constantly.
It might be useful as long as it doesn't cause too much load on Prometheus.
# TODO: come up with a better API
declarations:
public static final V1.Config config = V1.config()
.stringAsInfoMetrics(true)
.snakeCase();
rules:
- transform: |
V1.transform(..., config);
I have attached the error text in file:
Error_text.txt
I have following jdk version:
eip@fcyeip3297:/home/eip/logs/out-> java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7)
OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode)
my test.yaml has following: -
as defined in docs section:
https://github.com/eiiches/scriptable-jmx-exporter#example-exposing-versions-as-info-style-metrics-advanced
test .yaml.txt
Thanks,
Rakesh
Obviously, rules after match-all rule is never executed. We should detect this and raise an error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.