-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
googlecloudmonitoringreceiver gives no valid credentials found Error #36607
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@HazemAbdelmagid do you have |
For more details, see README.md and https://cloud.google.com/docs/authentication/application-default-credentials. |
@VihasMakwana why do I need to use GOOGLE_APPLICATION_CREDENTIALS since I am using a service account on K8s which has annotation for gcp service account that has been assigned monitoring.viewer role, and it's mentioned in the README.md file for the receiver the following:
|
Right. In that case, you don't need an env. opentelemetry-collector-contrib/receiver/googlecloudmonitoringreceiver/receiver.go Lines 158 to 164 in bc7d967
We're exiting on
So, maybe we don't need to check for |
Yes, we definitely should not be checking creds.JSON: https://pkg.go.dev/golang.org/x/oauth2/google#Credentials // JSON contains the raw bytes from a JSON credentials file.
// This field may be nil if authentication is provided by the
// environment and not with a credentials file, e.g. when code is
// running on Google Cloud Platform.
JSON [][byte](https://pkg.go.dev/builtin#byte) Looking at the source, it also isn't necessary to check if creds is nil, since it will always be non-nil if no error was returned: https://cs.opensource.google/go/x/oauth2/+/master:google/default.go;l=194;drc=d0e617c58cf747cf27df9762003502f814dd524c |
I can file a fix for it, unless you're already working on it. Let me know! |
Go for it @VihasMakwana |
#### Description Fix "no validation found" error if workload is running on Google Cloud Platform. There's no need to check for `creds` or `creds.JSON` explicitly. If any errors are encountered, it will be thrown by `FindDefaultCredentials`. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes #36607
…try#36648) #### Description Fix "no validation found" error if workload is running on Google Cloud Platform. There's no need to check for `creds` or `creds.JSON` explicitly. If any errors are encountered, it will be thrown by `FindDefaultCredentials`. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#36607
…try#36648) #### Description Fix "no validation found" error if workload is running on Google Cloud Platform. There's no need to check for `creds` or `creds.JSON` explicitly. If any errors are encountered, it will be thrown by `FindDefaultCredentials`. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#36607
…try#36648) #### Description Fix "no validation found" error if workload is running on Google Cloud Platform. There's no need to check for `creds` or `creds.JSON` explicitly. If any errors are encountered, it will be thrown by `FindDefaultCredentials`. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#36607
Component(s)
receiver/googlecloudmonitoring
What happened?
Description
I have been trying to integrate OTEL with googlecloudmonitoring receiver to collect metrics related to memorystore and then forward them to prometheus which exists in a different cluster but it is not working.
When I try to add the googlecloudmonitoring receiver configurations and give the service account of the collector access for collecting those metrics, it doesn't work and gives this error messges:
Steps to Reproduce
Expected Result
OTEL collector to get the listed metrics.
Actual Result
Collector version
v0.112.0
Environment information
Environment
GKE Cluster
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: