question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting execution-id / trace in background functions

See original GitHub issue

Environment details

  • OS: MacOS 10.13.6
  • Node.js version: 10.15.3
  • npm version: 6.4.1
  • @google-cloud/logging version: 5.3.1
  • Firebase Cloud Functions

Steps to reproduce

  1. In a Firebase cloud functions (scheduler or pubsub or httpRequest)
console.log('Init');

This gets taged correctly with an execution and the correct labels. 2.

import { Logging, detectServiceContext } from '@google-cloud/logging';

I’ve tried stealing export function getCurrentTraceFromAgent() { and the detectServiceContext trick from @google-cloud/logging-bunyan": “^1.2.3”, it didn’t work either. Also went around https://stackoverflow.com/questions/49185824/log-jsonpayload-in-firebase-cloud-functions it didn’t work.

It’s been 5hours and I’m starting to get a bit crazy on how to achieve the same behavior than a console.log and adding my own metadata

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:15
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
jpreynatcommented, Feb 11, 2020

Same here, being able to reproduce the behavior of console.log for Node 10 in order to customize it using this module seems essential.

4reactions
Elyx0commented, Jan 16, 2020

Any updates? It’s a must have to me to be able to follow an error with additional jsonPayload alongside its execution id

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Getting functionName and executionId inside ...
Use the firebase functions logger to report all logs from out logger to // Can ... We just then use the function log...
Read more >
Cloud Functions execution environment
Each function runs in its own isolated secure execution context, scales automatically, and has a lifecycle independent from other functions.
Read more >
Workflow Executions from a Task State - AWS Step Functions
When provided, you can easily trace the executions of your workflows from starting executions to their started workflow executions. Using the previous example, ......
Read more >
How can I track the execution of PL/SQL and SQL? - Ask TOM
Is it possible to find out the number of times a procedure or a function get executed?Can I use the view v$librarycache to...
Read more >
Functions API - Docs - Appwrite
Get Execution. GET/v1/functions/{functionId}/executions/{executionId}. Get a function execution log by its ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found