Skip to content

Commit

Permalink
Support collect ZGC memory pool metrics (#11432)
Browse files Browse the repository at this point in the history
* Support collect ZGC memory pool metrics

* submodule update
  • Loading branch information
Z-Beatles authored Oct 20, 2023
1 parent 062b31f commit 5d0bd05
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apm-protocol/apm-network/src/main/proto
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();
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)"
},
"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
2 changes: 1 addition & 1 deletion skywalking-ui

0 comments on commit 5d0bd05

Please sign in to comment.