Error pushing custom metric to Google Stackdriver - stackdriver

I'm getting the following error while trying to push custom metrics from my code to Google Stackdriver. I'm using the Java SDK.
Caused by: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Unknown metric: custom.googleapis.com/jvm/heap/used (cannot auto-create custom metric descriptors without a Stackdriver account). at io.grpc.Status.asRuntimeException(Status.java:526)

The solution is to open Stackdriver Monitoring and add the project under which the agent code is running there. This means either creating a new SD Monitoring project or adding the GCP project to an existing SD Monitoring project. A singe SD Monitoring project can be associated with multiple GCP projects.

Related

Azure Failure Anomalies don't get auto resolved

I have multiple RESTful APIs that are hosted in azure web app / azure service plans and covered by application insights
I have setup availability tests on top of these API using application insights which when triggered call an azure function
There is an auto resolve setting for availability tests which lets your hook up alerting when the availablity issue has been resolved.
However I didn't find anything on similar lines for Failure Anomalies
Question:
How do I setup a webhook call back on azure application insight failure anomaly detection ?

Error: Messaging: We are unable to register the default service worker

My Flutter app on web has been using Firebase Cloud Messaging for a long time without error. Today, with no changes, it is giving the following error:
Error: [firebase_messaging/failed-service-worker-registration] Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('http://localhost:50093/firebase-cloud-messaging-push-scope') with script ('http://localhost:50093/firebase-messaging-sw.js'): The Service Worker system has shutdown.
Can anyone explain why this error is occurring now? I suspect something must have changed on Firebase's end, because my code has not changed.
If you're using an older version of Firebase Cloud Messaging plugin, you might need to follow this setup guide to create a default app settings for web. On current version of FCM, you can follow this initialization guide to add the FCM plugin on your app.

Authenticating Pulumi to manage firebase

When tryin to create firebase resources using pulumi I get following error:
error: 1 error occurred:
Error creating Project: googleapi: Error 403: Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the firebase.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://cloud.google.com/docs/authentication/.
As far as I understand this, the only way to use Pulumi with a Firebase project is to use the service account (with proper access) and it is not possible to use the gloud ... way to authenticate?

With the free account of Firebase is it possible to backup firestore? How?

I have Spark plan (free) and I would like to backup the Firestore Data. I followed this Tutorial but it returns this error:
ERROR: (gcloud.firestore.export) PERMISSION_DENIED: This API method requires billing to be enabled. Please enable billing on project by visiting https://console.developers.google.com/billing/ then retry. If you enabled billing for this project recently, wait a few minutes for the action to propagate to our systems and retry.
Error: Process completed with exit code 1.
Is there a way to to backup it WITHOUT UPGRADING TO BLAZE? If yes, how?
The error message is pretty explicit:
This API method requires billing to be enabled.
The documentation on exporting data also has this note:
Firebase projects must be on the Blaze plan to use the managed export and import feature. Enabling billing for the Google Cloud automatically upgrades your Firebase project to the Blaze plan.
So it looks like your project will need to be on the Blaze plan to use scheduled exports.

Stackdriver logs not available for Cloud ML jobs since migration to V2

Since migration to V2 logs from Cloud ML jobs are not accessible on the Stackdriver logging console anymore. The last log displayed is
Waiting for Tensorflow to start.
The job is executed and completed successfully, I just can't access outputs in the logs
All Stackdriver APIs are enabled for the project.
There are no known issues with Cloud ML's Stackdriver logging. The fact that you see "Waiting for Tensorflow to start." indicates you are seeing log messages from Cloud ML.
If logs from your Python/TensorFlow program are missing that usually indicates Cloud ML hasn't been authorized to send logs to Stackdriver logging for your project. To check permissions do the following
Identify the Cloud ML service account by following these instructions
In the Cloud Console select the IAM Tab
Verify that the Cloud ML service account is listed and has Logs Writer permissions
This problem also took me two weeks to search answers online with frustration, until I came across this post. I did not see "migration to V2" as OP mentions but I simply could not get any application logs in StackDriver, only system logs of job started/completed. Following what Jeremy replies solves the problem.
To make Jeremy's reply simpler to follow, essentially you add the ML service account
cloud-ml-service#<project-id>.iam.gserviceaccount.com
to your project's IAM members, with at least "Logs Writer" role.
You can get "project-id" by:
gcloud config list project --format "value(core.project)"
I also assigned Project->Editor role to allow Bucket access.

Resources