googleapis / googleapis/google-cloud-node

`logging.detectedResource` does not return "cloud_run_job" on Cloud Run Job

Open
#7,566 0 comments 0 reactions 0 assignees View on GitHub
api: logging priority: p2 type: bug
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

#### Environment details

- OS: Container (base node:24-slim)
- Node.js version: 24
- npm version: 11.5.2
- `@google-cloud/logging` version: 11.2.0

#### Steps to reproduce

1. Create job w/ code snippet
```js
const {Logging} = require('@google-cloud/logging');
const logging = new Logging();
await logging.setDetectedResource();
console.log(logging.detectedResource);
```
2. Deploy to Cloud Run Jobs:
```sh
gcloud run jobs deploy logging-test --source . && gcloud run jobs execute logging-test
```
3. Inspect the logs
```js
// Expected
{
type: "cloud_run_job",
labels: {
instance_id: "deadbeef",
zone: "us-central1-1",
},
}
```
```js
// Actual
{
type: "gce_instance",
labels: {
instance_id: "deadbeef",
zone: "us-central1-1",
},
}
```

This is basically a follow up to googleapis/nodejs-logging#959

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.