stackdriver | A client library for accessing the Stackdriver API | Machine Learning library
kandi X-RAY | stackdriver Summary
kandi X-RAY | stackdriver Summary
DEPRECATED: This repo is no longer in use and is not being maintained. The authoritative version of this code base can be found at A client library for accessing the Stackdriver API.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- CustomMetric adds a custom metric
- NewGatewayMessage creates a new GatewayMessage
- NewStackdriverClient creates a new Stackdriver client
stackdriver Key Features
stackdriver Examples and Code Snippets
Community Discussions
Trending Discussions on stackdriver
QUESTION
I got an alert overnight from StackDriver saying that a website I host was inaccessible. I can't SSH into the VM from cloud console or from cloud shell.
I've enabled logging in via serial and connected that way but all I get is
Sending Seabios boot VM event.
Booting from Hard Disk 0...
This seems to indicate the VM isn't booting. I'm not sure where to go next, usually, I'd just pull up the VM console in whatever hypervisor I'm using but that's not really an option here.
...ANSWER
Answered 2021-Jun-08 at 09:39This most probably means that the boot-loader is corrupt or missing. I suggest you to verify GRUB.
You can try the following:
Interact with the serial port console to further troubleshoot.
Attach this disk or its snapshot version to a new instance as an additional (none-boot) disk and try debug it.
Re-installing GRUB on the desired partition would help along with this guide about GRUB config.
I am afraid it will not be easy to apply a mitigation here. Most probably you will have to make use of a fresh instance as an alternative and transfer the existing data from the problematic disk.
QUESTION
I am trying to auto-scale my pods based on CloudSQL instance response time. We are using cloudsql-proxy for secure connection. Deployed the Custom Metrics Adapter.
...ANSWER
Answered 2021-May-21 at 09:35- Please refer to the link below to deploy a HorizontalPodAutoscaler (HPA) resource to scale your application based on Cloud Monitoring metrics.
https://cloud.google.com/kubernetes-engine/docs/tutorials/autoscaling-metrics#custom-metric_4
Looks like the custom metric name is different in the app and hpa deployment configuration files(yaml). Metric and application names should be the same in both app and hpa deployment configuration files.
In the hpa deployment yaml file,
a. Replace custom-metric-stackdriver-adapter with custom-metric (Or change the metric name to custom-metric-stackdriver-adapter in the app deployment yaml file).
b. Add “namespace: default” next to the application name at metadata.Also ensure you are adding the namespace in the app deployment configuration file.
c. Delete the duplicate lines 6 & 7 (minReplicas: 1, maxReplicas: 5).
d. Go to Cloud Console->Kubernetes Engine->Workloads. Delete the workloads (application-name & custom-metrics-stackdriver-adapter) created by app deployment yaml and adapter_new_resource_model.yaml files.
e. Now apply configurations to resource model, app and hpa (yaml files).
QUESTION
I have a VM instance running in GCE (using the Container Optimised OS) and within that I have an actively running container that is generating json logs. I can see these logs when I navigate to /var/lib/docker/containers//-json.log
.
In the same Instance, another docker container is running using the image gcr.io/stackdriver-agents/stackdriver-logging-agent:1.8.4
. This was automatically set up when I created the VM.
The VM has permission to access to Cloud Logging and the Cloud Logging API is enabled. I have also followed the steps here and added google-logging-enabled
to the metadata with a value of true
.
When the VM is started, the logging agent seems to spin up correctly and emits a log saying that it is tailing the log file of the docker container I want logs for, however the logs within that file never appear in Google Logging. Below is a screenshot of the logs that do make it to Cloud Logging:
I have had this issue for a while now so would be very grateful for any help with this issue! Thanks in advance (:
...ANSWER
Answered 2021-May-18 at 11:04Google logging uses a fluentd to catch the logs.
You can reconfugure fluentd to include additional log files.
Create a file /etc/google-fluentd/config.d/my_app_name.conf
and put in the file a line in a format path /path/to/my/log
. Here are more examples in the fluentd documentation.
You can also specify how the file is going to be parsed: as a single string
type field or in more structured way (more convinient when you're looking for something). Again - here's some more info about fluentd's output plugins.
Finally go ahead and read the fluentd
documentation to have a better understanding on using this tool.
QUESTION
When trying to deploy a Python project to Google Cloud functions using the command
gcloud functions deploy my_function --entry-point reply --runtime python38 --trigger-http --allow-unauthenticated
I get
Deploying function (may take a while - up to 2 minutes)...⠛
For Cloud Build Stackdriver Logs, visit: https://[...] Deploying function (may take a while - up to 2 minutes)...failed.
ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: missing main.py and GOOGLE_FUNCTION_SOURCE not specified. Either create the function in main.py or specify GOOGLE_FUNCTION_SOURCE to point to the file that contains the function; Error ID: 5c04ec9c
But I do have a main.py
file in the folder.
I checked the platform and the file main.py
is not being uploaded, while the files inside folders are.
ANSWER
Answered 2021-May-06 at 16:21The solution was to omit this line from .gcloudignore
:
QUESTION
Following the guide that google made for deploying an HPA in Google Kubernetes Engine: https://cloud.google.com/kubernetes-engine/docs/tutorials/autoscaling-metrics
And adding the right permissions because I am using Workload Identity with this guide: https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/custom-metrics-stackdriver-adapter
And also adding the firewall-rule commented here: https://github.com/kubernetes-sigs/prometheus-adapter/issues/134
I am stuck in a point where the HPA returns me this error:
...ANSWER
Answered 2021-Apr-13 at 22:42Resolved for me!
After a several of test, changing in the HPA yaml,
the metric from Pod
to External
, and the metric name with custom.google.apis/my-metric
, it works!
QUESTION
My cloud function code, is a maven-jar-project. It depends on other internal maven jar, so I have added that dependency to the pom.xml.
Expected: I expect that the dependent jars will be automatically included in the cloud function deployment, however I get an error "could not find artifact". Local compilation & running does not have any issue.
I don't want to copy paste those dependency sourcecode directly to my gcloud maven project. [bad ]
...ANSWER
Answered 2021-Apr-11 at 16:15To achieve this, you need to deploy from JAR. Like that, you create a JAR with all the dependency already included in it (maven shade). No resolution at deployment time, only get your JAR and put it in Cloud Functions.
QUESTION
This question comes from a previous one almost solved: Save a Google Form as PDF on a Drive's folder using Google Scripts
IntroductionPerhaps this is a technical question and I am not programmer, so if possible I want a step-by-step answer so I can fully understand it.
The steps and purpose of the code are explained here: Hacking it: Generate PDFs from Google Forms.
The code is posted on the link but I post it here anyways:
...ANSWER
Answered 2021-Mar-30 at 02:05here's what one of my oauthscopes looks like:
QUESTION
I've copied the firebase stripe GitHub example index.js and have been fixing the errors which pop up from hosting the code in my index.ts (typescript) file. The error I have left is the following:
Expected 2 arguments, but got 1.ts(2554) index.ts(54, 112): An argument for 'arg1' was not provided.
It's about this line (there are multiple instances although this should not matter to the solution):
...ANSWER
Answered 2021-Mar-21 at 06:35I've not tried this but as per the typescript hint. this function accepts 2 arguments.
arg0
of type object which has propertyerror
of typeany
.arg1
of type object which has propertymerge
of typeboolean
orundefined
.
So you need to call it something like this if setting error.
QUESTION
How can I get the current size of a GKE node pool using the REST (or Node) API?
I'm managing my own worker pool using my Express app running on my cluster, and can set the size of the pool and track the success of the setSize operation, but I see no API for getting the current node count. The NodePool resource only includes the original node count, not the current count. I don't want to use gcloud or kubectl on one of my production VMs.
I could go around GKE and try to infer the size using the Compute Engine (GCE) API, but I haven't looked into that approach yet. Note that it seems difficult to get the node count even from Stack Driver. Has anyone found any workarounds to get the current node size?
...ANSWER
Answered 2021-Mar-20 at 18:44The worker pool size can be retrieved from the Compute Engine API by getting the instance group associated with the node pool.
QUESTION
I am trying to setup Horizontal Pod Autoscaler to automatically scale up and down my api server pods based on CPU usage.
I currently have 12 pods running for my API but they are using ~0% CPU.
...ANSWER
Answered 2021-Mar-13 at 00:07I don’t see any “resources:” fields (e.g. cpu, mem, etc.) assigned, and this should be the root cause. Please be aware that having resource(s) set on a HPA (Horizontal Pod Autoscaler) is a requirement, explained on official Kubernetes documentation
Please note that if some of the Pod's containers do not have the relevant resource request set, CPU utilization for the Pod will not be defined and the autoscaler will not take any action for that metric.
This can definitely cause the message unable to read all metrics on target Deployment(s).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install stackdriver
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page