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

Support collect ZGC memory pool metrics #11432

Merged
merged 7 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/en/api/jvm-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ enum PoolType {
SURVIVOR_USAGE = 3;
PERMGEN_USAGE = 4;
METASPACE_USAGE = 5;
ZHEAP_USAGE = 6;
COMPRESSED_CLASS_SPACE_USAGE = 7;
CODEHEAP_NON_NMETHODS_USAGE = 8;
CODEHEAP_PROFILED_NMETHODS_USAGE = 9;
CODEHEAP_NON_PROFILED_NMETHODS_USAGE = 10;
}

message GC {
Expand Down
3 changes: 3 additions & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Optimize queryBasicTraces in TraceQueryEsDAO.
* Fix `WebhookCallback` send incorrect messages, add catch exception for each callback HTTP Post.
* Fix AlarmRule expression validation: add labeled metrics mock data for check.
* Support collect ZGC memory pool metrics.

#### UI

Expand All @@ -36,6 +37,8 @@
* Refactor: update pagination style. No visualization style change.
* Apply MQE on K8s layer UI-templates.
* Fix icons display in trace tree diagram.
* fix: update tooltip style to support multiple metrics scrolling view in a metrics graph.
* Add a new widget to show jvm memory pool detail.

#### Documentation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,21 @@ private void sendToMemoryPoolMetricProcess(String service,
case CODE_CACHE_USAGE:
serviceInstanceJVMMemoryPool.setPoolType(MemoryPoolType.CODE_CACHE_USAGE);
break;
case ZHEAP_USAGE:
serviceInstanceJVMMemoryPool.setPoolType(MemoryPoolType.ZHEAP_USAGE);
break;
case COMPRESSED_CLASS_SPACE_USAGE:
serviceInstanceJVMMemoryPool.setPoolType(MemoryPoolType.COMPRESSED_CLASS_SPACE_USAGE);
break;
case CODEHEAP_NON_NMETHODS_USAGE:
serviceInstanceJVMMemoryPool.setPoolType(MemoryPoolType.CODEHEAP_NON_NMETHODS_USAGE);
break;
case CODEHEAP_PROFILED_NMETHODS_USAGE:
serviceInstanceJVMMemoryPool.setPoolType(MemoryPoolType.CODEHEAP_PROFILED_NMETHODS_USAGE);
break;
case CODEHEAP_NON_PROFILED_NMETHODS_USAGE:
serviceInstanceJVMMemoryPool.setPoolType(MemoryPoolType.CODEHEAP_NON_PROFILED_NMETHODS_USAGE);
break;
}

serviceInstanceJVMMemoryPool.setInit(memoryPool.getInit());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,15 @@
package org.apache.skywalking.oap.server.core.source;

public enum MemoryPoolType {
CODE_CACHE_USAGE, NEWGEN_USAGE, OLDGEN_USAGE, SURVIVOR_USAGE, PERMGEN_USAGE, METASPACE_USAGE
CODE_CACHE_USAGE,
NEWGEN_USAGE,
OLDGEN_USAGE,
SURVIVOR_USAGE,
PERMGEN_USAGE,
METASPACE_USAGE,
ZHEAP_USAGE,
COMPRESSED_CLASS_SPACE_USAGE,
CODEHEAP_NON_NMETHODS_USAGE,
CODEHEAP_PROFILED_NMETHODS_USAGE,
CODEHEAP_NON_PROFILED_NMETHODS_USAGE,
}
11 changes: 11 additions & 0 deletions oap-server/server-starter/src/main/resources/oal/java-agent.oal
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ instance_jvm_memory_heap = from(ServiceInstanceJVMMemory.used).filter(heapStatus
instance_jvm_memory_noheap = from(ServiceInstanceJVMMemory.used).filter(heapStatus == false).longAvg();
instance_jvm_memory_heap_max = from(ServiceInstanceJVMMemory.max).filter(heapStatus == true).longAvg();
instance_jvm_memory_noheap_max = from(ServiceInstanceJVMMemory.max).filter(heapStatus == false).longAvg();
instance_jvm_memory_pool_code_cache = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.CODE_CACHE_USAGE).longAvg();
instance_jvm_memory_pool_newgen = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.NEWGEN_USAGE).longAvg();
instance_jvm_memory_pool_oldgen = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.OLDGEN_USAGE).longAvg();
instance_jvm_memory_pool_survivor = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.SURVIVOR_USAGE).longAvg();
instance_jvm_memory_pool_permgen = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.PERMGEN_USAGE).longAvg();
Comment on lines +25 to +29
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these? All thses are not new metrics.

I am not following.

instance_jvm_memory_pool_metaspace = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.METASPACE_USAGE).longAvg();
instance_jvm_memory_pool_zheap = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.ZHEAP_USAGE).longAvg();
instance_jvm_memory_pool_compressed_class_space = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.COMPRESSED_CLASS_SPACE_USAGE).longAvg();
instance_jvm_memory_pool_codeheap_non_nmethods = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.CODEHEAP_NON_NMETHODS_USAGE).longAvg();
instance_jvm_memory_pool_codeheap_profiled_nmethods = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.CODEHEAP_PROFILED_NMETHODS_USAGE).longAvg();
instance_jvm_memory_pool_codeheap_non_profiled_nmethods = from(ServiceInstanceJVMMemoryPool.used).filter(poolType == MemoryPoolType.CODEHEAP_NON_PROFILED_NMETHODS_USAGE).longAvg();
instance_jvm_young_gc_time = from(ServiceInstanceJVMGC.time).filter(phase == GCPhase.NEW).sum();
instance_jvm_old_gc_time = from(ServiceInstanceJVMGC.time).filter(phase == GCPhase.OLD).sum();
instance_jvm_normal_gc_time = from(ServiceInstanceJVMGC.time).filter(phase == GCPhase.NORMAL).sum();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
"y": 0,
"w": 8,
"h": 13,
"i": "5",
"i": "4",
"type": "Widget",
"widget": {
"title": "JVM Memory (MB)"
Expand Down Expand Up @@ -326,7 +326,88 @@
]
},
{
"x": 8,
"x": 16,
"y": 0,
"w": 8,
"h": 13,
"i": "5",
"type": "Widget",
"widget": {
"title": "JVM Memory Detail (MB)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you adding a new widget?
This name doesn't seem diff from other GC model.

},
"graph": {
"type": "Line",
"step": false,
"smooth": false,
"showSymbol": true,
"showXAxis": true,
"showYAxis": true
},
"metricConfig": [
{
"label": "CodeCache"
},
{
"label": "NewGen"
},
{
"label": "OldGen"
},
{
"label": "Survivor"
},
{
"label": "PermGen"
},
{
"label": "Metaspace"
},
{
"label": "ZHeap"
},
{
"label": "Compressed Class Space"
},
{
"label": "CodeHeap 'non-nmethods'"
},
{
"label": "CodeHeap 'profiled nmethods'"
},
{
"label": "CodeHeap 'non-profiled nmethods'"
}
],
"metricMode": "Expression",
"expressions": [
"instance_jvm_memory_pool_code_cache/1048576",
"instance_jvm_memory_pool_newgen/1048576",
"instance_jvm_memory_pool_oldgen/1048576",
"instance_jvm_memory_pool_survivor/1048576",
"instance_jvm_memory_pool_permgen/1048576",
"instance_jvm_memory_pool_metaspace/1048576",
"instance_jvm_memory_pool_zheap/1048576",
"instance_jvm_memory_pool_compressed_class_space/1048576",
"instance_jvm_memory_pool_codeheap_non_nmethods/1048576",
"instance_jvm_memory_pool_codeheap_profiled_nmethods/1048576",
"instance_jvm_memory_pool_codeheap_non_profiled_nmethods/1048576"
],
"typesOfMQE": [
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES",
"TIME_SERIES_VALUES"
]
},
{
"x": 16,
"y": 13,
"w": 8,
"h": 13,
Expand Down Expand Up @@ -367,8 +448,8 @@
]
},
{
"x": 16,
"y": 13,
"x": 0,
"y": 26,
"w": 8,
"h": 13,
"i": "13",
Expand Down Expand Up @@ -440,10 +521,10 @@
]
},
{
"x": 0,
"x": 8,
"y": 26,
"w": 8,
"h": 12,
"h": 13,
"i": "15",
"type": "Widget",
"widget": {
Expand Down Expand Up @@ -479,8 +560,8 @@
]
},
{
"x": 16,
"y": 0,
"x": 0,
"y": 13,
"w": 8,
"h": 13,
"i": "6",
Expand Down Expand Up @@ -520,7 +601,7 @@
]
},
{
"x": 0,
"x": 8,
"y": 13,
"w": 8,
"h": 13,
Expand Down
Loading