Comments (7)
Yeah been trying to set this up using NODE_OPTIONS but can't get it working. @taeold Really excited about this but would love your input! 🙏
from functions-samples.
By the way @dan-wu-open I think you might be able to get what you're looking for by setting an environment variable called NODE_OPTIONS
to --require "./tracing.js"
. You can set this with an env file or as part of your CI/CD or manually on the function within the google cloud console. That said, it isn't working for me! Worth giving it a try though
https://console.cloud.google.com/functions/list
Select your function
Edit
Expand Runtime, build, connections and security settings
Give it a try 😄
from functions-samples.
I am struggling with setting this up in TypeScript, somehow my custom spans are not visible.
One general remark useful while testing: by default Cloud Run will trace 0.1 request per second per container (https://cloud.google.com/run/docs/trace#trace_sampling_rate). When I was invoking my callable from Angular app the OPTIONS preflight request was draining this quota and real request were not traced (there is nice property in logs traceSampled: true
saying if given request was sampled or not)
from functions-samples.
Whoops my mistake. Thanks for calling it out @dan-wu-open and @adamaffinitech. Fix incoming at #1022
from functions-samples.
@kaczors Thanks for sharing your problem.
It's a real bummer that we don't get to configure the Cloud Run sampling rate :(.
I believe Open Telemetry allows you to configure a sampler that can override the 0.1 sampling rate of Cloud Run. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#built-in-samplers.
Unfortunately, this would mean that you won't have the overarching request span generated by the Cloud Run's load balancer, but you'd at least be getting spans generated by your application.
I will take a closer look and see if I can write some sample code this weekend. If you are willing to share your work, I think the community will appreciate it!
from functions-samples.
@kaczors Thanks for sharing your problem.
It's a real bummer that we don't get to configure the Cloud Run sampling rate :(.
I believe Open Telemetry allows you to configure a sampler that can override the 0.1 sampling rate of Cloud Run. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#built-in-samplers.
Unfortunately, this would mean that you won't have the overarching request span generated by the Cloud Run's load balancer, but you'd at least be getting spans generated by your application.
I will take a closer look and see if I can write some sample code this weekend. If you are willing to share your work, I think the community will appreciate it!
Do you happen to have any working code around this?
I'm using v2 callable functions but only the OPTIONS
pre-flight CORS request is getting its trace sampled. The actual onCall function invocation gets a traceId
and spanId
, but I think due to the sampling rate of Cloud Run, it's not then getting sampled and showing up in the trace explorer.
from functions-samples.
@kaczors Thanks for sharing your problem.
It's a real bummer that we don't get to configure the Cloud Run sampling rate :(.
I believe Open Telemetry allows you to configure a sampler that can override the 0.1 sampling rate of Cloud Run. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#built-in-samplers.
Unfortunately, this would mean that you won't have the overarching request span generated by the Cloud Run's load balancer, but you'd at least be getting spans generated by your application.
I will take a closer look and see if I can write some sample code this weekend. If you are willing to share your work, I think the community will appreciate it!Do you happen to have any working code around this?
I'm using v2 callable functions but only the
OPTIONS
pre-flight CORS request is getting its trace sampled. The actual onCall function invocation gets atraceId
andspanId
, but I think due to the sampling rate of Cloud Run, it's not then getting sampled and showing up in the trace explorer.
sorry, I did not found any workaround and not using this solution anymore
from functions-samples.
Related Issues (20)
- [BUG] in sample:
- No alert function detected
- [BUG] in sample: firebase function (2nd generation) HOT 2
- [DOCS] for sample:
- [BUG] in sample:
- [BUG] in sample:
- LGTM
- [DOCS] Example app in readme.md does not work HOT 1
- [DOCS] for sample: taskqueues-backup-images, not clear how to set up "impersonation" permission HOT 2
- [BUG] in sample: alert
- DisplayUnlockCaptcha
- [BUG] in sample:
- [DOCS] for sample: taskqueues-backup-images, it simply doesn't work with tasks_fn.on_task_dispatched function, only with http_fn.on_request function HOT 5
- onTaskDispatched when region is set the function don't deploy to the region in sample:
- [BUG] Some phone numbers do not receive OTP SMS messages with Firebase phone auth: HOT 5
- Problems with sending push notifications
- functions predeploy error: Command terminated with non-zero exit code 2 HOT 1
- functions predeploy error: Command terminated with non-zero exit code 2 HOT 1
- [DOCS] for sample: python callable functions
- How is this still a problem 2 years later? I am running into this now.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functions-samples.