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

Add package for agent-like experience #3513

Closed
wants to merge 11 commits into from

Conversation

samimusallam
Copy link
Member

Which problem is this PR solving?

This is still WIP

This is a new experimental package called opentelemetry-instrumentation-agent for an agent-like experience for JS. Exporters can be configured using environment variables so this will allow for auto instrumentation with no code changes.

Users can use this as follows:

npm install @opentelemetry/instrumentation-agent
node --require '@opentelemetry/instrumentation-agent' app.js

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

There are no tests currently but will be added soon

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@dyladan
Copy link
Member

dyladan commented Dec 28, 2022

Seems like a cool idea. Any reason you decided to make this a dedicated package instead of a custom entrypoint in the sdk-node package?

@samimusallam
Copy link
Member Author

Seems like a cool idea. Any reason you decided to make this a dedicated package instead of a custom entrypoint in the sdk-node package?

I wasn't sure where the best place for it was so I went with a dedicated package, as I thought this separation would make it easier for new users to use it.
If it makes more sense to have it as part of the sdk-node let me know!

@weyert
Copy link
Contributor

weyert commented Dec 28, 2022

How would this work when you need to define or override existing Metric views for some the instrumentations?

@samimusallam
Copy link
Member Author

How would this work when you need to define or override existing Metric views for some the instrumentations?

Currently, this is not possible as there's no way of configuring metric views using environment variables.
This could be done by having a similar implementation to the TracerProviderWithEnvExporter for MeterProvider.

@weyert
Copy link
Contributor

weyert commented Jan 25, 2023

How would this work when you need to define or override existing Metric views for some the instrumentations?

Currently, this is not possible as there's no way of configuring metric views using environment variables. This could be done by having a similar implementation to the TracerProviderWithEnvExporter for MeterProvider.

Interesting idea. I have been thinking to let it read a json file and/or javascript file that returns an array of View

@codecov
Copy link

codecov bot commented Jan 25, 2023

Codecov Report

Merging #3513 (1dd0362) into main (47444f2) will decrease coverage by 0.12%.
The diff coverage is n/a.

❗ Current head 1dd0362 differs from pull request most recent head e9f6067. Consider uploading reports for the commit e9f6067 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3513      +/-   ##
==========================================
- Coverage   94.01%   93.89%   -0.12%     
==========================================
  Files         268      269       +1     
  Lines        7920     7931      +11     
  Branches     1641     1641              
==========================================
+ Hits         7446     7447       +1     
- Misses        474      484      +10     
Impacted Files Coverage Δ
...pentelemetry-instrumentation-agent/src/register.ts 0.00% <0.00%> (ø)
...-trace-base/src/platform/node/RandomIdGenerator.ts 93.75% <0.00%> (+6.25%) ⬆️

@samimusallam samimusallam marked this pull request as ready for review January 29, 2023 14:29
@samimusallam samimusallam requested a review from a team January 29, 2023 14:29
@martinkuba
Copy link
Contributor

martinkuba commented Feb 16, 2023

Interesting idea. I have been thinking to let it read a json file and/or javascript file that returns an array of View

There is currently an effort in progress to define a configuration file mechanism for OTel SDKs. Here is a JS prototype that I just worked on. Just an FYI since it is related.

@samimusallam
Copy link
Member Author

Interesting idea. I have been thinking to let it read a json file and/or javascript file that returns an array of View

There is currently an effort in progress to define a configuration file mechanism for OTel SDKs. Here is a JS prototype that I just worked on. Just an FYI since it is related.

This mechanism will make the agent experience much better! 🙂

@samimusallam
Copy link
Member Author

samimusallam commented Feb 19, 2023

Moved this PR to the js-contrib repository to avoid creating dependency cycles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants