我已经在Cloud Logging UI中创建了2个用户定义的指标。这些指标显示在Cloud Monitoring中,但是它们的图形永久显示为“未找到图形数据”。是否有任何步骤可以解决此问题,或者是否有其他要求才能使用户定义的日志指标中的数据在Cloud Monitoring中可见?
google-compute-engine google-cloud-platform google-cloud-logging stackdriver google-cloud-monitoring
我正在尝试使用云sql gen2优化应用程序引擎Java应用程序的性能.如果我可以跟踪对云sql的调用,就像我可以在stackdriver跟踪详细信息中跟踪对数据存储区的RPC调用一样,那将会有很大帮助.这在某种程度上是可能的,还是有计划的?或者是用毫秒进行log.info()调用的唯一替代方法?或者是否有其他方法来添加事件标记以进行跟踪/分析?
我是Google Cloud StackDriver Logging 的新手,根据本文档StackDriver 将数据访问审核日志存储 30 天。在同一页面上还提到,日志条目的大小限制为 100KB。
我知道日志可以使用Cloud SDK以及使用多种语言的日志库导出Google Cloud Storage(我们更喜欢 Python)。
我有两个与导出日志相关的问题,它们是:
我正在使用GCP Stackdrive自定义指标,并创建了一些仪表板图来显示系统上的流量。问题在于图形系统将数据保留了几周,而不是永远。
从Stackdrive 文档中:
有关自定义指标数量和活动时间序列数量的限制以及数据保留期限,请参阅配额和限制。如果您希望将指标数据保持在保留期限之外,则必须手动将数据复制到另一个位置,例如Cloud Storage或BigQuery。
让我们决定使用Cloud Storage作为容器来长期存储数据。
google-cloud-storage google-cloud-platform stackdriver google-cloud-stackdriver
我想知道项目日志的大小,以便删除最大的日志。
我gcloud logging logs list可以列出我的所有项目日志。但是,没有显示尺寸。
如何使用gcloudGoogle Cloud Console 列出项目日志的大小?
logging google-cloud-platform gcloud stackdriver google-cloud-stackdriver
我添加了一条简单的日志消息,然后在 Stackdriver 中看到了该日志。
但有效负载不会拆分为单独的值。
问题在于有效负载显示为包含消息和有效负载的一大串。
我需要一个值列表,以便我可以查询 ex isValid 或内容。
如何将有效负载获取到 Stackdriver 日志记录中的值列表?
https://developers.google.com/apps-script/guides/logging#using_cloud_logging
// Log a JSON object at a DEBUG level. The log is labeled
// with the message string in the log viewer, and the JSON content
// is displayed in the expanded log structure under "jsonPayload".
var parameters = {
isValid: true,
content: 'some string',
timestamp: new Date()
};
console.log({message: 'Function Input', initialData: parameters});
Run Code Online (Sandbox Code Playgroud)
更新
如果将项目降级到 ["runtimeVersion": "DEPRECATED_ES5"] 有效负载工作正常。
如果我在新的“运行时 Chrome V8”中运行项目,则有效负载不起作用。
logging google-apps-script stackdriver google-cloud-stackdriver
我正在使用这个启动脚本运行一个容器优化的计算实例:
#!/bin/bash
mkdir /home/my-app
cd /home/my-app
export HOME=/home/my-app
docker-credential-gcr configure-docker
docker run --rm --log-driver=gcplogs --name my-app --security-opt seccomp=./config.json gcr.io/my-project/my-app:latest
Run Code Online (Sandbox Code Playgroud)
在--log-driver和--name标志根据设定GCP社会导向和搬运工文档。
但是我看不到容器启动的日志。
此外,当我通过 SSH 连接到实例并运行 command 时logger "hello from logger",我没有看到它显示在云记录器中。我尝试将其转换为高级过滤器并删除除“来自记录器的hello”字符串过滤器之外的所有过滤器。
如何正确设置日志记录?我bunyan在我的 NodeJS 应用程序中使用,但是当应用程序失败时,我完全看不到?我很想拥有journalctl云记录器中的所有日志。或者,至少startup-script是journalctl. 现在我正在通过 SSH 连接到实例并运行journalctl -r | grep startup-script.
访问范围设置正确:
Stackdriver Logging API: Write Only
Stackdriver Logging API: Write Only
Run Code Online (Sandbox Code Playgroud)
我正在使用默认的计算引擎服务帐户。这是我使用以下命令创建此 VM 的命令:
gcloud compute instance-templates create $APP_ID-template \ …Run Code Online (Sandbox Code Playgroud) google-compute-engine google-cloud-platform stackdriver google-cloud-stackdriver google-container-optimized-os
如何查看有关已在 Google Cloud Compute Engine 上创建的 VM 的日志?
google-compute-engine google-cloud-platform google-cloud-logging stackdriver google-cloud-stackdriver
我已经使用运行时 python37 部署了 Cloud Functions。我的问题是如何使用 differentseverity和 same打印或记录execution_id,这可以很容易地通过Stackdriver Logging界面按日志级别过滤。
默认情况下,print将使用相同的execution_id,但我无法指定severity.
我已经尝试了logging和google-cloud-logging,但他们无法记录execution_id对调试 GCF 有用的。

python logging google-cloud-logging google-cloud-functions stackdriver
我必须检查GCE实例的正常运行时间有哪些选择?
google-compute-engine google-cloud-platform stackdriver google-cloud-monitoring google-cloud-stackdriver
我正在尝试在托管于谷歌云平台的 MERN 项目中实现谷歌跟踪。
我已经按照 Google 提供的指南和示例进行操作,但我无法使其以任何方式工作。
import gCloudTrace from '@google-cloud/trace-agent';
// initialize gcloud trace
if (process.env.NODE_ENV === 'production') {
console.log(`Starting google cloud trace...`);
const tracer = gCloudTrace.start();
console.log(JSON.stringify(tracer,null,2));
};
import express from 'express';
import apiRoute from './api.js';
import indexRoute from './index/indexRoute.js';
try {
// setup
const host = process.env.HOST || '0.0.0.0';
const port = process.env.PORT || 5050;
const app = express();
// routes
app.use('/', indexRoute);
app.use('/api', checkGloblalSettings, apiRoute);
// create and run HTTP server
app.listen(port, host, () => {
console.log(`EXPRESS …Run Code Online (Sandbox Code Playgroud) google-app-engine gcloud stackdriver google-cloud-stackdriver