Skip to content

Commit

Permalink
Update to OpenTelemetry core 0.34.0 (#68)
Browse files Browse the repository at this point in the history
Fixes #67

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling authored Sep 2, 2021
1 parent 5bb4137 commit 5ada61a
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 23 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This program generates a custom OpenTelemetry Collector binary based on a given
$ GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder
$ cat > ~/.otelcol-builder.yaml <<EOF
exporters:
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.33.0"
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.34.0"
EOF
$ opentelemetry-collector-builder --output-path=/tmp/dist
$ cat > /tmp/otelcol.yaml <<EOF
Expand Down Expand Up @@ -73,16 +73,16 @@ dist:
name: otelcol-custom # the binary name. Optional.
description: "Custom OpenTelemetry Collector distribution" # a long name for the application. Optional.
include_core: true # whether the core components should be included in the distribution. Optional.
otelcol_version: "0.33.0" # the OpenTelemetry Collector version to use as base for the distribution. Optional.
otelcol_version: "0.34.0" # the OpenTelemetry Collector version to use as base for the distribution. Optional.
output_path: /tmp/otelcol-distributionNNN # the path to write the output (sources and binary). Optional.
version: "1.0.0" # the version for your custom OpenTelemetry Collector. Optional.
go: "/usr/bin/go" # which Go binary to use to compile the generated sources. Optional.
exporters:
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.33.0" # the Go module for the component. Required.
- gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.34.0" # the Go module for the component. Required.
import: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter" # the import path for the component. Optional.
name: "alibabacloudlogserviceexporter" # package name to use in the generated sources. Optional.
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.
replaces:
# a list of "replaces" directives that will be part of the resulting go.mod
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.33.0
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.34.0
```
2 changes: 1 addition & 1 deletion internal/builder/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"go.uber.org/zap"
)

const defaultOtelColVersion = "0.33.0"
const defaultOtelColVersion = "0.34.0"

// ErrInvalidGoMod indicates an invalid gomod
var ErrInvalidGoMod = errors.New("invalid gomod specification for module")
Expand Down
2 changes: 1 addition & 1 deletion internal/builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func Compile(cfg Config) error {
// GetModules retrieves the go modules, updating go.mod and go.sum in the process
func GetModules(cfg Config) error {
// #nosec G204
cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy")
cmd := exec.Command(cfg.Distribution.Go, "mod", "tidy", "-compat=1.17")
cmd.Dir = cfg.Distribution.OutputPath
if out, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("failed to update go.mod: %w. Output: %q", err, out)
Expand Down
6 changes: 3 additions & 3 deletions test/nocore.builder.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
dist:
module: github.com/open-telemetry/opentelemetry-collector-builder/test/nocore
otelcol_version: 0.33.0
otelcol_version: 0.34.0
include_core: false

receivers:
- import: go.opentelemetry.io/collector/receiver/jaegerreceiver
- import: go.opentelemetry.io/collector/receiver/otlpreceiver
core: true
exporters:
- import: go.opentelemetry.io/collector/exporter/loggingexporter
core: true
extensions:
- import: go.opentelemetry.io/collector/extension/healthcheckextension
- import: go.opentelemetry.io/collector/extension/zpagesextension
core: true
11 changes: 4 additions & 7 deletions test/nocore.otel.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
extensions:
health_check:
zpages:

receivers:
jaeger:
otlp:
protocols:
grpc:
thrift_http:
thrift_compact:
thrift_binary:

processors:

exporters:
logging:

service:
extensions: [health_check]
extensions: [zpages]
pipelines:
traces:
receivers:
- jaeger
- otlp
processors: []
exporters:
- logging
8 changes: 4 additions & 4 deletions test/replaces.builder.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
dist:
module: github.com/open-telemetry/opentelemetry-collector-builder/test/replaces
otelcol_version: 0.33.0
otelcol_version: 0.34.0

processors:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.33.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.33.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.34.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.34.0

replaces:
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.33.0
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.34.0
4 changes: 2 additions & 2 deletions test/replaces.otel.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extensions:
health_check:
zpages:

receivers:
otlp:
Expand All @@ -24,7 +24,7 @@ exporters:
logging:

service:
extensions: [health_check]
extensions: [zpages]
pipelines:
traces:
receivers:
Expand Down
2 changes: 1 addition & 1 deletion test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ do
break
fi

curl -s localhost:13133 | grep "Server available" > /dev/null
curl -s http://localhost:55679/debug/servicez | grep Uptime > /dev/null
if [ $? == 0 ]; then
echo "✅ PASS ${test}"

Expand Down

0 comments on commit 5ada61a

Please sign in to comment.