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

feat(plugin-http): add/modify attributes #643

Merged

Conversation

OlivierAlbertini
Copy link
Member

Which problem is this PR solving?

Short description of the changes

  • add new utility functions:
    • getAttributesFromHttpKind
    • getOutgoingRequestAttributes
    • getOutgoingRequestAttributesOnResponse
    • getIncomingRequestAttributes
    • getIncomingRequestAttributesOnResponse

Those method should be reused for the http2 plugin.
New specs comes with new network/http attributes
http.ts is more readable since we use those functions (in http plugin)
We also set some attributes sooner (before waiting the response)

  • Sync tests with https plugins

After reading new specs, http plugin need to update parseResponseStatus function...
I created #642

closes open-telemetry#373, open-telemetry#394

Signed-off-by: Olivier Albertini <olivier.albertini@montreal.ca>
@OlivierAlbertini OlivierAlbertini added the enhancement New feature or request label Dec 21, 2019
@codecov-io
Copy link

codecov-io commented Dec 21, 2019

Codecov Report

Merging #643 into master will decrease coverage by 0.67%.
The diff coverage is 92.61%.

@@            Coverage Diff             @@
##           master     #643      +/-   ##
==========================================
- Coverage   92.19%   91.51%   -0.68%     
==========================================
  Files         191      193       +2     
  Lines        9699    10021     +322     
  Branches      875      910      +35     
==========================================
+ Hits         8942     9171     +229     
- Misses        757      850      +93
Impacted Files Coverage Δ
packages/opentelemetry-plugin-ioredis/src/enums.ts 100% <100%> (ø)
...ckages/opentelemetry-plugin-ioredis/src/ioredis.ts 100% <100%> (ø)
...ages/opentelemetry-plugin-mysql/test/mysql.test.ts 98.2% <33.33%> (ø) ⬆️
...n-postgres/opentelemetry-plugin-pg/test/pg.test.ts 94.27% <60%> (-0.03%) ⬇️
...ages/opentelemetry-plugin-redis/test/redis.test.ts 92.78% <60%> (-0.08%) ⬇️
packages/opentelemetry-plugin-ioredis/src/utils.ts 84.21% <84.21%> (ø)
.../opentelemetry-plugin-ioredis/test/ioredis.test.ts 94.63% <94.63%> (ø)
...kages/opentelemetry-metrics/test/mocks/Exporter.ts 66.66% <0%> (-33.34%) ⬇️
...ges/opentelemetry-plugin-https/test/utils/utils.ts 33.33% <0%> (-26.67%) ⬇️
...entelemetry-exporter-jaeger/test/transform.test.ts 100% <0%> (ø) ⬆️
... and 21 more

@OlivierAlbertini
Copy link
Member Author

Example with new attributes:

Capture d’écran, le 2019-12-21 à 17 42 11

Capture d’écran, le 2019-12-21 à 17 41 56

refactor: remove useless checks
test: add assertions

Signed-off-by: Olivier Albertini <olivier.albertini@montreal.ca>
Signed-off-by: Olivier Albertini <olivier.albertini@montreal.ca>
Copy link
Member

@vmarchaud vmarchaud left a comment

Choose a reason for hiding this comment

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

lgtm

@dyladan dyladan added the Merge:LGTM This PR is ready to be merged by a Maintainer (has enough valid approvals, successful build, etc.) label Dec 30, 2019
@mayurkale22 mayurkale22 merged commit 3d9b822 into open-telemetry:master Jan 2, 2020
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Dec 15, 2023
… for bubbled events (open-telemetry#643)

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Merge:LGTM This PR is ready to be merged by a Maintainer (has enough valid approvals, successful build, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[plugin-http] Create a span builder [plugin-http] attribute specs update
5 participants