Skip to content

Add http client/server example#632

Merged
lalitb merged 17 commits intoopen-telemetry:mainfrom
lalitb:http-example
Mar 30, 2021
Merged

Add http client/server example#632
lalitb merged 17 commits intoopen-telemetry:mainfrom
lalitb:http-example

Conversation

@lalitb
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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.

Comment thread exporters/ostream/test/ostream_span_test.cc Outdated
Comment thread exporters/ostream/include/opentelemetry/exporters/ostream/span_exporter.h Outdated
Comment thread examples/http/server.hpp
Comment thread examples/http/client.cc Outdated
Comment thread examples/http/client.cc Outdated
Comment thread examples/http/CMakeLists.txt
Comment thread examples/http/README.md
Comment thread exporters/ostream/include/opentelemetry/exporters/ostream/span_exporter.h Outdated
Comment thread ext/include/opentelemetry/ext/http/server/socket_tools.h
Co-authored-by: Tom Tan <lilotom@gmail.com>
Comment thread examples/http/README.md Outdated
Comment thread examples/http/server.cc Outdated
Comment thread examples/http/server.hpp Outdated
Comment thread examples/http/server.hpp Outdated
Copy link
Copy Markdown
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
GerHobbelt pushed a commit to GerHobbelt/opentelemetry-cpp that referenced this pull request Mar 6, 2026
…and-patch-dependencies

Update all minor and patch dependencies
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