-
Notifications
You must be signed in to change notification settings - Fork 251
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
k8s Container Attributes not Included when Exporting to Stackdriver in GKE #796
Comments
I also faced this issue. Though I'm not sure how to fix it, I come here to share a workaround. If we add 2 environment variable, (snip)
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONTAINER_NAME
value: "INSERT_CONTAINER_NAME_HERE" |
@ymaki thank you so much, that resolved the issue. |
Re-opening for tracking, I intend to submit a PR updating the documentation with this. Would someone on the team be willing to assign this issue to me for resolution? |
@seawolf42 |
Thanks @lzchen, I should be able to get to this shortly after 10/15. |
I'm having the same issue but in opencensus-node. Locally works fine, but results in the same error when deployed to GKE. |
@seawolf42, @ymaki, @rphillipsz did you just start seeing this issue recently? Or did you run into this while setting up monitoring on a new GKE project? If the code in question previously worked on GKE, when did it start failing? We set the time series' resource labels from environment variables, and use different labels for different resource types. See e.g. As far as I can tell, if this is a regression, it's happening for one of two reasons: either GKE stopped populating the Thanks for the detailed report @seawolf42, sorry to keep you waiting on the fix. |
@c24t this is setting up OpenCensus for the very first time on a new project (and on any project in my case, never used OpenCensus prior to this project). I first installed OC in about the second week of August and it's been non-functional the entire time on my project when running in GKE though working completely as expected locally that same entire time. I can get GCP details for you if it helps uncover a regression, just let me know what pieces of information would be helpful. |
We've been using OpenCensus for awhile in Golang (in GKE also) and aren't having any problems with stats in GKE. This is the first time I've used the node library, and ran into this. Since adding the NAMESPACE and CONTAINER_NAME env variables to the container fixed the problem, and if that's how they've always been populated, then I'd think GKE must have stopped populating them. |
I'm not sure whether this is the regression and when it is happened because I just started to use OpenCensus recently for the first time and found this issue. |
Describe your environment.
Python dependencies (trimmed to just relevant):
Steps to reproduce.
Using the following code:
... enter a Python shell locally and call
record_entity('a', 'b')
and everything works (including seeing data appear in Stackdriver's UI). This gives an exception when running in a container in GKE (see details below).What is the expected behavior?
I expect this to work the same in GKE as it does locally.
What is the actual behavior?
Running the same code in a container in GKE gives the following exception:
Additional context.
This might be a regression of #647.
The text was updated successfully, but these errors were encountered: