Skip to content

Commit

Permalink
Merge branch 'main' into balance-metrics-by-resources
Browse files Browse the repository at this point in the history
  • Loading branch information
SHaaD94 authored Apr 9, 2024
2 parents db57263 + 78d1718 commit 9df70f1
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 13 deletions.
27 changes: 27 additions & 0 deletions .chloggen/run_actuated.yaml
Original file line number Diff line number Diff line change
@@ -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: []
16 changes: 12 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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() }}
Expand Down
2 changes: 2 additions & 0 deletions cmd/otelcontribcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions cmd/otelcontribcol/components.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
)
Expand Down
4 changes: 4 additions & 0 deletions cmd/otelcontribcol/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/stanza/operator/helper/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
10 changes: 7 additions & 3 deletions receiver/hostmetricsreceiver/hostmetrics_receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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{
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand All @@ -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))
}
})
}
}
Expand Down

0 comments on commit 9df70f1

Please sign in to comment.