Skip to content

Commit

Permalink
Remove mapping for process.runtime.jvm.gc.duration (#213)
Browse files Browse the repository at this point in the history
* Remove jvm.gc.duration mapping

* Update histogram test

* Add changelog
  • Loading branch information
liustanley authored Dec 7, 2023
1 parent 97610b4 commit 5432be0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .chloggen/stanley.liu_remove-jvm-gc-duration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component (e.g. pkg/quantile)
component: pkg/otlp/metrics

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Removes runtime metric mapping for process.runtime.jvm.gc.duration -> jvm.gc.parnew.time

# The PR related to this change
issues: [213]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
18 changes: 9 additions & 9 deletions pkg/otlp/metrics/metrics_translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,22 +537,22 @@ func TestMapHistogramRuntimeMetricHasMapping(t *testing.T) {
tr := newTranslator(t, zap.NewNop())
consumer := &mockFullConsumer{}

rmt, err := tr.MapMetrics(ctx, createTestHistogramMetric("process.runtime.jvm.gc.duration"), consumer)
rmt, err := tr.MapMetrics(ctx, createTestHistogramMetric("process.runtime.jvm.threads.count"), consumer)
if err != nil {
t.Fatal(err)
}
startTs := int(getProcessStartTime()) + 1
assert.ElementsMatch(t,
consumer.metrics,
[]metric{
newCountWithHost(newDims("process.runtime.jvm.gc.duration.count"), uint64(seconds(startTs+1)), 100, fallbackHostname),
newCountWithHost(newDims("process.runtime.jvm.gc.duration.sum"), uint64(seconds(startTs+1)), 0, fallbackHostname),
newGaugeWithHost(newDims("process.runtime.jvm.gc.duration.min"), uint64(seconds(startTs+1)), -100, fallbackHostname),
newGaugeWithHost(newDims("process.runtime.jvm.gc.duration.max"), uint64(seconds(startTs+1)), 100, fallbackHostname),
newCountWithHost(newDims("jvm.gc.parnew.time.count"), uint64(seconds(startTs+1)), 100, fallbackHostname),
newCountWithHost(newDims("jvm.gc.parnew.time.sum"), uint64(seconds(startTs+1)), 0, fallbackHostname),
newGaugeWithHost(newDims("jvm.gc.parnew.time.min"), uint64(seconds(startTs+1)), -100, fallbackHostname),
newGaugeWithHost(newDims("jvm.gc.parnew.time.max"), uint64(seconds(startTs+1)), 100, fallbackHostname),
newCountWithHost(newDims("process.runtime.jvm.threads.count.count"), uint64(seconds(startTs+1)), 100, fallbackHostname),
newCountWithHost(newDims("process.runtime.jvm.threads.count.sum"), uint64(seconds(startTs+1)), 0, fallbackHostname),
newGaugeWithHost(newDims("process.runtime.jvm.threads.count.min"), uint64(seconds(startTs+1)), -100, fallbackHostname),
newGaugeWithHost(newDims("process.runtime.jvm.threads.count.max"), uint64(seconds(startTs+1)), 100, fallbackHostname),
newCountWithHost(newDims("jvm.thread_count.count"), uint64(seconds(startTs+1)), 100, fallbackHostname),
newCountWithHost(newDims("jvm.thread_count.sum"), uint64(seconds(startTs+1)), 0, fallbackHostname),
newGaugeWithHost(newDims("jvm.thread_count.min"), uint64(seconds(startTs+1)), -100, fallbackHostname),
newGaugeWithHost(newDims("jvm.thread_count.max"), uint64(seconds(startTs+1)), 100, fallbackHostname),
},
)
assert.Equal(t, []string{"jvm"}, rmt.Languages)
Expand Down
1 change: 0 additions & 1 deletion pkg/otlp/metrics/runtime_metric_mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ var javaRuntimeMetricsMappings = runtimeMetricMappingList{
"process.runtime.jvm.classes.current_loaded": {{mappedName: "jvm.loaded_classes"}},
"process.runtime.jvm.system.cpu.utilization": {{mappedName: "jvm.cpu_load.system"}},
"process.runtime.jvm.cpu.utilization": {{mappedName: "jvm.cpu_load.process"}},
"process.runtime.jvm.gc.duration": {{mappedName: "jvm.gc.parnew.time"}},
"process.runtime.jvm.memory.usage": {{
mappedName: "jvm.heap_memory",
attributes: []runtimeMetricAttribute{{
Expand Down

0 comments on commit 5432be0

Please sign in to comment.