Comments (2)
@EconomicTouristsArmLate I believe I understand what you are trying to accomplish, but don't fully follow the use case.
The MBean should be providing a label. Is there a reason that a lack of a label (i.e. empty string) can't be handled downstream?
from jmx_exporter.
The problem I'm trying to solve is dumb: I need to sort versions via string comparison (this is how tomcat determines the latest / active version of an app). And an empty label value does sort higher than any other value, but it should sort lowest.
This use case is slightly ridiculous, but I'm sure there are other use cases that benefit from a default label value. Providing a default label value simply improves readability of metrics, which is a benefit in its own.
For now I workaround this problem with multiple, more specific match rules, but this is quite cumbersome and error prone:
rules:
# first rule with only matches `name` with a version, second rule matches without. only first match is used.
# this is, so that we always have a value in the version label, so that we can string sort by this, in order to find the latest version
# in the same way tomcat does... the default version string must thus be sorted before numbers, '-' does that.
- pattern: 'Catalina<j2eeType=WebModule, name=//(?:localhost/)?([-a-zA-Z0-9+&@/%?=~_|!:.,;]*[-a-zA-Z0-9+&@/%=~_|])(?:##(.+)), J2EEApplication=none, J2EEServer=none><>startTime:'
name: tomcat_module_started_at
labels:
module: "$1"
version: "$2"
help: Tomcat WebModule startTime (unix time)
type: GAUGE
- pattern: 'Catalina<j2eeType=WebModule, name=//(?:localhost/)?([-a-zA-Z0-9+&@/%?=~_|!:.,;]*[-a-zA-Z0-9+&@/%=~_|]), J2EEApplication=none, J2EEServer=none><>startTime:'
name: tomcat_module_started_at
labels:
module: "$1"
version: '-' # ← ← ← ← ← ← note the default value here
help: Tomcat WebModule startTime (unix time)
type: GAUGE
from jmx_exporter.
Related Issues (20)
- Failed to register Collector of type BuildInfoCollector: jmx_exporter_build_info is already in use by another Collector of type BuildInfoCollector HOT 1
- JMX exporter does not expose container port externally via the Agent method HOT 3
- The http response header X-Content-Type-Options ,X-XSS-Protection,X-Frame-Options are missing HOT 1
- NullPointerException during scrape HOT 1
- Is it possible to add custom k8s attributes as labels for Kafka connect JMX metrics HOT 2
- Allow config file to contain the keystore / truststore credentials when connecting via ssl to JMX HOT 3
- How to create hpa kubernetes based on heap consommation HOT 1
- jmx exporter on an old AIX, v6.1. HOT 5
- Does the expiry/renewal of certificates in jmx_exporter, require restart of service or is it automatically reloaded. HOT 2
- High memory usage by jmx_exporter when connecting to Kafka HOT 1
- Positive match to a rule should not consume the metric HOT 1
- Example config for Tomcat HOT 4
- patterns support for config file for kafka metrics HOT 18
- Question about excludeObjectNames HOT 3
- Support for JMX filter pattern for kafka metrics HOT 24
- The metric jvm_memory_used_bytes transitioned to jvm_memory_bytes_used starting from a certain version of jmx_exporter? HOT 6
- How can I send metrics simultaneously for kafka metrics and for kafka connect HOT 1
- File descriptors opened by jmx exporter getting stuck in CLOSE_WAIT state HOT 33
- Logging of jmx and alerts what all it can monitor HOT 1
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.