Skip to content
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

[Logging] Resource type and other metadata not auto-populated on Cloud Run #3699

Open
mjpvandenberg opened this issue Jan 24, 2021 · 0 comments · May be fixed by #7642
Open

[Logging] Resource type and other metadata not auto-populated on Cloud Run #3699

mjpvandenberg opened this issue Jan 24, 2021 · 0 comments · May be fixed by #7642
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@mjpvandenberg
Copy link

mjpvandenberg commented Jan 24, 2021

On https://cloud.google.com/run/docs/logging#container-logs it says

The container logs written to these supported locations are automatically associated with the Cloud Run service, revision, and location.

However, the log entries from my PHP app, running on Cloud Run and using PHP client library v1.21.0 (currently the latest), show up in Google Cloud Logging with resource.type=global.

Minimum steps to reproduce:

Create a folder with the following 3 files.

composer.json

{
    "name": "test/gcp-logging",
    "type": "project",
    "require": {
        "ext-json": "*",
        "google/cloud-logging": "1.21.0"
    }
}

Dockerfile

FROM php:7.4-apache
COPY . /var/www/html

index.php

<?php
require 'vendor/autoload.php';

use Google\Cloud\Logging\LoggingClient;

$logging = new LoggingClient();

$logging->logger('app')->write('This is a test.');

Run composer install, build the Docker image, push it to Google Container Registry, deploy it as a revision on Cloud Run with port 80, and go to the service's URL. You'll get a blank page. Go to Google Cloud Logging. There will be a new log entry with message=This is a test. and resource.type=global (plus some other details). I was expecting resource.type=cloud_run_revision as well as resource.labels.location=..., resource.labels.service_name=..., resource.labels.revision_name=... etc.

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jan 25, 2021
@dwsupplee dwsupplee added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants