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

Compilation error (Remote storage adapter) #4161

Closed
gcalvojp opened this Issue May 14, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@gcalvojp
Copy link

gcalvojp commented May 14, 2018

Bug Report

What did you do?
I tried to compile Remote storage adapter example following these instructions.

What did you expect to see?
I expected the source code to compile.

What did you see instead? Under which circumstances?
I get a compilation error every time.

Environment

  • System information:

    insert output of uname -srm here: Linux 3.10.0-514.6.1.el7.x86_64 x86_64

  • Prometheus version:

    insert output of prometheus --version here: I am using master branch; version number is 2.2.1.

  • Logs:

$ go build
# _/home/USER/remote_storage_adapter
./main.go:168:19: cannot use c (type *graphite.Client) as type writer in append:
        *graphite.Client does not implement writer (wrong type for Write method)
                have Write("github.com/prometheus/prometheus/vendor/github.com/prometheus/common/model".Samples) error
                want Write("github.com/prometheus/common/model".Samples) error
./main.go:176:19: cannot use c (type *opentsdb.Client) as type writer in append:
        *opentsdb.Client does not implement writer (wrong type for Write method)
                have Write("github.com/prometheus/prometheus/vendor/github.com/prometheus/common/model".Samples) error
                want Write("github.com/prometheus/common/model".Samples) error
./main.go:191:12: cannot use conf (type "github.com/influxdata/influxdb/client/v2".HTTPConfig) as type "github.com/prometheus/prometheus/vendor/github.com/influxdata/influxdb/client/v2".HTTPConfig in argument to influxdb.NewClient
./main.go:196:26: cannot use c (type *influxdb.Client) as type "github.com/prometheus/client_golang/prometheus".Collector in argument to "github.com/prometheus/client_golang/prometheus".MustRegister:
        *influxdb.Client does not implement "github.com/prometheus/client_golang/prometheus".Collector (wrong type for Collect method)
                have Collect(chan<- "github.com/prometheus/prometheus/vendor/github.com/prometheus/client_golang/prometheus".Metric)
                want Collect(chan<- "github.com/prometheus/client_golang/prometheus".Metric)
./main.go:197:19: cannot use c (type *influxdb.Client) as type writer in append:
        *influxdb.Client does not implement writer (wrong type for Write method)
                have Write("github.com/prometheus/prometheus/vendor/github.com/prometheus/common/model".Samples) error
                want Write("github.com/prometheus/common/model".Samples) error
@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented May 14, 2018

I just tried master and all builds fine so it seems you have some issues with your local env.

this doesn't look like a normal path
_/home/USER/remote_storage_adapter
should be something like
$GOPATH/src/github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_adapter

closing now , but feel free to reopen if you are sure this is not a local env issue.

@gcalvojp

This comment has been minimized.

Copy link
Author

gcalvojp commented May 16, 2018

Just for the record, this issue was actually a duplicate of #3591.

As @tzz pointed out, the Remote storage adapter can be compiled by executing:

go build github.com/prometheus/prometheus/documentation/examples/remote_storage/remote_storage_adapter
@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.