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 http client/server example #632

Merged
merged 17 commits into from
Mar 30, 2021
Merged

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Mar 26, 2021

Fixes #631

Changes

Adds simple client/server example using http client and server library as provided by this repo.

It's very simple functionality for now to create and dump spans at both the end. Next step would be to have nested spans and w3c context propagation.

Also small formatting fix in ostream exporter to dump attributes properly. Currently on xterm, contents get wrapped on same line and not readable properly for larger attributes.

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team March 26, 2021 13:03
@lalitb lalitb changed the title Http example Add http client/server example Mar 26, 2021
@codecov
Copy link

codecov bot commented Mar 26, 2021

Codecov Report

Merging #632 (45c8b99) into main (6337225) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #632      +/-   ##
==========================================
+ Coverage   94.49%   94.51%   +0.02%     
==========================================
  Files         197      197              
  Lines        9130     9127       -3     
==========================================
- Hits         8627     8626       -1     
+ Misses        503      501       -2     
Impacted Files Coverage Δ
exporters/ostream/test/ostream_span_test.cc 100.00% <ø> (ø)
...de/opentelemetry/exporters/ostream/span_exporter.h 100.00% <100.00%> (+3.70%) ⬆️
exporters/ostream/src/span_exporter.cc 88.88% <100.00%> (ø)
sdk/src/logs/batch_log_processor.cc 95.00% <0.00%> (+1.25%) ⬆️

Copy link
Member

@TomRoSystems TomRoSystems left a comment

Choose a reason for hiding this comment

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

Small suggestions.

exporters/ostream/test/ostream_span_test.cc Outdated Show resolved Hide resolved
examples/http/server.hpp Show resolved Hide resolved
examples/http/client.cc Outdated Show resolved Hide resolved
examples/http/client.cc Outdated Show resolved Hide resolved
examples/http/CMakeLists.txt Show resolved Hide resolved
examples/http/README.md Show resolved Hide resolved
examples/http/README.md Outdated Show resolved Hide resolved
examples/http/server.cc Outdated Show resolved Hide resolved
examples/http/server.hpp Outdated Show resolved Hide resolved
examples/http/server.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@maxgolov maxgolov left a comment

Choose a reason for hiding this comment

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

I'm generally OK with this, but it would be best if you fix the not-so-atomic check-run-assign on atomic, because someone else may look at this code, and spread the erroneous implementation elsewhere.

@lalitb lalitb merged commit 179a7f4 into open-telemetry:main Mar 30, 2021
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.

Add simple http client/server example
5 participants