Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
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
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),
Copy link
Member

Choose a reason for hiding this comment

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

Seems like we are removing the mapping from process.runtime.jvm.gc.duration to jvm.gc.parnew.time, not sure how metric process.runtime.jvm.threads.count.count fit in to this change ?

Copy link
Member

Choose a reason for hiding this comment

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

Or are you just adding more test cases which are unrelated ? If this is the case then LGTM, just want to make sure I'm not missing something :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah just adding more test cases that are unrelated, this test was failing since we removed the mapping so I changed it to a different mapping name to keep the same test for histograms.

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