Hey all
# spicedb
s
Hey all, We're running SpiceDB on Google Cloud and we're having an issue with the logs that it produces. These currently look as follows:
Copy code
{
  "insertId": "gpfklj0wlpxez38vo",
  "jsonPayload": {
    "cos.googleapis.com/container_name": "klt--zduz",
    "cos.googleapis.com/stream": "stderr",
    "cos.googleapis.com/container_id": "531968573a3af4ebb414773bc197d55b4e549937d3561e0969ca541134d9d53a",
    "message": "{\"level\":\"info\",\"grpc.component\":\"server\",\"grpc.method\":\"CheckPermission\",\"grpc.method_type\":\"unary\",\"grpc.service\":\"authzed.api.v1.PermissionsService\",\"peer.address\":\"10.10.0.44:54447\",\"protocol\":\"grpc\",\"requestID\":\"17134eac1651d1e5956bd934e70a6960\",\"grpc.start_time\":\"2023-08-15T08:57:44Z\",\"grpc.code\":\"OK\",\"grpc.time_ms\":\"0.168\",\"time\":\"2023-08-15T08:57:44Z\",\"message\":\"finished call\"}\n"
  },
  "resource": {
    "type": "gce_instance",
    "labels": {
      "zone": "europe-west1-b",
      "project_id": "<PROJECT>",
      "instance_id": "9147803464799520085"
    }
  },
  "timestamp": "2023-08-15T08:57:44.503856668Z",
  "labels": {
    "compute.googleapis.com/resource_name": "396d3f6712ac"
  },
  "logName": "projects/<PROJECT>/logs/cos_containers",
  "receiveTimestamp": "2023-08-15T08:57:45.321687783Z"
}
The message is stringified json, which makes it hard to parse these logs and derive metrics from them. Is there any way to configure SpiceDB to output these logs in stackdriver compatible format? We currently run it as follows: spicedb serve --grpc-preshared-key "${SPICEDB_GRPC_PRESHARED_KEY}" \ --datastore-engine postgres \ --datastore-conn-uri "${SPICEDB_DATABASE_URL}" \ --datastore-gc-max-operation-time "${SPICEDB_GC_MAX_OPERATION_TIME}" \ --http-enabled \ --log-level "${SPICEDB_LOG_LEVEL}"
c
There is not a way to adjust the structure of the logs, though I do think Google Operations Suite (Stackdriver) is compatible with JSON logs. https://cloud.google.com/logging/docs/reference/tools/gcloud-logging#examples
3 Views