Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

googlecloudexporter not compiling above v0.61.0 #17899

Closed
ljulliar opened this issue Jan 21, 2023 · 9 comments
Closed

googlecloudexporter not compiling above v0.61.0 #17899

ljulliar opened this issue Jan 21, 2023 · 9 comments
Assignees
Labels
bug Something isn't working exporter/googlecloud

Comments

@ljulliar
Copy link

Component(s)

exporter/googlecloud

What happened?

Description

googlecloudexporter will not compile with revision higher than 0.61.0

Steps to Reproduce

Use the local build process from https://github.com/GoogleCloudPlatform/opentelemetry-collector-builder-sample/tree/main/build/local
Adjust version in Makefile and in builder-config.yaml. Up to 0.61.0 the compilation will work

Expected Result

The custom version of otelcol should compile

Actual Result

If you use any version higher than 0.61.0 you'll always obtain the same error and the compilation will stop (see below)

Collector version

0.63.0+

Environment information

Environment

OS: Debian 12
Compiler(if manually compiled): go version go1.19.4 linux/amd64

OpenTelemetry Collector configuration

receivers:
  - import: go.opentelemetry.io/collector/receiver/otlpreceiver
    gomod: go.opentelemetry.io/collector v0.63.0
  - import: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver
    gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.63.0

processors:
  - import: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor
    gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.63.0
  - import: github.com/open-telemetry/opentelemetry-collector-contrib/processor/redactionprocessor
    gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/redactionprocessor v0.63.0
  - import: go.opentelemetry.io/collector/processor/memorylimiterprocessor
    gomod: go.opentelemetry.io/collector v0.63.0
  - import: go.opentelemetry.io/collector/processor/batchprocessor
    gomod: go.opentelemetry.io/collector v0.63.0

exporters:
  - import: go.opentelemetry.io/collector/exporter/loggingexporter
    gomod: go.opentelemetry.io/collector v0.63.0
  - import: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter
    gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter v0.63.0

Log output

go: finding module for package go.opentelemetry.io/collector/config
go: finding module for package go.opentelemetry.io/collector/service/servicetest
go.opentelemetry.io/collector/cmd/builder imports
	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter imports
	go.opentelemetry.io/collector/config: module go.opentelemetry.io/collector@latest found (v0.69.1), but does not contain package go.opentelemetry.io/collector/config
go.opentelemetry.io/collector/cmd/builder tested by
	go.opentelemetry.io/collector/cmd/builder.test imports
	go.opentelemetry.io/collector/config/configtest: module go.opentelemetry.io/collector@latest found (v0.69.1), but does not contain package go.opentelemetry.io/collector/config/configtest
go.opentelemetry.io/collector/cmd/builder imports
	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter tested by
	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter.test imports
	go.opentelemetry.io/collector/service/servicetest: module go.opentelemetry.io/collector@latest found (v0.69.1), but does not contain package go.opentelemetry.io/collector/service/servicetest


### Additional context

_No response_
@ljulliar ljulliar added bug Something isn't working needs triage New item requiring triage labels Jan 21, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@ljulliar ljulliar changed the title googlecloudexporter not compiling after 0.61.0 googlecloudexporter not compiling above v0.61.0 Jan 21, 2023
@damemi
Copy link
Contributor

damemi commented Jan 23, 2023

It looks like the configtest package was removed in v0.65.0 from the collector: open-telemetry/opentelemetry-collector#6542

In this case, the collector builder seems to be trying to import from latest (v0.69.1) even though you have v0.63.0 specified, so that's the conflict. I'm not sure why that is, but I'll take a deeper look and try reproducing

@dashpole dashpole removed the needs triage New item requiring triage label Jan 23, 2023
@damemi
Copy link
Contributor

damemi commented Jan 23, 2023

@ljulliar in your builder config, the loggingexporter gomod is wrong for v0.63.0. When I update to the following, it works:

receivers:
  - import: go.opentelemetry.io/collector/receiver/otlpreceiver
    gomod: go.opentelemetry.io/collector v0.63.0
  - import: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver
    gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.63.0

processors:
  - import: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor
    gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.63.0
  - import: github.com/open-telemetry/opentelemetry-collector-contrib/processor/redactionprocessor
    gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/redactionprocessor v0.63.0
  - import: go.opentelemetry.io/collector/processor/memorylimiterprocessor
    gomod: go.opentelemetry.io/collector v0.63.0
  - import: go.opentelemetry.io/collector/processor/batchprocessor
    gomod: go.opentelemetry.io/collector v0.63.0

exporters:
  - import: go.opentelemetry.io/collector/exporter/loggingexporter
    gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.63.0
  - import: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter
    gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter v0.63.0
$ go install go.opentelemetry.io/collector/cmd/[email protected]
$ builder --config=config.yaml --name=otelcol-custom
Flag --name has been deprecated, use config distribution::name
2023-01-23T16:27:55.592Z	INFO	internal/command.go:125	OpenTelemetry Collector Builder	{"version": "dev", "date": "unknown"}
2023-01-23T16:27:55.593Z	INFO	internal/command.go:158	Using config file	{"path": "config.yaml"}
2023-01-23T16:27:55.593Z	INFO	builder/config.go:107	Using go	{"go-executable": "/usr/lib/google-golang/bin/go"}
2023-01-23T16:27:55.594Z	INFO	builder/main.go:76	Sources created	{"path": "/tmp/otelcol-distribution4259712460"}
2023-01-23T16:27:55.936Z	INFO	builder/main.go:118	Getting go modules
2023-01-23T16:27:57.356Z	INFO	builder/main.go:87	Compiling
2023-01-23T16:28:16.505Z	INFO	builder/main.go:99	Compiled	{"binary": "/tmp/otelcol-distribution4259712460/otelcol-custom"}

@jessberg
Copy link

I'm having the same issue - why exactly does specifying the specific exporter help? It seems like they should be importing the same thing because it's the same version number.

@damemi
Copy link
Contributor

damemi commented Jan 24, 2023

@jessberg around that version, the default upstream components started moving to their own Go modules (open-telemetry/opentelemetry-collector#5992). In v0.63.0, only the logging exporter was affected out of the ones in this config. If you try to build a collector using the latest version, you would need to make a similar change for otlpreceiver, memorylimiterprocessor, and batchprocessor too.

I'll update our samples repo to reflect these changes in the latest versions, but otherwise I think we can close this issue.

@jessberg
Copy link

Makes sense; thanks so much!

@damemi
Copy link
Contributor

damemi commented Jan 26, 2023

@dashpole can you close this? Think we resolved it, thanks

@ljulliar
Copy link
Author

@dashpole
I double checked on my side and it does work now.
However there is now a warning issued by the builder about deprecated arguments

$ make build
go install go.opentelemetry.io/collector/cmd/[email protected]
mkdir -p bin
builder --config=builder-config-izbk.yaml --name=otelcol-custom --output-path=bin/.
Flag --name has been deprecated, use config distribution::name
Flag --output-path has been deprecated, use config distribution::output_path

It can be fixed by removing the command line arguments in the Makefile and adding the following section in the builder-config.yaml

dist:
  name: otelcol-custom
  output_path: ./bin

@damemi
Copy link
Contributor

damemi commented Jan 27, 2023

Thanks @ljulliar, we'll fix that in our scripts for the sample. For the future you can feel free to open issues directly in https://github.com/GoogleCloudPlatform/opentelemetry-collector-builder-sample for problems with the GCP examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/googlecloud
Projects
None yet
Development

No branches or pull requests

4 participants