diff --git a/opamp/observiq/logger.go b/opamp/observiq/logger.go deleted file mode 100644 index 8f7fa3424..000000000 --- a/opamp/observiq/logger.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright observIQ, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package observiq - -import ( - "context" - - "github.com/open-telemetry/opamp-go/client/types" - "go.uber.org/zap" -) - -type zapOpAMPLoggerAdapter struct { - logger *zap.SugaredLogger -} - -var _ types.Logger = (*zapOpAMPLoggerAdapter)(nil) - -func newZapOpAMPLoggerAdapter(logger *zap.Logger) *zapOpAMPLoggerAdapter { - return &zapOpAMPLoggerAdapter{ - logger: logger.Sugar(), - } -} - -func (o zapOpAMPLoggerAdapter) Debugf(_ context.Context, format string, v ...any) { - o.logger.Debugf(format, v...) -} - -func (o zapOpAMPLoggerAdapter) Errorf(_ context.Context, format string, v ...any) { - o.logger.Errorf(format, v...) -} diff --git a/opamp/observiq/measurements.go b/opamp/observiq/measurements.go deleted file mode 100644 index 0a26c516e..000000000 --- a/opamp/observiq/measurements.go +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright observIQ, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package observiq - -import ( - "errors" - "sync" - "time" - - "github.com/golang/snappy" - "github.com/observiq/bindplane-agent/internal/measurements" - "github.com/open-telemetry/opamp-go/client" - "github.com/open-telemetry/opamp-go/client/types" - "github.com/open-telemetry/opamp-go/protobufs" - "go.opentelemetry.io/collector/pdata/pmetric" - "go.uber.org/zap" -) - -const maxSendRetries = 3 - -// MeasurementsReporter represents an object that reports throughput measurements as OTLP. -type MeasurementsReporter interface { - OTLPMeasurements(extraAttributes map[string]string) pmetric.Metrics -} - -// measurementsSender is a struct that handles periodically sending measurements via a custom message to an OpAMP endpoint. -type measurementsSender struct { - logger *zap.Logger - reporter MeasurementsReporter - opampClient client.OpAMPClient - interval time.Duration - extraAttributes map[string]string - - changeIntervalChan chan time.Duration - changeAttributesChan chan map[string]string - - mux *sync.Mutex - isRunning bool - done chan struct{} - wg *sync.WaitGroup -} - -func newMeasurementsSender(l *zap.Logger, reporter MeasurementsReporter, opampClient client.OpAMPClient, interval time.Duration, extraAttributes map[string]string) *measurementsSender { - return &measurementsSender{ - logger: l, - reporter: reporter, - opampClient: opampClient, - interval: interval, - extraAttributes: extraAttributes, - - changeIntervalChan: make(chan time.Duration, 1), - changeAttributesChan: make(chan map[string]string, 1), - mux: &sync.Mutex{}, - isRunning: false, - done: make(chan struct{}), - wg: &sync.WaitGroup{}, - } -} - -// Start starts the sender. It may be called multiple times, even if the sender is already started. -func (m *measurementsSender) Start() { - m.mux.Lock() - defer m.mux.Unlock() - - if m.isRunning { - return - } - - m.isRunning = true - - m.wg.Add(1) - go func() { - defer m.wg.Done() - m.loop() - }() -} - -// SetInterval changes the interval of the measurements sender. -func (m measurementsSender) SetInterval(d time.Duration) { - select { - case m.changeIntervalChan <- d: - case <-m.done: - } - -} - -func (m measurementsSender) SetExtraAttributes(extraAttributes map[string]string) { - select { - case m.changeAttributesChan <- extraAttributes: - case <-m.done: - } -} - -func (m *measurementsSender) Stop() { - m.mux.Lock() - defer m.mux.Unlock() - - if !m.isRunning { - return - } - - close(m.done) - m.wg.Wait() - - m.isRunning = false -} - -func (m *measurementsSender) loop() { - t := newTicker() - t.SetInterval(m.interval) - defer t.Stop() - - for { - select { - case newInterval := <-m.changeIntervalChan: - m.interval = newInterval - t.SetInterval(newInterval) - case newAttributes := <-m.changeAttributesChan: - m.extraAttributes = newAttributes - case <-m.done: - return - case <-t.Chan(): - if m.reporter == nil { - // Continue if no reporter available - m.logger.Debug("No reporter, skipping sending measurements.") - continue - } - - metrics := m.reporter.OTLPMeasurements(m.extraAttributes) - if metrics.DataPointCount() == 0 { - // don't report empty payloads - continue - } - - // Send metrics as snappy-encoded otlp proto - marshaller := pmetric.ProtoMarshaler{} - marshalled, err := marshaller.MarshalMetrics(metrics) - if err != nil { - m.logger.Error("Failed to marshal throughput metrics.", zap.Error(err)) - continue - } - - encoded := snappy.Encode(nil, marshalled) - - cm := &protobufs.CustomMessage{ - Capability: measurements.ReportMeasurementsV1Capability, - Type: measurements.ReportMeasurementsType, - Data: encoded, - } - - for i := 0; i < maxSendRetries; i++ { - sendingChannel, err := m.opampClient.SendCustomMessage(cm) - switch { - case err == nil: // OK - case errors.Is(err, types.ErrCustomMessagePending): - if i == maxSendRetries-1 { - // Bail out early, since we aren't going to try to send again - m.logger.Warn("Measurements were blocked by other custom messages, skipping...", zap.Int("retries", maxSendRetries)) - break - } - - select { - case <-sendingChannel: - continue - case <-m.done: - return - } - default: - m.logger.Error("Failed to report measurements", zap.Error(err)) - } - break - } - } - } -} - -// ticker is essentially time.ticker, but it provides a SetInterval method -// that allows the interval to be changed. It also allows the interval -// to be configured to a negative or zero duration, in which case the ticker -// never fires. -type ticker struct { - duration time.Duration - ticker *time.Ticker -} - -func newTicker() *ticker { - return &ticker{} -} - -func (t *ticker) SetInterval(d time.Duration) { - if t.duration == d { - // Nothing to do, this is already the interval - return - } - - t.duration = d - - if t.ticker != nil { - t.ticker.Stop() - t.ticker = nil - } - - if d <= 0 { - // Cannot make a ticker with zero or negative duration; - // Attempts to use the channel will give a permanently blocking channel. - return - } - - t.ticker = time.NewTicker(d) -} - -func (t *ticker) Chan() <-chan time.Time { - if t.ticker == nil { - // ticker never triggers if 0 or negative duration - return make(<-chan time.Time) - } - return t.ticker.C -} - -func (t *ticker) Stop() { - if t.ticker != nil { - t.ticker.Stop() - t.ticker = nil - } -} diff --git a/opamp/observiq/measurements_test.go b/opamp/observiq/measurements_test.go deleted file mode 100644 index 7ee7b1b56..000000000 --- a/opamp/observiq/measurements_test.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright observIQ, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package observiq - -import ( - "context" - "path/filepath" - "testing" - "time" - - "github.com/golang/snappy" - "github.com/observiq/bindplane-agent/internal/measurements" - "github.com/observiq/bindplane-agent/opamp/mocks" - "github.com/open-telemetry/opamp-go/protobufs" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/pdata/pmetric" - "go.opentelemetry.io/otel/sdk/metric" - "go.uber.org/zap" -) - -func TestMeasurementsSender(t *testing.T) { - t.Run("Test emits metrics", func(t *testing.T) { - dataChan := make(chan []byte, 1) - client := mocks.NewMockOpAMPClient(t) - client.On("SendCustomMessage", mock.Anything).Run(func(args mock.Arguments) { - cm := args.Get(0).(*protobufs.CustomMessage) - select { - case dataChan <- cm.Data: - default: - } - - }).Return(make(chan struct{}), nil) - - mp := metric.NewMeterProvider() - defer mp.Shutdown(context.Background()) - - processorID := "throughputmeasurement/1" - - tm, err := measurements.NewThroughputMeasurements(mp, processorID, map[string]string{}) - require.NoError(t, err) - - m, err := golden.ReadMetrics(filepath.Join("testdata", "metrics", "host-metrics.yaml")) - require.NoError(t, err) - - tm.AddMetrics(context.Background(), m) - - reg := measurements.NewResettableThroughputMeasurementsRegistry(false) - require.NoError(t, reg.RegisterThroughputMeasurements(processorID, tm)) - - ms := newMeasurementsSender(zap.NewNop(), reg, client, 1*time.Millisecond, nil) - ms.Start() - - select { - case <-time.After(1 * time.Second): - require.FailNow(t, "timed out waiting for metrics payload") - case d := <-dataChan: - decoded, err := snappy.Decode(nil, d) - require.NoError(t, err) - - um := &pmetric.ProtoUnmarshaler{} - actualMetrics, err := um.UnmarshalMetrics(decoded) - require.NoError(t, err) - - expectedMetrics, err := golden.ReadMetrics(filepath.Join("testdata", "metrics", "expected-throughput.yaml")) - require.NoError(t, err) - - require.NoError(t, pmetrictest.CompareMetrics(expectedMetrics, actualMetrics, pmetrictest.IgnoreTimestamp())) - } - - ms.Stop() - }) - - t.Run("Test set interval", func(t *testing.T) { - dataChan := make(chan []byte, 1) - client := mocks.NewMockOpAMPClient(t) - client.On("SendCustomMessage", mock.Anything).Run(func(args mock.Arguments) { - cm := args.Get(0).(*protobufs.CustomMessage) - select { - case dataChan <- cm.Data: - default: - } - }).Return(make(chan struct{}), nil) - - mp := metric.NewMeterProvider() - defer mp.Shutdown(context.Background()) - - processorID := "throughputmeasurement/1" - - tm, err := measurements.NewThroughputMeasurements(mp, processorID, map[string]string{}) - require.NoError(t, err) - - m, err := golden.ReadMetrics(filepath.Join("testdata", "metrics", "host-metrics.yaml")) - require.NoError(t, err) - - tm.AddMetrics(context.Background(), m) - - reg := measurements.NewResettableThroughputMeasurementsRegistry(false) - reg.RegisterThroughputMeasurements(processorID, tm) - - ms := newMeasurementsSender(zap.NewNop(), reg, client, 5*time.Hour, nil) - ms.Start() - - // Wait 200 ms and ensure no data emitted - time.Sleep(200 * time.Millisecond) - - require.Len(t, dataChan, 0) - - // Set time to 1ms. We should see data emit quickly after. - ms.SetInterval(1 * time.Millisecond) - - select { - case <-time.After(1 * time.Second): - require.FailNow(t, "timed out waiting for metrics payload") - case d := <-dataChan: - decoded, err := snappy.Decode(nil, d) - require.NoError(t, err) - - um := &pmetric.ProtoUnmarshaler{} - actualMetrics, err := um.UnmarshalMetrics(decoded) - require.NoError(t, err) - - expectedMetrics, err := golden.ReadMetrics(filepath.Join("testdata", "metrics", "expected-throughput.yaml")) - require.NoError(t, err) - - require.NoError(t, pmetrictest.CompareMetrics(expectedMetrics, actualMetrics, pmetrictest.IgnoreTimestamp())) - } - - ms.Stop() - }) -} diff --git a/opamp/observiq/testdata/metrics/expected-throughput.yaml b/opamp/observiq/testdata/metrics/expected-throughput.yaml deleted file mode 100644 index b6b04f3b6..000000000 --- a/opamp/observiq/testdata/metrics/expected-throughput.yaml +++ /dev/null @@ -1,14 +0,0 @@ -resourceMetrics: - - resource: {} - scopeMetrics: - - metrics: - - name: otelcol_processor_throughputmeasurement_metric_data_size - sum: - dataPoints: - - asInt: "5675" - attributes: - - key: processor - value: - stringValue: throughputmeasurement/1 - timeUnixNano: "1000000" - scope: {} diff --git a/opamp/observiq/testdata/metrics/host-metrics.yaml b/opamp/observiq/testdata/metrics/host-metrics.yaml deleted file mode 100644 index d42978181..000000000 --- a/opamp/observiq/testdata/metrics/host-metrics.yaml +++ /dev/null @@ -1,737 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: host.name - value: - stringValue: Brandons-Awesome-Linux-Machine - - key: os.type - value: - stringValue: linux - - key: extra-resource-attr-key - value: - stringValue: extra-resource-attr-value - schemaUrl: https://opentelemetry.io/schemas/1.9.0 - scopeMetrics: - - metrics: - - description: Average CPU Load over 1 minute. - gauge: - dataPoints: - - asDouble: 3.71484375 - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - attributes: - - key: cool-attribute-key - value: - stringValue: cool-attribute-value - name: system.cpu.load_average.1m - unit: "{thread}" - scope: - name: otelcol/hostmetricsreceiver/load - version: v1.43.0 - - resource: - attributes: - - key: host.name - value: - stringValue: Brandons-MBP - - key: os.type - value: - stringValue: darwin - schemaUrl: https://opentelemetry.io/schemas/1.9.0 - scopeMetrics: - - metrics: - - description: Filesystem bytes used. - name: system.filesystem.usage - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "503869440" - attributes: - - key: device - value: - stringValue: /dev/disk2s1 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/iSCPreboot - - key: state - value: - stringValue: free - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: /dev/disk2s1 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/iSCPreboot - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "20418560" - attributes: - - key: device - value: - stringValue: /dev/disk2s1 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/iSCPreboot - - key: state - value: - stringValue: used - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "503869440" - attributes: - - key: device - value: - stringValue: /dev/disk2s2 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/xarts - - key: state - value: - stringValue: free - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: /dev/disk2s2 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/xarts - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "20418560" - attributes: - - key: device - value: - stringValue: /dev/disk2s2 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/xarts - - key: state - value: - stringValue: used - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "503869440" - attributes: - - key: device - value: - stringValue: /dev/disk2s3 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Hardware - - key: state - value: - stringValue: free - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: /dev/disk2s3 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Hardware - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "20418560" - attributes: - - key: device - value: - stringValue: /dev/disk2s3 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Hardware - - key: state - value: - stringValue: used - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "342134198272" - attributes: - - key: device - value: - stringValue: /dev/disk3s1s1 - - key: mode - value: - stringValue: ro - - key: mountpoint - value: - stringValue: / - - key: state - value: - stringValue: free - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: /dev/disk3s1s1 - - key: mode - value: - stringValue: ro - - key: mountpoint - value: - stringValue: / - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "152250597376" - attributes: - - key: device - value: - stringValue: /dev/disk3s1s1 - - key: mode - value: - stringValue: ro - - key: mountpoint - value: - stringValue: / - - key: state - value: - stringValue: used - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "342134198272" - attributes: - - key: device - value: - stringValue: /dev/disk3s2 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Preboot - - key: state - value: - stringValue: free - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: /dev/disk3s2 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Preboot - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "152250597376" - attributes: - - key: device - value: - stringValue: /dev/disk3s2 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Preboot - - key: state - value: - stringValue: used - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "342134198272" - attributes: - - key: device - value: - stringValue: /dev/disk3s4 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Update - - key: state - value: - stringValue: free - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: /dev/disk3s4 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Update - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "152250597376" - attributes: - - key: device - value: - stringValue: /dev/disk3s4 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Update - - key: state - value: - stringValue: used - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "342134198272" - attributes: - - key: device - value: - stringValue: /dev/disk3s5 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Data - - key: state - value: - stringValue: free - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: /dev/disk3s5 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Data - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "152250597376" - attributes: - - key: device - value: - stringValue: /dev/disk3s5 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Data - - key: state - value: - stringValue: used - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "342134198272" - attributes: - - key: device - value: - stringValue: /dev/disk3s6 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/VM - - key: state - value: - stringValue: free - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: /dev/disk3s6 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/VM - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "152250597376" - attributes: - - key: device - value: - stringValue: /dev/disk3s6 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/VM - - key: state - value: - stringValue: used - - key: type - value: - stringValue: apfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "8717185024" - attributes: - - key: extra-sum-attr-key - value: - stringValue: extra-sum-attr-value - - key: device - value: - stringValue: /dev/disk4s1 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /Volumes/transfer - - key: state - value: - stringValue: free - - key: type - value: - stringValue: hfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: /dev/disk4s1 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /Volumes/transfer - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: hfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "7409389568" - attributes: - - key: device - value: - stringValue: /dev/disk4s1 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /Volumes/transfer - - key: state - value: - stringValue: used - - key: type - value: - stringValue: hfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "14336" - attributes: - - key: device - value: - stringValue: /dev/disk4s2 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /Volumes/UEFI_NTFS - - key: state - value: - stringValue: free - - key: type - value: - stringValue: msdos - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: /dev/disk4s2 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /Volumes/UEFI_NTFS - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: msdos - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "493568" - attributes: - - key: device - value: - stringValue: /dev/disk4s2 - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /Volumes/UEFI_NTFS - - key: state - value: - stringValue: used - - key: type - value: - stringValue: msdos - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: devfs - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /dev - - key: state - value: - stringValue: free - - key: type - value: - stringValue: devfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: devfs - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /dev - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: devfs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "220672" - attributes: - - key: device - value: - stringValue: devfs - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /dev - - key: state - value: - stringValue: used - - key: type - value: - stringValue: devfs - startTimeUnixNano: "1000000" - timeUnixNano: "3000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: map auto_home - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Data/home - - key: state - value: - stringValue: free - - key: type - value: - stringValue: autofs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: map auto_home - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Data/home - - key: state - value: - stringValue: reserved - - key: type - value: - stringValue: autofs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - - asInt: "0" - attributes: - - key: device - value: - stringValue: map auto_home - - key: mode - value: - stringValue: rw - - key: mountpoint - value: - stringValue: /System/Volumes/Data/home - - key: state - value: - stringValue: used - - key: type - value: - stringValue: autofs - startTimeUnixNano: "1000000" - timeUnixNano: "2000000" - unit: By - scope: - name: otelcol/hostmetricsreceiver/filesystem - version: v1.43.0