diff --git a/.chloggen/run_actuated.yaml b/.chloggen/run_actuated.yaml new file mode 100644 index 000000000000..9c9f911f4fc5 --- /dev/null +++ b/.chloggen/run_actuated.yaml @@ -0,0 +1,27 @@ +# 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. filelogreceiver) +component: all + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add support for ARM build + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [12920] + +# (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: + +# 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: [] diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2db490c3471f..5b4ef5349296 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -243,6 +243,7 @@ jobs: strategy: matrix: go-version: ["1.22.0", "1.21.9"] # 1.20 is interpreted as 1.2 without quotes + runner: [ubuntu-latest, actuated-arm64-4cpu-4gb] group: - receiver-0 - receiver-1 @@ -258,9 +259,16 @@ jobs: - cmd-0 - cmd-1 - other - runs-on: ubuntu-latest + runs-on: ${{ matrix.runner }} needs: [setup-environment] steps: + - name: Set up arkade + uses: alexellis/setup-arkade@v3 + - name: Install vmmeter + run: | + sudo -E arkade oci install ghcr.io/openfaasltd/vmmeter:latest --path /usr/local/bin/ + - name: Run vmmeter + uses: self-actuated/vmmeter-action@v1 - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: @@ -274,7 +282,7 @@ jobs: path: | ~/go/bin ~/go/pkg/mod - key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} + key: go-cache-${{ runner.os }}-${{ matrix.runner }}-${{ hashFiles('**/go.sum') }} - name: Install dependencies if: steps.go-cache.outputs.cache-hit != 'true' run: make -j2 gomoddownload @@ -285,7 +293,7 @@ jobs: uses: actions/cache@v4 with: path: ~/.cache/go-build - key: go-test-build-${{ runner.os }}-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} + key: go-test-build-${{ runner.os }}-${{ matrix.go-version }}-${{ matrix.runner }}-${{ hashFiles('**/go.sum') }} - name: Run Unit Tests if: startsWith( matrix.go-version, '1.21' ) != true run: make gotest GROUP=${{ matrix.group }} @@ -295,7 +303,7 @@ jobs: - uses: actions/upload-artifact@v4 if: startsWith( matrix.go-version, '1.21' ) # only upload artifact for one version with: - name: coverage-artifacts-${{ matrix.go-version }}-${{ matrix.group }} + name: coverage-artifacts-${{ matrix.go-version }}-${{ matrix.runner }}-${{ matrix.group }} path: ${{ matrix.group }}-coverage.txt unittest: if: ${{ github.actor != 'dependabot[bot]' && always() }} diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index fd50c219a473..ec05c45aaf87 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -44,6 +44,7 @@ extensions: exporters: - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.97.1-0.20240404121116-4f1a8936d26b + - gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.97.1-0.20240404121116-4f1a8936d26b - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.97.1-0.20240404121116-4f1a8936d26b - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.97.1-0.20240404121116-4f1a8936d26b - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alertmanagerexporter v0.97.0 @@ -116,6 +117,7 @@ processors: - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/remotetapprocessor v0.97.0 receivers: + - gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.97.1-0.20240404121116-4f1a8936d26b - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.1-0.20240404121116-4f1a8936d26b - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/activedirectorydsreceiver v0.97.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/aerospikereceiver v0.97.0 diff --git a/cmd/otelcontribcol/components.go b/cmd/otelcontribcol/components.go index 53f8be8576c4..62cb58b6d5a4 100644 --- a/cmd/otelcontribcol/components.go +++ b/cmd/otelcontribcol/components.go @@ -7,6 +7,7 @@ import ( forwardconnector "go.opentelemetry.io/collector/connector/forwardconnector" "go.opentelemetry.io/collector/exporter" debugexporter "go.opentelemetry.io/collector/exporter/debugexporter" + nopexporter "go.opentelemetry.io/collector/exporter/nopexporter" otlpexporter "go.opentelemetry.io/collector/exporter/otlpexporter" otlphttpexporter "go.opentelemetry.io/collector/exporter/otlphttpexporter" "go.opentelemetry.io/collector/extension" @@ -17,6 +18,7 @@ import ( batchprocessor "go.opentelemetry.io/collector/processor/batchprocessor" memorylimiterprocessor "go.opentelemetry.io/collector/processor/memorylimiterprocessor" "go.opentelemetry.io/collector/receiver" + nopreceiver "go.opentelemetry.io/collector/receiver/nopreceiver" otlpreceiver "go.opentelemetry.io/collector/receiver/otlpreceiver" countconnector "github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector" @@ -247,6 +249,7 @@ func components() (otelcol.Factories, error) { } factories.Receivers, err = receiver.MakeFactoryMap( + nopreceiver.NewFactory(), otlpreceiver.NewFactory(), activedirectorydsreceiver.NewFactory(), aerospikereceiver.NewFactory(), @@ -341,6 +344,7 @@ func components() (otelcol.Factories, error) { factories.Exporters, err = exporter.MakeFactoryMap( debugexporter.NewFactory(), + nopexporter.NewFactory(), otlpexporter.NewFactory(), otlphttpexporter.NewFactory(), alertmanagerexporter.NewFactory(), diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 7f4646458126..c54b24895882 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -205,6 +205,7 @@ require ( go.opentelemetry.io/collector/consumer v0.97.1-0.20240404121116-4f1a8936d26b go.opentelemetry.io/collector/exporter v0.97.1-0.20240404121116-4f1a8936d26b go.opentelemetry.io/collector/exporter/debugexporter v0.97.1-0.20240404121116-4f1a8936d26b + go.opentelemetry.io/collector/exporter/nopexporter v0.97.1-0.20240404121116-4f1a8936d26b go.opentelemetry.io/collector/exporter/otlpexporter v0.97.1-0.20240404121116-4f1a8936d26b go.opentelemetry.io/collector/exporter/otlphttpexporter v0.97.1-0.20240404121116-4f1a8936d26b go.opentelemetry.io/collector/extension v0.97.1-0.20240404121116-4f1a8936d26b @@ -216,6 +217,7 @@ require ( go.opentelemetry.io/collector/processor/batchprocessor v0.97.1-0.20240404121116-4f1a8936d26b go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.97.1-0.20240404121116-4f1a8936d26b go.opentelemetry.io/collector/receiver v0.97.1-0.20240404121116-4f1a8936d26b + go.opentelemetry.io/collector/receiver/nopreceiver v0.97.1-0.20240404121116-4f1a8936d26b go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.1-0.20240404121116-4f1a8936d26b golang.org/x/sys v0.18.0 ) diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 04e3cb213ef7..67f76ccdddf0 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -1700,6 +1700,8 @@ go.opentelemetry.io/collector/exporter v0.97.1-0.20240404121116-4f1a8936d26b h1: go.opentelemetry.io/collector/exporter v0.97.1-0.20240404121116-4f1a8936d26b/go.mod h1:Oq6SCLx9tQch5zeleIkhUw/e2g16+yQkyztCHsAHKNU= go.opentelemetry.io/collector/exporter/debugexporter v0.97.1-0.20240404121116-4f1a8936d26b h1:peaYUYJQuzSDBH0bbjDaFxep/qut+VY8eSa28OPOjsE= go.opentelemetry.io/collector/exporter/debugexporter v0.97.1-0.20240404121116-4f1a8936d26b/go.mod h1:bD14O9UdbCLRMllSqObkA1klraPHe0GWmw4QUBxNH2g= +go.opentelemetry.io/collector/exporter/nopexporter v0.97.1-0.20240404121116-4f1a8936d26b h1:rZh/w8ojf9blIcWEhE0UHTVAEsJTLtrHJpWcNO9Nm6M= +go.opentelemetry.io/collector/exporter/nopexporter v0.97.1-0.20240404121116-4f1a8936d26b/go.mod h1:qtQNvmDdzQZU2iPiVxcip8wnL1W13qIQSZ4wJeGR/3I= go.opentelemetry.io/collector/exporter/otlpexporter v0.97.1-0.20240404121116-4f1a8936d26b h1:jv6wp8Muswbz/iS62KGDNUZx2GSBsnL9zL2RAQDQTxw= go.opentelemetry.io/collector/exporter/otlpexporter v0.97.1-0.20240404121116-4f1a8936d26b/go.mod h1:d0SAS68CUbHU+GKOrzMlGMWCsRfn8a9Rh8AUOHxC+xk= go.opentelemetry.io/collector/exporter/otlphttpexporter v0.97.1-0.20240404121116-4f1a8936d26b h1:rkbtSTjRgfd9eR/UdSMJJr4QtMoRLGqD3AvLffcqIZg= @@ -1726,6 +1728,8 @@ go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.97.1-0.2024040 go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.97.1-0.20240404121116-4f1a8936d26b/go.mod h1:JVGUkc1eFmFDBGqr94dl+dqF2FFPe7LeBeWGvJiFWmM= go.opentelemetry.io/collector/receiver v0.97.1-0.20240404121116-4f1a8936d26b h1:d9xejxpSk5O46aM1X5nUb1qGQl1ToGQJy39csqnYl7c= go.opentelemetry.io/collector/receiver v0.97.1-0.20240404121116-4f1a8936d26b/go.mod h1:oj/eoc8Wf9u82gaPeRVdHmFbJ5e3m5F1v5CFTpjiVFU= +go.opentelemetry.io/collector/receiver/nopreceiver v0.97.1-0.20240404121116-4f1a8936d26b h1:TUyh1x/8AOYlvVT+XdEaYgXFy6o0HblIpZI4DMqUoCU= +go.opentelemetry.io/collector/receiver/nopreceiver v0.97.1-0.20240404121116-4f1a8936d26b/go.mod h1:9jA/NNzLD6vSc7DnvjSROsyXahyAP+KvBv00NfXDvus= go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.1-0.20240404121116-4f1a8936d26b h1:2BGhGCTz/u8belzwCsUyvrCUd6LOq86Imhjs9KFLSIQ= go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.1-0.20240404121116-4f1a8936d26b/go.mod h1:7iMRy+V3iGQS7Jg9YyN1SzIcE3QwNOF4hD32M6SgZ9s= go.opentelemetry.io/collector/semconv v0.97.1-0.20240404121116-4f1a8936d26b h1:2ApIgbCJPzABy6TDKlc9b55J/zo6ixAIMPvIUC2nB9U= diff --git a/pkg/stanza/operator/helper/time.go b/pkg/stanza/operator/helper/time.go index f9326c73dd18..158fffc8bee7 100644 --- a/pkg/stanza/operator/helper/time.go +++ b/pkg/stanza/operator/helper/time.go @@ -31,7 +31,7 @@ const NativeKey = "native" // provided for operator development // NewTimeParser creates a new time parser with default values func NewTimeParser() TimeParser { return TimeParser{ - LayoutType: "strptime", + LayoutType: StrptimeKey, } } diff --git a/receiver/hostmetricsreceiver/hostmetrics_receiver_test.go b/receiver/hostmetricsreceiver/hostmetrics_receiver_test.go index 1c4e1620aaef..4523923fa6ef 100644 --- a/receiver/hostmetricsreceiver/hostmetrics_receiver_test.go +++ b/receiver/hostmetricsreceiver/hostmetrics_receiver_test.go @@ -36,7 +36,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/processscraper" ) -var standardMetrics = []string{ +var armMetrics = []string{ "system.cpu.time", "system.cpu.load_average.1m", "system.cpu.load_average.5m", @@ -54,7 +54,11 @@ var standardMetrics = []string{ "system.network.io", "system.network.packets", "system.paging.operations", - "system.paging.usage", +} + +var archSpecificMetrics = map[string][]string{ + "arm64": armMetrics, + "amd64": append(armMetrics, "system.paging.usage"), } var resourceMetrics = []string{ @@ -170,7 +174,7 @@ func assertIncludesExpectedMetrics(t *testing.T, got pmetric.Metrics) { // verify the expected list of metrics returned (os dependent) var expectedMetrics []string - expectedMetrics = append(expectedMetrics, standardMetrics...) + expectedMetrics = append(expectedMetrics, archSpecificMetrics[runtime.GOARCH]...) expectedMetrics = append(expectedMetrics, systemSpecificMetrics[runtime.GOOS]...) assert.Equal(t, len(expectedMetrics), len(returnedMetrics)) for _, expected := range expectedMetrics { diff --git a/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/paging_scraper_test.go b/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/paging_scraper_test.go index 81b89edcd546..ebb792c08b3e 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/paging_scraper_test.go +++ b/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/paging_scraper_test.go @@ -82,6 +82,10 @@ func TestScrape(t *testing.T) { if runtime.GOOS == "windows" { expectedMetrics = 3 } + // ARM runner has no swap: + if runtime.GOARCH == "arm64" { + expectedMetrics = 2 + } assert.Equal(t, expectedMetrics, md.MetricCount()) @@ -96,11 +100,12 @@ func TestScrape(t *testing.T) { internal.AssertSameTimeStampForMetrics(t, metrics, 0, metrics.Len()-2) startIndex++ - - assertPagingUsageMetricValid(t, metrics.At(startIndex)) - internal.AssertSameTimeStampForMetrics(t, metrics, startIndex, metrics.Len()) - startIndex++ - assertPagingUtilizationMetricValid(t, metrics.At(startIndex)) + if runtime.GOARCH != "arm64" { + assertPagingUsageMetricValid(t, metrics.At(startIndex)) + internal.AssertSameTimeStampForMetrics(t, metrics, startIndex, metrics.Len()) + startIndex++ + assertPagingUtilizationMetricValid(t, metrics.At(startIndex)) + } }) } }