Skip to content

refactor(instrumentation-express): update semconv usage to ATTR_ exports #2859

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

Merged

Conversation

trentm
Copy link
Contributor

@trentm trentm commented May 27, 2025

Refs: #2377

@@ -179,7 +179,7 @@ describe('ExpressInstrumentation hooks', () => {

it('should call requestHook when set in config', async () => {
const requestHook = sinon.spy((span: Span, info: ExpressRequestInfo) => {
span.setAttribute(SEMATTRS_HTTP_METHOD, info.request.method);
span.setAttribute(ATTR_HTTP_REQUEST_METHOD, info.request.method);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review note: Yes, this is changing from old HTTP semconv http.method to new stable HTTP semconv http.request.method. However, this is not testing that instr-express is generating this. It is just testing that the requestHook is being called. We could satisfy the test by using 'my.http.method' or 'foo' or whatever.

Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.69%. Comparing base (65a1389) to head (d956a5d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2859      +/-   ##
==========================================
+ Coverage   89.65%   89.69%   +0.04%     
==========================================
  Files         185      185              
  Lines        9034     9034              
  Branches     1852     1852              
==========================================
+ Hits         8099     8103       +4     
+ Misses        935      931       -4     
Files with missing lines Coverage Δ
...try-instrumentation-express/src/instrumentation.ts 96.75% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pichlermarc pichlermarc enabled auto-merge (squash) May 28, 2025 13:07
@pichlermarc pichlermarc merged commit b417e90 into open-telemetry:main May 28, 2025
23 checks passed
@trentm trentm deleted the trentm-semconv-up-instr-express branch May 28, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants