Skip to content

Commit 5432be0

Browse files
authored
Remove mapping for process.runtime.jvm.gc.duration (#213)
* Remove jvm.gc.duration mapping * Update histogram test * Add changelog
1 parent 97610b4 commit 5432be0

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: bug_fix
3+
4+
# The name of the component (e.g. pkg/quantile)
5+
component: pkg/otlp/metrics
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Removes runtime metric mapping for process.runtime.jvm.gc.duration -> jvm.gc.parnew.time
9+
10+
# The PR related to this change
11+
issues: [213]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext:

pkg/otlp/metrics/metrics_translator_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -537,22 +537,22 @@ func TestMapHistogramRuntimeMetricHasMapping(t *testing.T) {
537537
tr := newTranslator(t, zap.NewNop())
538538
consumer := &mockFullConsumer{}
539539

540-
rmt, err := tr.MapMetrics(ctx, createTestHistogramMetric("process.runtime.jvm.gc.duration"), consumer)
540+
rmt, err := tr.MapMetrics(ctx, createTestHistogramMetric("process.runtime.jvm.threads.count"), consumer)
541541
if err != nil {
542542
t.Fatal(err)
543543
}
544544
startTs := int(getProcessStartTime()) + 1
545545
assert.ElementsMatch(t,
546546
consumer.metrics,
547547
[]metric{
548-
newCountWithHost(newDims("process.runtime.jvm.gc.duration.count"), uint64(seconds(startTs+1)), 100, fallbackHostname),
549-
newCountWithHost(newDims("process.runtime.jvm.gc.duration.sum"), uint64(seconds(startTs+1)), 0, fallbackHostname),
550-
newGaugeWithHost(newDims("process.runtime.jvm.gc.duration.min"), uint64(seconds(startTs+1)), -100, fallbackHostname),
551-
newGaugeWithHost(newDims("process.runtime.jvm.gc.duration.max"), uint64(seconds(startTs+1)), 100, fallbackHostname),
552-
newCountWithHost(newDims("jvm.gc.parnew.time.count"), uint64(seconds(startTs+1)), 100, fallbackHostname),
553-
newCountWithHost(newDims("jvm.gc.parnew.time.sum"), uint64(seconds(startTs+1)), 0, fallbackHostname),
554-
newGaugeWithHost(newDims("jvm.gc.parnew.time.min"), uint64(seconds(startTs+1)), -100, fallbackHostname),
555-
newGaugeWithHost(newDims("jvm.gc.parnew.time.max"), uint64(seconds(startTs+1)), 100, fallbackHostname),
548+
newCountWithHost(newDims("process.runtime.jvm.threads.count.count"), uint64(seconds(startTs+1)), 100, fallbackHostname),
549+
newCountWithHost(newDims("process.runtime.jvm.threads.count.sum"), uint64(seconds(startTs+1)), 0, fallbackHostname),
550+
newGaugeWithHost(newDims("process.runtime.jvm.threads.count.min"), uint64(seconds(startTs+1)), -100, fallbackHostname),
551+
newGaugeWithHost(newDims("process.runtime.jvm.threads.count.max"), uint64(seconds(startTs+1)), 100, fallbackHostname),
552+
newCountWithHost(newDims("jvm.thread_count.count"), uint64(seconds(startTs+1)), 100, fallbackHostname),
553+
newCountWithHost(newDims("jvm.thread_count.sum"), uint64(seconds(startTs+1)), 0, fallbackHostname),
554+
newGaugeWithHost(newDims("jvm.thread_count.min"), uint64(seconds(startTs+1)), -100, fallbackHostname),
555+
newGaugeWithHost(newDims("jvm.thread_count.max"), uint64(seconds(startTs+1)), 100, fallbackHostname),
556556
},
557557
)
558558
assert.Equal(t, []string{"jvm"}, rmt.Languages)

pkg/otlp/metrics/runtime_metric_mappings.go

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ var javaRuntimeMetricsMappings = runtimeMetricMappingList{
9494
"process.runtime.jvm.classes.current_loaded": {{mappedName: "jvm.loaded_classes"}},
9595
"process.runtime.jvm.system.cpu.utilization": {{mappedName: "jvm.cpu_load.system"}},
9696
"process.runtime.jvm.cpu.utilization": {{mappedName: "jvm.cpu_load.process"}},
97-
"process.runtime.jvm.gc.duration": {{mappedName: "jvm.gc.parnew.time"}},
9897
"process.runtime.jvm.memory.usage": {{
9998
mappedName: "jvm.heap_memory",
10099
attributes: []runtimeMetricAttribute{{

0 commit comments

Comments
 (0)