Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting metrics for FirstMessageAge using JMX Exporter in Activemq Artemis #986

Open
priyabrat-mishra opened this issue Aug 5, 2024 · 8 comments

Comments

@priyabrat-mishra
Copy link

Hi Team,

We are not getting Prometheus metrics for the below pattern . We just need the value of FirstMessageAge value for Queues/Topics .

^org.apache.activemq.artemis<broker="([^\"])",\scomponent=addresses,\saddress="([^\"])",\ssubcomponent=queues,\srouting-type="([^\"])",\squeue="([^\"]*)"><>FirstMessageAge

Currently we are using the below pattern, but its sending all the metrics for the queues/topics .

"^org.apache.activemq.artemis<broker="([^\"])",\scomponent=addresses,\saddress="([^\"])",\ssubcomponent=(queue|topic)s,\srouting-type="([^\"])",\s(queue|topic)="([^\"])"><>([^: ]):\s(.*)"

@dhoard
Copy link
Collaborator

dhoard commented Aug 5, 2024

@priyabrat-mishra which version of the exporter are you using?

@dhoard dhoard self-assigned this Aug 5, 2024
@priyabrat-mishra
Copy link
Author

@dhoard We are using version 0.19.0 . The jar file jmx_prometheus_javaagent-0.19.0.jar is used .

@priyabrat-mishra
Copy link
Author

@dhoard Could you please provide the pattern which can send only the metric first_message_age . We tried with many options, but nothing working . Below is the latest one used .

  • pattern: "^org.apache.activemq.artemis<broker="([^\"])",\scomponent=addresses,\saddress="([^\"])",\ssubcomponent=(queue|topic)s,\srouting-type="([^\"])",\s(queue|topic)="([^\"])"><>.age.:\s(.)"
    attrNameSnakeCase: true
    name: artemis_$7
    type: COUNTER
    labels:
    address: $2
    "$5": $6
    name: $1
    version:
    routingType: $4

@dhoard
Copy link
Collaborator

dhoard commented Aug 6, 2024

@priyabrat-mishra some questions...

  1. if you use rules ".*" do you see FirstMessageAge?

  2. if you use "^org.apache.activemq.artemis<broker="([^\"])",\scomponent=addresses,\saddress="([^\"])",\ssubcomponent=(queue|topic)s,\srouting-type="([^\"])",\s(queue|topic)="([^\"])"><>([^: ]):\s(.*)" do you see FirstMessageAge?

@priyabrat-mishra
Copy link
Author

@dhoard

Yes, in both cases , we are getting the metrics for first_message_age . But our requirement is to get only first_message_age metrics , not other metrics . We tried with the below pattern , but the $7 is replaced with the value of the metric . Could you please let us know if there is correction needed for the below pattern .

  • pattern: "^org.apache.activemq.artemis<broker="([^\"])",\scomponent=addresses,\saddress="([^\"])",\ssubcomponent=(queue|topic)s,\srouting-type="([^\"])",\s(queue|topic)="([^\"])"><>.first.:\s(.)"
    attrNameSnakeCase: true
    name: artemis_$7
    type: COUNTER
    labels:
    address: $2
    "$5": $6
    name: $1
    version:
    routingType: $4

Metric got for the above is as below .

artemis_253419677{queue="TEST.QUEUE.3",address="TEST.QUEUE.3",name="sq1107-statefulset-0",routingtype="anycast",version="Apache ActiveMQ Artemis 2.32.0",} 2.53419677E8

@dhoard
Copy link
Collaborator

dhoard commented Aug 7, 2024

Since you are matching a specific value, you should be able to set the name to a constant value.

name: artemis_first_message_age

@priyabrat-mishra
Copy link
Author

@dhoard what is the pattern should we use for that as just putting the name is not sending any value for that metrics

@dhoard
Copy link
Collaborator

dhoard commented Aug 7, 2024

@priyabrat-mishra the literal.

name: artemis_first_message_age

From the README...

name The metric name to set. Capture groups from the pattern can be used. If not specified, the default format will be used. If it evaluates to empty, processing of this attribute stops with no output. An Additional suffix may be added to this name (e.g _total for type COUNTER)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants