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

MetricsConfig for Prometheus #102

Closed
0xlee opened this issue Jul 27, 2023 · 1 comment · Fixed by #105
Closed

MetricsConfig for Prometheus #102

0xlee opened this issue Jul 27, 2023 · 1 comment · Fixed by #105
Assignees

Comments

@0xlee
Copy link

0xlee commented Jul 27, 2023

Hi,

I updated our prebid-cache to the latest version 1.17.0, but encountered some issues.

The keys in prometheus doesn't allow dots, but when I run this application, all prometheus metric keys comes with dots like following:

# HELP jvm.memory.max The maximum amount of memory in bytes that can be used for memory management
# TYPE jvm.memory.max gauge
jvm.memory.max{area="nonheap",id="CodeHeap 'profiled nmethods'",} 1.22908672E8
jvm.memory.max{area="heap",id="G1 Survivor Space",} -1.0
jvm.memory.max{area="heap",id="G1 Old Gen",} 8.350859264E9
jvm.memory.max{area="nonheap",id="Metaspace",} -1.0
jvm.memory.max{area="nonheap",id="CodeHeap 'non-nmethods'",} 5840896.0
jvm.memory.max{area="heap",id="G1 Eden Space",} -1.0
jvm.memory.max{area="nonheap",id="Compressed Class Space",} 1.073741824E9
jvm.memory.max{area="nonheap",id="CodeHeap 'non-profiled nmethods'",} 1.22908672E8
# HELP disk.total Total space for path
# TYPE disk.total gauge
disk.total{path="/home/dongha/projects/gutefrage/GD/prebid-cache-java/.",} 1.023671271424E12
# HELP application.started.time Time taken (ms) to start the application
# TYPE application.started.time gauge
application.started.time{main.application.class="org.prebid.cache.PBCacheApplication",} 3.444
# HELP log4j2.events_total Number of fatal level log events
# TYPE log4j2.events_total counter
log4j2.events_total{level="warn",} 0.0
log4j2.events_total{level="debug",} 0.0
log4j2.events_total{level="error",} 0.0
log4j2.events_total{level="trace",} 0.0
log4j2.events_total{level="fatal",} 0.0
log4j2.events_total{level="info",} 3.0

But if I remove the following method, then it works as expected: https://github.com/prebid/prebid-cache-java/blob/1.17.0/src/main/java/org/prebid/cache/config/MetricsConfig.java#L15-L19

I think the identity naming convention prevents from converting the prometheus renaming.

How about putting the identity naming convention into graphitePrefixMeterCustomizer?

@Net-burst
Copy link
Collaborator

@0xlee again sorry for the long delay. The plan is to include your proposed fix in the next tag. Thanks!

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

Successfully merging a pull request may close this issue.

3 participants