Comments (5)
Is there a possible third option of implementing number 1, with a deprecated codepath that checks for enabled:false
and sets disabled:true
if that is found?
from opentelemetry-js.
By the way, the handling of enabled
flag is not done consistent as of now, see #2257
I think a single enable
/ disable
flag is not enough in general. I would expect 2 flags:
enable
(ordisable
) - only evaluated at construction time to decide patch yes/nocapture
- runtime changeable, evaluated whenever some monitored/pached API is called
from opentelemetry-js.
By the way, the handling of
enabled
flag is not done consistent as of now, see #2257I think a single
enable
/disable
flag is not enough in general. I would expect 2 flags:
enable
(ordisable
) - only evaluated at construction time to decide patch yes/nocapture
- runtime changeable, evaluated whenever some monitored/pached API is called
So the patch
will be decided at construction time and then capture
will decide if an invoked patch should record telemetry or not?
In this case, when will instrumentation unpatch
is expected to be called?
from opentelemetry-js.
I would never call unpatch
in a production environment. There is no guarantee that it really does what one would expect.
There were quite some discussions in the regard in the past, see #3301 and linked issues for details but got stale without decission.
This didn't improve since that time, with ECMA script modules, loader threads and source code modification on load (see import in the middle for details).
I think unpatch
is fine in tests. I would expect it tries to undo what patch did. In tests you usually do not have other stuff potentially patching the the same APIs so there it should work fine.
It might be reasonable to expect that setting enabled
to false
at runtime also sets capture
to false
. But that's more a topic for documentation.
from opentelemetry-js.
I can think of 2 ways to fix this issue:
- align with opentelemetry specification and change the
enabled
property todisabled
, and change the default value tofalse
. This will be a potential breaking change for the package which we can introduce at the moment but not after the package is stable.- Keep the current property as
enabled
but fix the places where it is used, as well as add documentation for consumers on how to use it safely.
🤔 If we change this to disabled
, that would potentially be very disruptive to people using enabled: false
- the first thing that comes to mind is the fs-instrumentation that produces many events and is not always needed for folks, so they add the auto-instrumentations-node metapackage, and explicitly set fs instrumentation to false. With this change, if they don't update their code but they upgrade their instrumentation package, they will need to change enabled: false
to disabled: true
to avoid getting an unexpected influx of events. I am concerned about how big that impact may be for folks who miss the changelog update, and it may be too much without declaring a major version. Experimental technically means we could do this... but I am still hesitant based on the potential impact to end users.
Because of the potentially large impact on end users, I'd be more in favor of Option 2 to keep things as consistent as possible. As we look to stabilize, we may consider reversing the enabled/disabled flag and evangelizing it (similar to how we will need to do it with the http attributes).
from opentelemetry-js.
Related Issues (20)
- ConsoleSpanExporter not logging anything for Custom Spans for prebuilds HOT 3
- LogRecord discards attributes which are `instanceof Error` HOT 4
- propagator-aws-xray broken with GRPC? HOT 2
- (draft) [api] document best-practices and limitations
- Types returned by getMeter are not compatible HOT 2
- [instrumentation] hide `shimmer` types from the public API
- How to set `credentials: include`? If it cannot be done, please add an option to include Cookies for the Exporters.
- [instrumentation] research adding experimental features to `Instrumentation`, `InstrumentationBase`
- Can not use ESM support in lambda environment HOT 2
- @opentelemetry/semantic-conventions out of sync. E.g. 1.25.1 `http.user_agent` does not follow semantic conventions? HOT 4
- traceparent http header field is not extracted correctly when datadog agent also inserts it HOT 2
- [instrumentation] update "Instrumentation for ES Modules" documentation HOT 1
- How to determine Parent Span from a ReadableSpan, check if Parent Span is Remote?
- Unable to access to trace information using opentelemetry-js SDK + aws lambda layer HOT 2
- `HttpInstrumentation` does not create outgoing request span for `http.get` in ESM HOT 1
- Lamda Auto Instrumentation Causes -> Internal Server Error Due To Span not Ending HOT 2
- node http integration: ignoreIncomingRequests() option does not work HOT 2
- couchbase instrumentation doesn't not support?
- Logs Stabilization Plan HOT 1
- Update Typescript HOT 1
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 opentelemetry-js.