diff --git a/.chloggen/hostmetricsreceiver-add-systemmemoryshared-metric.yaml b/.chloggen/hostmetricsreceiver-add-systemmemoryshared-metric.yaml new file mode 100644 index 0000000000000..d03f4a8fdfbce --- /dev/null +++ b/.chloggen/hostmetricsreceiver-add-systemmemoryshared-metric.yaml @@ -0,0 +1,31 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'enhancement' + +# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog) +component: receiver/hostmetrics + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add optional `system.memory.linux.shared` metric + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [32712] + +# (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: | + This metric reports shared memory usage, including tmpfs filesystems, + System V shared memory, and POSIX shared memory. Currently only available + on Linux systems due to platform-specific data availability. + This corresponds to the `Shmem` field in `/proc/meminfo`. + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/documentation.md b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/documentation.md index cb2b7d1b280c4..a9a63de90ef0b 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/documentation.md +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/documentation.md @@ -60,6 +60,14 @@ Total bytes of memory available. | ---- | ----------- | ---------- | ----------------------- | --------- | --------- | | By | Sum | Int | Cumulative | false | Development | +### system.memory.linux.shared + +Shared memory usage, including tmpfs filesystems and System V/POSIX shared memory. Only supported on Linux. + +| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | Stability | +| ---- | ----------- | ---------- | ----------------------- | --------- | --------- | +| By | Sum | Int | Cumulative | false | Development | + ### system.memory.page_size A constant value for the system's configured page size. diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_config.go b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_config.go index 2bb6bcd3bb8cb..9f06b7aecd0a3 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_config.go +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_config.go @@ -31,6 +31,7 @@ type MetricsConfig struct { SystemLinuxMemoryAvailable MetricConfig `mapstructure:"system.linux.memory.available"` SystemLinuxMemoryDirty MetricConfig `mapstructure:"system.linux.memory.dirty"` SystemMemoryLimit MetricConfig `mapstructure:"system.memory.limit"` + SystemMemoryLinuxShared MetricConfig `mapstructure:"system.memory.linux.shared"` SystemMemoryPageSize MetricConfig `mapstructure:"system.memory.page_size"` SystemMemoryUsage MetricConfig `mapstructure:"system.memory.usage"` SystemMemoryUtilization MetricConfig `mapstructure:"system.memory.utilization"` @@ -47,6 +48,9 @@ func DefaultMetricsConfig() MetricsConfig { SystemMemoryLimit: MetricConfig{ Enabled: false, }, + SystemMemoryLinuxShared: MetricConfig{ + Enabled: false, + }, SystemMemoryPageSize: MetricConfig{ Enabled: false, }, diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_config_test.go b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_config_test.go index ad2803941a503..748346994f851 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_config_test.go +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_config_test.go @@ -29,6 +29,7 @@ func TestMetricsBuilderConfig(t *testing.T) { SystemLinuxMemoryAvailable: MetricConfig{Enabled: true}, SystemLinuxMemoryDirty: MetricConfig{Enabled: true}, SystemMemoryLimit: MetricConfig{Enabled: true}, + SystemMemoryLinuxShared: MetricConfig{Enabled: true}, SystemMemoryPageSize: MetricConfig{Enabled: true}, SystemMemoryUsage: MetricConfig{Enabled: true}, SystemMemoryUtilization: MetricConfig{Enabled: true}, @@ -42,6 +43,7 @@ func TestMetricsBuilderConfig(t *testing.T) { SystemLinuxMemoryAvailable: MetricConfig{Enabled: false}, SystemLinuxMemoryDirty: MetricConfig{Enabled: false}, SystemMemoryLimit: MetricConfig{Enabled: false}, + SystemMemoryLinuxShared: MetricConfig{Enabled: false}, SystemMemoryPageSize: MetricConfig{Enabled: false}, SystemMemoryUsage: MetricConfig{Enabled: false}, SystemMemoryUtilization: MetricConfig{Enabled: false}, diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_metrics.go b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_metrics.go index 52f3c204881f2..fb46a5b3c5934 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_metrics.go +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_metrics.go @@ -68,6 +68,9 @@ var MetricsInfo = metricsInfo{ SystemMemoryLimit: metricInfo{ Name: "system.memory.limit", }, + SystemMemoryLinuxShared: metricInfo{ + Name: "system.memory.linux.shared", + }, SystemMemoryPageSize: metricInfo{ Name: "system.memory.page_size", }, @@ -83,6 +86,7 @@ type metricsInfo struct { SystemLinuxMemoryAvailable metricInfo SystemLinuxMemoryDirty metricInfo SystemMemoryLimit metricInfo + SystemMemoryLinuxShared metricInfo SystemMemoryPageSize metricInfo SystemMemoryUsage metricInfo SystemMemoryUtilization metricInfo @@ -248,6 +252,58 @@ func newMetricSystemMemoryLimit(cfg MetricConfig) metricSystemMemoryLimit { return m } +type metricSystemMemoryLinuxShared struct { + data pmetric.Metric // data buffer for generated metric. + config MetricConfig // metric config provided by user. + capacity int // max observed number of data points added to the metric. +} + +// init fills system.memory.linux.shared metric with initial data. +func (m *metricSystemMemoryLinuxShared) init() { + m.data.SetName("system.memory.linux.shared") + m.data.SetDescription("Shared memory usage, including tmpfs filesystems and System V/POSIX shared memory. Only supported on Linux.") + m.data.SetUnit("By") + m.data.SetEmptySum() + m.data.Sum().SetIsMonotonic(false) + m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative) +} + +func (m *metricSystemMemoryLinuxShared) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64) { + if !m.config.Enabled { + return + } + dp := m.data.Sum().DataPoints().AppendEmpty() + dp.SetStartTimestamp(start) + dp.SetTimestamp(ts) + dp.SetIntValue(val) +} + +// updateCapacity saves max length of data point slices that will be used for the slice capacity. +func (m *metricSystemMemoryLinuxShared) updateCapacity() { + if m.data.Sum().DataPoints().Len() > m.capacity { + m.capacity = m.data.Sum().DataPoints().Len() + } +} + +// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points. +func (m *metricSystemMemoryLinuxShared) emit(metrics pmetric.MetricSlice) { + if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 { + m.updateCapacity() + m.data.MoveTo(metrics.AppendEmpty()) + m.init() + } +} + +func newMetricSystemMemoryLinuxShared(cfg MetricConfig) metricSystemMemoryLinuxShared { + m := metricSystemMemoryLinuxShared{config: cfg} + + if cfg.Enabled { + m.data = pmetric.NewMetric() + m.init() + } + return m +} + type metricSystemMemoryPageSize struct { data pmetric.Metric // data buffer for generated metric. config MetricConfig // metric config provided by user. @@ -415,6 +471,7 @@ type MetricsBuilder struct { metricSystemLinuxMemoryAvailable metricSystemLinuxMemoryAvailable metricSystemLinuxMemoryDirty metricSystemLinuxMemoryDirty metricSystemMemoryLimit metricSystemMemoryLimit + metricSystemMemoryLinuxShared metricSystemMemoryLinuxShared metricSystemMemoryPageSize metricSystemMemoryPageSize metricSystemMemoryUsage metricSystemMemoryUsage metricSystemMemoryUtilization metricSystemMemoryUtilization @@ -446,6 +503,7 @@ func NewMetricsBuilder(mbc MetricsBuilderConfig, settings scraper.Settings, opti metricSystemLinuxMemoryAvailable: newMetricSystemLinuxMemoryAvailable(mbc.Metrics.SystemLinuxMemoryAvailable), metricSystemLinuxMemoryDirty: newMetricSystemLinuxMemoryDirty(mbc.Metrics.SystemLinuxMemoryDirty), metricSystemMemoryLimit: newMetricSystemMemoryLimit(mbc.Metrics.SystemMemoryLimit), + metricSystemMemoryLinuxShared: newMetricSystemMemoryLinuxShared(mbc.Metrics.SystemMemoryLinuxShared), metricSystemMemoryPageSize: newMetricSystemMemoryPageSize(mbc.Metrics.SystemMemoryPageSize), metricSystemMemoryUsage: newMetricSystemMemoryUsage(mbc.Metrics.SystemMemoryUsage), metricSystemMemoryUtilization: newMetricSystemMemoryUtilization(mbc.Metrics.SystemMemoryUtilization), @@ -518,6 +576,7 @@ func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption) { mb.metricSystemLinuxMemoryAvailable.emit(ils.Metrics()) mb.metricSystemLinuxMemoryDirty.emit(ils.Metrics()) mb.metricSystemMemoryLimit.emit(ils.Metrics()) + mb.metricSystemMemoryLinuxShared.emit(ils.Metrics()) mb.metricSystemMemoryPageSize.emit(ils.Metrics()) mb.metricSystemMemoryUsage.emit(ils.Metrics()) mb.metricSystemMemoryUtilization.emit(ils.Metrics()) @@ -557,6 +616,11 @@ func (mb *MetricsBuilder) RecordSystemMemoryLimitDataPoint(ts pcommon.Timestamp, mb.metricSystemMemoryLimit.recordDataPoint(mb.startTime, ts, val) } +// RecordSystemMemoryLinuxSharedDataPoint adds a data point to system.memory.linux.shared metric. +func (mb *MetricsBuilder) RecordSystemMemoryLinuxSharedDataPoint(ts pcommon.Timestamp, val int64) { + mb.metricSystemMemoryLinuxShared.recordDataPoint(mb.startTime, ts, val) +} + // RecordSystemMemoryPageSizeDataPoint adds a data point to system.memory.page_size metric. func (mb *MetricsBuilder) RecordSystemMemoryPageSizeDataPoint(ts pcommon.Timestamp, val int64) { mb.metricSystemMemoryPageSize.recordDataPoint(mb.startTime, ts, val) diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_metrics_test.go b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_metrics_test.go index 5b2d1954cedef..b483ec4819d79 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_metrics_test.go +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/generated_metrics_test.go @@ -67,6 +67,9 @@ func TestMetricsBuilder(t *testing.T) { allMetricsCount++ mb.RecordSystemMemoryLimitDataPoint(ts, 1) + allMetricsCount++ + mb.RecordSystemMemoryLinuxSharedDataPoint(ts, 1) + allMetricsCount++ mb.RecordSystemMemoryPageSizeDataPoint(ts, 1) @@ -141,6 +144,20 @@ func TestMetricsBuilder(t *testing.T) { assert.Equal(t, ts, dp.Timestamp()) assert.Equal(t, pmetric.NumberDataPointValueTypeInt, dp.ValueType()) assert.Equal(t, int64(1), dp.IntValue()) + case "system.memory.linux.shared": + assert.False(t, validatedMetrics["system.memory.linux.shared"], "Found a duplicate in the metrics slice: system.memory.linux.shared") + validatedMetrics["system.memory.linux.shared"] = true + assert.Equal(t, pmetric.MetricTypeSum, ms.At(i).Type()) + assert.Equal(t, 1, ms.At(i).Sum().DataPoints().Len()) + assert.Equal(t, "Shared memory usage, including tmpfs filesystems and System V/POSIX shared memory. Only supported on Linux.", ms.At(i).Description()) + assert.Equal(t, "By", ms.At(i).Unit()) + assert.False(t, ms.At(i).Sum().IsMonotonic()) + assert.Equal(t, pmetric.AggregationTemporalityCumulative, ms.At(i).Sum().AggregationTemporality()) + dp := ms.At(i).Sum().DataPoints().At(0) + assert.Equal(t, start, dp.StartTimestamp()) + assert.Equal(t, ts, dp.Timestamp()) + assert.Equal(t, pmetric.NumberDataPointValueTypeInt, dp.ValueType()) + assert.Equal(t, int64(1), dp.IntValue()) case "system.memory.page_size": assert.False(t, validatedMetrics["system.memory.page_size"], "Found a duplicate in the metrics slice: system.memory.page_size") validatedMetrics["system.memory.page_size"] = true diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/testdata/config.yaml b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/testdata/config.yaml index d08bd91fea43e..c4e9e314ab3de 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/testdata/config.yaml +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata/testdata/config.yaml @@ -7,6 +7,8 @@ all_set: enabled: true system.memory.limit: enabled: true + system.memory.linux.shared: + enabled: true system.memory.page_size: enabled: true system.memory.usage: @@ -21,6 +23,8 @@ none_set: enabled: false system.memory.limit: enabled: false + system.memory.linux.shared: + enabled: false system.memory.page_size: enabled: false system.memory.usage: diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux.go b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux.go index aede0f1903959..e5d4e39057aa5 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux.go +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux.go @@ -37,6 +37,10 @@ func (s *memoryScraper) recordMemoryUsageMetric(now pcommon.Timestamp, memInfo * s.mb.RecordSystemMemoryUsageDataPoint(now, int64(memInfo.Sunreclaim), metadata.AttributeStateSlabUnreclaimable) } +func (s *memoryScraper) recordMemoryLinuxSharedMetric(now pcommon.Timestamp, memInfo *mem.VirtualMemoryStat) { + s.mb.RecordSystemMemoryLinuxSharedDataPoint(now, int64(memInfo.Shared)) +} + func (s *memoryScraper) recordMemoryUtilizationMetric(now pcommon.Timestamp, memInfo *mem.VirtualMemoryStat) { // TODO: rely on memInfo.Used value once https://github.com/shirou/gopsutil/pull/1882 is released // gopsutil formula: https://github.com/shirou/gopsutil/pull/1882/files#diff-5af8322731595fb792b48f3c38f31ddb24f596cf11a74a9c37b19734597baef6R321 @@ -66,4 +70,5 @@ func (s *memoryScraper) recordLinuxMemoryDirtyMetric(now pcommon.Timestamp, memI func (s *memoryScraper) recordSystemSpecificMetrics(now pcommon.Timestamp, memInfo *mem.VirtualMemoryStat) { s.recordLinuxMemoryAvailableMetric(now, memInfo) s.recordLinuxMemoryDirtyMetric(now, memInfo) + s.recordMemoryLinuxSharedMetric(now, memInfo) } diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux_test.go b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux_test.go index 972a3a47583a4..35fb3e7138eda 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux_test.go +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux_test.go @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/scraper/scrapertest" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata" @@ -53,3 +54,40 @@ func TestScrape_UseMemAvailable(t *testing.T) { assert.Greater(t, memUsedMd.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().At(0).Sum().DataPoints().At(0).IntValue(), legacyMd.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().At(0).Sum().DataPoints().At(0).IntValue(), "system.memory.usage for the used state should be greater when computed using memAvailable") assert.Greater(t, memUsedMd.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().At(1).Gauge().DataPoints().At(0).DoubleValue(), legacyMd.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics().At(1).Gauge().DataPoints().At(0).DoubleValue(), "system.memory.utilization for the used state should be greater when computed using memAvailable") } + +func TestScrape_SharedMemory(t *testing.T) { + mbc := metadata.DefaultMetricsBuilderConfig() + mbc.Metrics.SystemMemoryLinuxShared.Enabled = true + scraperConfig := Config{ + MetricsBuilderConfig: mbc, + } + scraper := newMemoryScraper(t.Context(), scrapertest.NewNopSettings(metadata.Type), &scraperConfig) + + err := scraper.start(t.Context(), componenttest.NewNopHost()) + require.NoError(t, err, "Failed to initialize memory scraper: %v", err) + + memInfo, err := scraper.virtualMemory(t.Context()) + require.NoError(t, err) + require.NotNil(t, memInfo) + + scraper.recordMemoryLinuxSharedMetric(pcommon.NewTimestampFromTime(time.Now()), memInfo) + md := scraper.mb.Emit() + + require.Equal(t, 1, md.ResourceMetrics().Len()) + require.Equal(t, 1, md.ResourceMetrics().At(0).ScopeMetrics().Len()) + + metrics := md.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics() + require.Equal(t, 1, metrics.Len(), "Expected exactly one metric") + + metric := metrics.At(0) + assert.Equal(t, "system.memory.linux.shared", metric.Name()) + assert.Equal(t, pmetric.MetricTypeSum, metric.Type()) + + dataPoints := metric.Sum().DataPoints() + require.Equal(t, 1, dataPoints.Len(), "Expected exactly one data point") + + assert.GreaterOrEqual(t, dataPoints.At(0).IntValue(), int64(0)) + + _, hasState := dataPoints.At(0).Attributes().Get("state") + assert.False(t, hasState, "system.memory.shared should not have a state attribute") +} diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_test.go b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_test.go index 81a1a1576af0f..b378cc263f24a 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_test.go +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_test.go @@ -55,6 +55,9 @@ func TestScrape(t *testing.T) { SystemMemoryPageSize: metadata.MetricConfig{ Enabled: true, }, + SystemMemoryLinuxShared: metadata.MetricConfig{ + Enabled: true, + }, SystemLinuxMemoryAvailable: metadata.MetricConfig{ Enabled: true, }, @@ -66,7 +69,7 @@ func TestScrape(t *testing.T) { }, expectedMetricCount: func() int { if runtime.GOOS == "linux" { - return 5 + return 6 } return 3 }(), @@ -127,15 +130,22 @@ func TestScrape(t *testing.T) { metrics := md.ResourceMetrics().At(0).ScopeMetrics().At(0).Metrics() memUsageIdx := -1 + memSharedIdx := -1 for i := 0; i < md.MetricCount(); i++ { if metrics.At(i).Name() == "system.memory.usage" { memUsageIdx = i } + if metrics.At(i).Name() == "system.memory.linux.shared" { + memSharedIdx = i + } } assert.NotEqual(t, -1, memUsageIdx) assertMemoryUsageMetricValid(t, metrics.At(memUsageIdx), "system.memory.usage") if runtime.GOOS == "linux" { + if memSharedIdx != -1 { + assertMemorySharedMetricValid(t, metrics.At(memSharedIdx), "system.memory.linux.shared") + } assertMemoryUsageMetricHasLinuxSpecificStateLabels(t, metrics.At(memUsageIdx)) } else if runtime.GOOS != "windows" { internal.AssertSumMetricHasAttributeValue(t, metrics.At(memUsageIdx), 2, "state", @@ -202,6 +212,20 @@ func TestScrape_MemoryUtilization(t *testing.T) { } } +func assertMemorySharedMetricValid(t *testing.T, metric pmetric.Metric, expectedName string) { + assert.Equal(t, expectedName, metric.Name()) + assert.Equal(t, pmetric.MetricTypeSum, metric.Type()) + assert.Equal(t, "By", metric.Unit()) + assert.Equal(t, "Shared memory usage, including tmpfs filesystems and System V/POSIX shared memory. Only supported on Linux.", metric.Description()) + assert.False(t, metric.Sum().IsMonotonic(), "shared memory is not monotonic") + assert.Equal(t, pmetric.AggregationTemporalityCumulative, metric.Sum().AggregationTemporality()) + dataPoints := metric.Sum().DataPoints() + assert.Equal(t, 1, dataPoints.Len(), "should have exactly one data point (no state attribute)") + assert.GreaterOrEqual(t, dataPoints.At(0).IntValue(), int64(0), "shared memory should be non-negative") + _, hasState := dataPoints.At(0).Attributes().Get("state") + assert.False(t, hasState, "system.memory.shared should not have a state attribute") +} + func assertMemoryUsageMetricValid(t *testing.T, metric pmetric.Metric, expectedName string) { assert.Equal(t, expectedName, metric.Name()) assert.GreaterOrEqual(t, metric.Sum().DataPoints().Len(), 2) diff --git a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/metadata.yaml b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/metadata.yaml index 5089060e1b344..c4514b4d60b6f 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/metadata.yaml +++ b/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/metadata.yaml @@ -38,6 +38,7 @@ metrics: value_type: int aggregation_temporality: cumulative monotonic: false + system.memory.limit: enabled: false description: Total bytes of memory available. @@ -49,6 +50,17 @@ metrics: aggregation_temporality: cumulative monotonic: false + system.memory.linux.shared: + enabled: false + description: Shared memory usage, including tmpfs filesystems and System V/POSIX shared memory. Only supported on Linux. + unit: By + stability: + level: development + sum: + value_type: int + aggregation_temporality: cumulative + monotonic: false + system.memory.page_size: enabled: false description: A constant value for the system's configured page size.