Skip to content

Commit

Permalink
Merge branch 'main' into codeboten/proto-0.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Boten authored May 12, 2022
2 parents bae1e79 + a90d219 commit 4468bb4
Show file tree
Hide file tree
Showing 85 changed files with 357 additions and 361 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build-and-test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- name: Cache Go
uses: actions/cache@v3
env:
Expand Down
28 changes: 4 additions & 24 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand All @@ -34,6 +30,7 @@ jobs:
- name: Install Tools
if: steps.go-cache.outputs.cache-hit != 'true'
run: make install-tools

lint:
runs-on: ubuntu-latest
needs: [setup-environment]
Expand All @@ -44,10 +41,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand All @@ -71,10 +64,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand Down Expand Up @@ -111,6 +100,7 @@ jobs:
git diff -s --exit-code || (echo 'Generated code is out of date, please run "make genotelcorecol" and commit the changes in this PR.' && exit 1)
- name: Multimod verify
run: make multimod-verify

unittest:
strategy:
matrix:
Expand All @@ -124,10 +114,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand All @@ -143,6 +129,7 @@ jobs:
key: unittest-${{ runner.os }}-go-build-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
- name: Run Unit Tests
run: make gotest

test-coverage:
runs-on: ubuntu-latest
needs: [setup-environment]
Expand All @@ -153,10 +140,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand All @@ -178,6 +161,7 @@ jobs:
file: ./coverage.txt
fail_ci_if_error: true
verbose: true

cross-build-collector:
needs: [setup-environment]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -212,10 +196,6 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Setup Go Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand Down
21 changes: 9 additions & 12 deletions .github/workflows/builder-integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ on:
jobs:
integration-test:
name: Integration test
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Test
run: cd ./cmd/builder && ./test/test.sh
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Test
run: cd ./cmd/builder && ./test/test.sh
11 changes: 4 additions & 7 deletions .github/workflows/builder-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@ on:

jobs:
goreleaser:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.17
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser-pro
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ on:
jobs:
contrib_tests:
runs-on: ubuntu-latest
container:
image: cimg/go:1.17
steps:
- name: Setup Permissions
run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Run Contrib Tests
run: |
contrib_path=/tmp/opentelemetry-collector-contrib
Expand Down
32 changes: 30 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,44 @@

### 🛑 Breaking changes 🛑

- Remove `configunmarshaler.Unmarshaler` interface, per deprecation comment )#5348)
- Remove deprecated pdata funcs/structs from v0.50.0 (#5345)
- Remove derecated featuregate funcs/structs from v0.50.0 (#5346)

### 🚩 Deprecations 🚩

### 💡 Enhancements 💡

- Update OTLP to v0.17.0 (#5335)

### 🧰 Bug fixes 🧰

## v0.51.0 Beta

### 🛑 Breaking changes 🛑

- Remove deprecated model module, everything is available in `pdata` and `semconv`. (#5281)
- Old versions of the module are still available, but no new versions will be released.
- Remove deprecated LogRecord.Name field. (#5202)

### 🚩 Deprecations 🚩

- In preparation of migration to immutable slices for primitive type items, the following methods are renamed (#5344)
- `Value.BytesVal` func is deprecated in favor of `Value.MBytesVal`.
- `Value.SetBytesVal` func is deprecated in favor of `Value.SetMBytesVal`.
- `Value.UpdateBytes` func is deprecated in favor of `Value.UpdateMBytes`.
- `Value.InsertBytes` func is deprecated in favor of `Value.InsertMBytes`.
- `Value.UpsertBytes` func is deprecated in favor of `Value.UpsertMBytes`.
- `<HistogramDataPoint|Buckets>.BucketCounts` funcs are deprecated in favor of
`<HistogramDataPoint|Buckets>.MBucketCounts`.
- `<HistogramDataPoint|Buckets>.SetBucketCounts` funcs are deprecated in favor of
`<HistogramDataPoint|Buckets>.SetMBucketCounts`.
- `HistogramDataPoint.ExplicitBounds` func is deprecated in favor of `HistogramDataPoint.MExplicitBounds`.
- `HistogramDataPoint.SetExplicitBounds` func is deprecated in favor of `HistogramDataPoint.SetMExplicitBounds`.

### 💡 Enhancements 💡

- `pdata`: Expose `pcommon.NewSliceFromRay` and `pcommon.Slice.AsRaw` functions (#5298)
- Update OTLP to v0.17.0 (#5335)
- `pdata`: Expose `pcommon.NewSliceFromRaw` and `pcommon.Slice.AsRaw` functions (#5311)

### 🧰 Bug fixes 🧰

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 +361,5 @@ multimod-verify: install-tools

.PHONY: multimod-prerelease
multimod-prerelease: install-tools
multimod prerelease -v ./versions.yaml -m collector-base
multimod prerelease -v ./versions.yaml -m collector-core
$(MAKE) gotidy
2 changes: 1 addition & 1 deletion cmd/builder/internal/builder/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"go.uber.org/zap"
)

const defaultOtelColVersion = "0.50.0"
const defaultOtelColVersion = "0.51.0"

// ErrInvalidGoMod indicates an invalid gomod
var ErrInvalidGoMod = errors.New("invalid gomod specification for module")
Expand Down
20 changes: 10 additions & 10 deletions cmd/otelcorecol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ dist:
module: go.opentelemetry.io/collector/cmd/otelcorecol
name: otelcorecol
description: Local OpenTelemetry Collector binary, testing only.
version: 0.50.0-dev
otelcol_version: 0.50.0
version: 0.51.0-dev
otelcol_version: 0.51.0

receivers:
- import: go.opentelemetry.io/collector/receiver/otlpreceiver
gomod: go.opentelemetry.io/collector v0.50.0
gomod: go.opentelemetry.io/collector v0.51.0
exporters:
- import: go.opentelemetry.io/collector/exporter/loggingexporter
gomod: go.opentelemetry.io/collector v0.50.0
gomod: go.opentelemetry.io/collector v0.51.0
- import: go.opentelemetry.io/collector/exporter/otlpexporter
gomod: go.opentelemetry.io/collector v0.50.0
gomod: go.opentelemetry.io/collector v0.51.0
- import: go.opentelemetry.io/collector/exporter/otlphttpexporter
gomod: go.opentelemetry.io/collector v0.50.0
gomod: go.opentelemetry.io/collector v0.51.0
extensions:
- import: go.opentelemetry.io/collector/extension/ballastextension
gomod: go.opentelemetry.io/collector v0.50.0
gomod: go.opentelemetry.io/collector v0.51.0
- import: go.opentelemetry.io/collector/extension/zpagesextension
gomod: go.opentelemetry.io/collector v0.50.0
gomod: go.opentelemetry.io/collector v0.51.0
processors:
- import: go.opentelemetry.io/collector/processor/batchprocessor
gomod: go.opentelemetry.io/collector v0.50.0
gomod: go.opentelemetry.io/collector v0.51.0
- import: go.opentelemetry.io/collector/processor/memorylimiterprocessor
gomod: go.opentelemetry.io/collector v0.50.0
gomod: go.opentelemetry.io/collector v0.51.0

replaces:
- go.opentelemetry.io/collector => ../../
Expand Down
6 changes: 3 additions & 3 deletions cmd/otelcorecol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go 1.17

require (
github.com/stretchr/testify v1.7.1
go.opentelemetry.io/collector v0.50.0
go.opentelemetry.io/collector v0.51.0
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27
)

Expand Down Expand Up @@ -55,8 +55,8 @@ require (
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/collector/pdata v0.50.0 // indirect
go.opentelemetry.io/collector/semconv v0.50.0 // indirect
go.opentelemetry.io/collector/pdata v0.51.0 // indirect
go.opentelemetry.io/collector/semconv v0.51.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.32.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 // indirect
go.opentelemetry.io/contrib/zpages v0.32.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion cmd/otelcorecol/main.go

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

26 changes: 11 additions & 15 deletions config/configtelemetry/configtelemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,26 @@ func (l Level) String() string {
return "unknown"
}

// UnmarshalText unmarshals text to a Level.
// UnmarshalText unmarshalls text to a Level.
func (l *Level) UnmarshalText(text []byte) error {
if l == nil {
return fmt.Errorf("cannot unmarshal to a nil *Level")
}
var err error
*l, err = parseLevel(string(text))
return err
}

// parseLevel returns the Level represented by the string. The parsing is case-insensitive
// and it returns error if the string value is unknown.
func parseLevel(str string) (Level, error) {
str = strings.ToLower(str)

str := strings.ToLower(string(text))
switch str {
case levelNoneStr:
return LevelNone, nil
*l = LevelNone
return nil
case levelBasicStr:
return LevelBasic, nil
*l = LevelBasic
return nil
case levelNormalStr:
return LevelNormal, nil
*l = LevelNormal
return nil
case levelDetailedStr:
return LevelDetailed, nil
*l = LevelDetailed
return nil
}
return LevelNone, fmt.Errorf("unknown metrics level %q", str)
return fmt.Errorf("unknown metrics level %q", str)
}
12 changes: 9 additions & 3 deletions config/configtelemetry/configtelemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestParseFrom(t *testing.T) {
func TestUnmarshalText(t *testing.T) {
tests := []struct {
str string
level Level
Expand Down Expand Up @@ -56,17 +56,23 @@ func TestParseFrom(t *testing.T) {

for _, test := range tests {
t.Run(test.str, func(t *testing.T) {
lvl, err := parseLevel(test.str)
var lvl Level
err := lvl.UnmarshalText([]byte(test.str))
if test.err {
assert.Error(t, err)
} else {
assert.NoError(t, err)
assert.Equal(t, test.level, lvl)
}
assert.Equal(t, test.level, lvl)
})
}
}

func TestUnmarshalTextNilLevel(t *testing.T) {
lvl := (*Level)(nil)
assert.Error(t, lvl.UnmarshalText([]byte(levelNormalStr)))
}

func TestLevelString(t *testing.T) {
tests := []struct {
str string
Expand Down
Loading

0 comments on commit 4468bb4

Please sign in to comment.