Skip to content
This repository was archived by the owner on Oct 29, 2021. It is now read-only.

Commit 16563b6

Browse files
authored
Update to Collector v0.28.0 (#49)
* Update to Collector v0.28.0 Closes #48 Addresses the breaking API change in open-telemetry/opentelemetry-collector#3163, besides the usual version number changes. Signed-off-by: Fangyi Zhou <[email protected]> * Use `go mod tidy` instead of `go mod download` It appears that this magically resolves the go.mod file issue. https://stackoverflow.com/questions/67203641/missing-go-sum-entry-for-module-providing-package-package-name Signed-off-by: Fangyi Zhou <[email protected]>
1 parent 78e8560 commit 16563b6

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given
88
$ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder
99
$ cat > ~/.otelcol-builder.yaml <<EOF
1010
exporters:
11-
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.27.0"
11+
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.28.0"
1212
EOF
1313
$ opentelemetry-collector-builder --output-path=/tmp/dist
1414
$ cat > /tmp/otelcol.yaml <<EOF
@@ -73,16 +73,16 @@ dist:
7373
name: otelcol-custom # the binary name. Optional.
7474
description: "Custom OpenTelemetry Collector distribution" # a long name for the application. Optional.
7575
include_core: true # whether the core components should be included in the distribution. Optional.
76-
otelcol_version: "0.27.0" # the OpenTelemetry Collector version to use as base for the distribution. Optional.
76+
otelcol_version: "0.28.0" # the OpenTelemetry Collector version to use as base for the distribution. Optional.
7777
output_path: /tmp/otelcol-distributionNNN # the path to write the output (sources and binary). Optional.
7878
version: "1.0.0" # the version for your custom OpenTelemetry Collector. Optional.
7979
go: "/usr/bin/go" # which Go binary to use to compile the generated sources. Optional.
8080
exporters:
81-
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.27.0" # the Go module for the component. Required.
81+
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.28.0" # the Go module for the component. Required.
8282
import: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter" # the import path for the component. Optional.
8383
name: "alibabacloudlogserviceexporter" # package name to use in the generated sources. Optional.
8484
path: "./alibabacloudlogserviceexporter" # in case a local version should be used for the module, the path relative to the current dir, or a full path can be specified. Optional.
8585
replaces:
8686
# a list of "replaces" directives that will be part of the resulting go.mod
87-
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.27.0
87+
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.28.0
8888
```

internal/builder/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"go.uber.org/zap"
2727
)
2828

29-
const defaultOtelColVersion = "0.27.0"
29+
const defaultOtelColVersion = "0.28.0"
3030

3131
// ErrInvalidGoMod indicates an invalid gomod
3232
var ErrInvalidGoMod = errors.New("invalid gomod specification for module")

internal/builder/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func GetModules(cfg Config) error {
130130
retries := 3
131131
failReason := "unknown"
132132
for i := 1; i <= retries; i++ {
133-
cmd := exec.Command(goBinary, "mod", "download")
133+
cmd := exec.Command(goBinary, "mod", "tidy")
134134
cmd.Dir = cfg.Distribution.OutputPath
135135
if out, err := cmd.CombinedOutput(); err != nil {
136136
failReason = fmt.Sprintf("%s. Output: %q", err, out)

internal/scaffold/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func main() {
5353
Version: "{{ .Distribution.Version }}",
5454
}
5555
56-
app, err := service.New(service.Parameters{BuildInfo: info, Factories: factories})
56+
app, err := service.New(service.AppSettings{BuildInfo: info, Factories: factories})
5757
if err != nil {
5858
log.Fatalf("failed to construct the application: %v", err)
5959
}

test/nocore.builder.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dist:
22
module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore
3-
otelcol_version: 0.27.0
3+
otelcol_version: 0.28.0
44
include_core: false
55

66
receivers:

test/replaces.builder.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
dist:
22
module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces
3-
otelcol_version: 0.27.0
3+
otelcol_version: 0.28.0
44

55
processors:
6-
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.27.0
7-
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.27.0
6+
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.28.0
7+
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.28.0
88

99
replaces:
10-
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.27.0
10+
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.28.0

0 commit comments

Comments
 (0)