Skip to content

Commit

Permalink
[Trace SDK] Implement builders (open-telemetry#1393)
Browse files Browse the repository at this point in the history
Misc cleanup.
  • Loading branch information
marcalff committed Jul 1, 2022
1 parent a176c4c commit c94c174
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/cpp-sdk-factory-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ classified into the following two broad categories:
Assume an application needs to build a trace provider, using the gRPC trace
exporter.

### Case study, direct call to the SDK implementation classes.
### Case study, direct call to the SDK implementation classes

A possible way to build the exporter is to call, from the application code:

Expand Down Expand Up @@ -62,7 +62,7 @@ In summary, this line of code alone, in the application space:

prevents in practice any deployment using shared libraries.

### Case study, using Factory and builders from the SDK.
### Case study, using Factory and builders from the SDK

The SDK also provide Factory classes, that can be used as follows
from the application code:
Expand Down Expand Up @@ -154,8 +154,8 @@ void Foo(int x = 0, int y = 1, int z = 2);
Here, clients will call the old Foo(int x, int y) ABI, crashing in the SDK
because the SDK expects 3 parameters, not 2.

Because of this, conditional parameters are to be avoided, not to be used in the SDK
interface.
Because of this, conditional parameters are to be avoided,
not to be used in the SDK interface.

Note that using conditional parameters in the opentelemetry-cpp API is ok,
because the API is header only (there is no ABI).
3 changes: 2 additions & 1 deletion sdk/test/trace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ endforeach()
add_executable(sampler_benchmark sampler_benchmark.cc)
target_link_libraries(
sampler_benchmark benchmark::benchmark ${CMAKE_THREAD_LIBS_INIT}
opentelemetry_trace opentelemetry_resources opentelemetry_exporter_memory_trace)
opentelemetry_trace opentelemetry_resources
opentelemetry_exporter_memory_trace)

0 comments on commit c94c174

Please sign in to comment.