-
Notifications
You must be signed in to change notification settings - Fork 534
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
chore(examples/web): use exported strings for attributes #2129
Conversation
Use exported strings for Semantic Attributes
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2129 +/- ##
==========================================
- Coverage 90.97% 90.35% -0.63%
==========================================
Files 146 147 +1
Lines 7492 7679 +187
Branches 1502 1575 +73
==========================================
+ Hits 6816 6938 +122
- Misses 676 741 +65 |
@@ -46,7 +46,7 @@ | |||
"@opentelemetry/instrumentation-xml-http-request": "^0.39.1", | |||
"@opentelemetry/propagator-b3": "^1.13.0", | |||
"@opentelemetry/sdk-trace-web": "^1.13.0", | |||
"@opentelemetry/semantic-conventions": "^1.13.0" | |||
"@opentelemetry/semantic-conventions": "^1.23.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only requires v1.22.0, but I think we can have (perhaps even want) the examples all to be updated to be using the very latest versions of deps? Not sure how strict we need to be here. If we need to back this up to ^1.22.0
later, we can do another change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely brings the example in bad state. "@opentelemetry/instrumentation-xml-http-request": "^0.39.1"
depends on "@opentelemetry/semantic-conventions": "1.13.0"
.
So user ends up with a duplicate.
In general I think examples should be only touched if it is verified manually that result is fine as there are no automated tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does having two versions of @opentelemetry/semantic-conventions
necessarily mean a bad state for the example?
The current state already has three different versions of @opentelemetry/resource
, FWIW:
[23:37:57 trentm@peach:~/src/opentelemetry-js-contrib/examples/web (git:main)]
% npm ls @opentelemetry/resources
[email protected] /Users/trentm/src/opentelemetry-js-contrib/examples/web
├─┬ @opentelemetry/[email protected]
│ ├─┬ @opentelemetry/[email protected]
│ │ └─┬ @opentelemetry/[email protected]
│ │ └─┬ @opentelemetry/[email protected]
│ │ └── @opentelemetry/[email protected]
│ └─┬ @opentelemetry/[email protected]
│ └─┬ @opentelemetry/[email protected]
│ └─┬ @opentelemetry/[email protected]
│ └── @opentelemetry/[email protected]
├─┬ @opentelemetry/[email protected]
│ ├─┬ @opentelemetry/[email protected]
│ │ ├── @opentelemetry/[email protected] deduped
│ │ ├─┬ @opentelemetry/[email protected]
│ │ │ └── @opentelemetry/[email protected] deduped
│ │ └─┬ @opentelemetry/[email protected]
│ │ └── @opentelemetry/[email protected] deduped
│ ├── @opentelemetry/[email protected]
│ └─┬ @opentelemetry/[email protected]
│ └── @opentelemetry/[email protected] deduped
└─┬ @opentelemetry/[email protected]
└─┬ @opentelemetry/[email protected]
└── @opentelemetry/[email protected]
and 7 installs of 3 different versions of @opentelemetry/semantic-conventions
:
% npm ls @opentelemetry/semantic-conventions | rg -v deduped | rg semantic
│ │ └── @opentelemetry/[email protected]
│ └── @opentelemetry/[email protected]
│ │ └── @opentelemetry/[email protected]
│ │ └── @opentelemetry/[email protected]
│ └── @opentelemetry/[email protected]
│ └── @opentelemetry/[email protected]
└── @opentelemetry/[email protected]
Anyway, it is a bit of a mess. I'm not sure these PRs updating the examples/*
make it worse, but I understand your point.
Getting into attempting to maintain many of these examples is a huge pain. Some of them are ancient or obsolete (B3Propagator). The examples/web/README.md, for example, explains nothing about what to expect, whether to run the docker-compose file that is included, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was discussed in the SIG today (https://docs.google.com/document/d/1tCyoQK49WVcE-x8oryZOTTToFm7sIeUhxFPm9g-qL1k/edit#heading=h.dvqq8u408ifx) and it was felt that we should go ahead with these semconv updates in the examples/*
dirs. Trying to summarize the discussion from memory:
- Possible multiple separate
@opentelemetry/semantic-conventions
versions won't break the example apps because the semconv package has no deps. - To the degree that users look at the examples for how to do things, it is helpful to update the semantic-conventions package usage to the new exports from v1.22.0.
- There was some expression of hope for automated verification that examples are basically working (perhaps no more than a check that they install/compile fine). Verifying beyond that might be difficult because the examples aren't generally written to be testable. Also contributor bandwidth is an issue.
/easycla |
Which problem is this PR solving?
Short description of the changes
On package
examples/web
:@opentelemetry/semantic-conventions
^1.23.0