Comments (14)
We're going to need a lot more information to know what's going on here. Can you share the code of the mBean in question?
from jmx_exporter.
I'm trying to scrape metrics from cassandra, I tried to catch some specific metric and I saw it's not expose via jmx exporter. Enabled the logging feature for jmx exporter and this error appears for the metric.
SCHEMA:12:291a4f2c-bc7f-34c1-9eb1-1c0952c3df82
DC:50:*****
RACK:30:R1
RELEASE_VERSION:4:2.1.15.1403
RPC_ADDRESS:3: **********
X_11_PADDING:2166926:{"workload":"Cassandra","active":"true","health":1.0}
SEVERITY:2166924:0.0833333358168602
NET_VERSION:1:8
HOST_ID:2:25ebafe4-1a92-4537-912b-0d21a6f18505
TOKENS:17:<hidden>
Apr 26, 2017 7:36:32 AM io.prometheus.jmx.JmxScraper logScrape
FINE: scrape: 'org.apache.cassandra.net:type=FailureDetector'_'SimpleStates': process
Apr 26, 2017 7:36:32 AM io.prometheus.jmx.JmxScraper logScrape
FINE: scrape: 'org.apache.cassandra.net{type=FailureDetector}': java.util.Map is not exported
from jmx_exporter.
Apparently you skip Map objects :\
private void processBeanValue(
String domain,
LinkedHashMap<String, String> beanProperties,
LinkedList<String> attrKeys,
String attrName,
String attrType,
String attrDescription,
Object value) {
if (value == null) {
logScrape(domain + beanProperties + attrName, "null");
} else if (value instanceof Number || value instanceof String || value instanceof Boolean) {
logScrape(domain + beanProperties + attrName, value.toString());
this.receiver.recordBean(
domain,
beanProperties,
attrKeys,
attrName,
attrType,
attrDescription,
value);
} else if (value instanceof CompositeData) {
logScrape(domain + beanProperties + attrName, "compositedata");
CompositeData composite = (CompositeData) value;
CompositeType type = composite.getCompositeType();
attrKeys = new LinkedList<String>(attrKeys);
attrKeys.add(attrName);
for(String key : type.keySet()) {
String typ = type.getType(key).getTypeName();
Object valu = composite.get(key);
processBeanValue(
domain,
beanProperties,
attrKeys,
key,
typ,
type.getDescription(),
valu);
}
} else if (value instanceof TabularData) {
// I don't pretend to have a good understanding of TabularData.
// The real world usage doesn't appear to match how they were
// meant to be used according to the docs. I've only seen them
// used as 'key' 'value' pairs even when 'value' is itself a
// CompositeData of multiple values.
logScrape(domain + beanProperties + attrName, "tabulardata");
TabularData tds = (TabularData) value;
TabularType tt = tds.getTabularType();
List<String> rowKeys = tt.getIndexNames();
LinkedHashMap<String, String> l2s = new LinkedHashMap<String, String>(beanProperties);
CompositeType type = tt.getRowType();
Set<String> valueKeys = new TreeSet<String>(type.keySet());
valueKeys.removeAll(rowKeys);
LinkedList<String> extendedAttrKeys = new LinkedList<String>(attrKeys);
extendedAttrKeys.add(attrName);
for (Object valu : tds.values()) {
if (valu instanceof CompositeData) {
CompositeData composite = (CompositeData) valu;
for (String idx : rowKeys) {
l2s.put(idx, composite.get(idx).toString());
}
for(String valueIdx : valueKeys) {
LinkedList<String> attrNames = extendedAttrKeys;
String typ = type.getType(valueIdx).getTypeName();
String name = valueIdx;
if (valueIdx.toLowerCase().equals("value")) {
// Skip appending 'value' to the name
attrNames = attrKeys;
name = attrName;
}
processBeanValue(
domain,
l2s,
attrNames,
name,
typ,
type.getDescription(),
composite.get(valueIdx));
}
} else {
logScrape(domain, "not a correct tabulardata format");
}
}
} else if (value.getClass().isArray()) {
logScrape(domain, "arrays are unsupported");
} else {
logScrape(domain + beanProperties, attrType + " is not exported");
}
}
from jmx_exporter.
JMX is nowhere near standard and we haven't seen one of these before. Can you share the code of the mBean in question?
from jmx_exporter.
I dont have source code for the cassandra mbeans.
What about Map objects ? its should be exposed by jmx exporter?
from jmx_exporter.
They're not currently supported.
from jmx_exporter.
I'm willing to add support for this one.
Some suggestions/notes about how-to develop for this repository?
from jmx_exporter.
First we need to know what a mBean like this looks like, both in Cassandra and anywhere else one is used.
from jmx_exporter.
I guess this comes from https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/net/MessagingServiceMBean.java
from jmx_exporter.
Just realized prometheous is not meant for exposing arbitrary strings.
its all about integers/double/float
So I will probably fallback to jmxterm and eventually use some meaningful metric.
from jmx_exporter.
Okay. Note that we do support extracting strings via the jmx exporter, it's meant for things like version numbers.
from jmx_exporter.
hit the same issue within a custom java service returning java.util.Map
from MBean
@brian-brazil Would you consider a PR similar to #348 for adding support to it?
from jmx_exporter.
Also met this problem~
SpringBoot also export some map to jmxBean
from jmx_exporter.
org.springframework.boot.actuate.endpoint.jmx.DataEndpointMBean
from jmx_exporter.
Related Issues (20)
- the problem of getting data from multiple replicas under Kubernetes deployment controller and how to distinguish replica labels based on podname HOT 2
- JMX exporter high memory usage. HOT 3
- have any metric about jvm GC Pause? HOT 3
- Proposal: attributes as metrics & extra metrics HOT 7
- Can't add metrics to blacklistObjectNames HOT 6
- Plan for release with Prometheus Client 1.x? HOT 2
- no main manifest attribute, in jmx_prometheus_javaagent-0.19.0.jar HOT 1
- Hazelcast Metrics are not showing HOT 2
- Remote jmx has enabled SSL. How to configure jmx-exporter for verification? HOT 13
- Ability to use lowercaseOutputName in particular rules HOT 4
- jmx exporter inside Confluent Kafka broker container HOT 2
- After applying JMX filtering pattern, it takes 23 secs to scrape the metrics, is it expected behaviour? HOT 6
- Collection fails for Kafka using release 1.0.0 HOT 14
- feature request: allow to exclude specific attribute patterns inside a composite attribute HOT 3
- Clarify in documentation "jvm_*" metrics HOT 4
- jmxexporter adding incorrect _total suffix to #HELP and #TYPE when using COUNTER HOT 10
- Kafka Metrics showing type as "Untyped" HOT 3
- Advice for validating JMX exporter rules HOT 1
- Support multi-target in http server mode HOT 6
- JMX agent interfering with logging format of application HOT 3
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 jmx_exporter.