-
Notifications
You must be signed in to change notification settings - Fork 440
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
Initial folder layout #8
Conversation
How about What is this going to look like from the consumer side? e.g.: // my_lib.cc
#include "opentelemetry/api/context/context.h"
void Run() {
opentelemetry::context::Context ctx = opentelemetry::context::CurrentContext();
ctx.span().add_annotation("I'm running!");
} And the build? # bazel BUILD file
cc_library(
name = "my_lib",
srcs = ["my_lib.cc"],
deps = ["@io_opentelemetry_cpp//opentelemetry/api/context:context"]
) |
This is what's in my mind (assuming opentelemetry API package is installed to the default include folder): #include <opentelemetry/context/context.h>
void Run() {
opentelemetry::context::Context ctx = opentelemetry::context::CurrentContext();
ctx.span().add_annotation("I'm running!");
} I wish to avoid |
This latest code snippet looks good to me. |
I like the snippet in #8 (comment) Is there an advantage to calling the parent dir In a bazel-style build, the target would look like one of:
In a |
Should we standardize on underscores instead of hyphens in filenames and directories? In particular, hyphens make interop with python impossible because it's a syntax error to |
I'd recommend choosing a directory structure that clearly separates the public header files from the source code and internal headers. One popular way of organizing would be to do something more like this
All the boost projects are organized in this fashion (see, for example, the layout of boost-filesystem). Even Envoy (which doesn't install header files) has this same sort separation for header files that act more like a public interface. Or, if the opentelemetry-api and opentelemetry-sdk don't function like isolated subprojects, maybe do something like this
|
Where would the top-level CMakeLists.txt file go? Does it go in the root directory? If I were to do something like this
Should that install both the api and an sdk with a default tracer? Or would I need to use separate cmake commands? |
Re #8 (comment): I agree about keeping private headers separate. In OpenCensus we use an How about:
Re #8 (comment): I would prefer to keep CMakeLists.txt and WORKSPACE in the root of the repo, yes. If someone has a compelling reason not to do this, please speak up. As for selecting which components to build, we could make those CMake |
We might want to separate the |
Being able to build everything from a single command is great! I think most of the actual build logic would be specific to API and SDK, the top level |
One command would be great and we should try to achieve it. Note that installing the default SDK implementation doesn't mean that the SDK default tracer will be used. User has to explicitly specify the SDK tracer, otherwise it will be using the no-op implementation provided by the API package. |
I would propose something like this for a layout:
|
Summarizing what we discussed in today's meeting:
Proposed layout:
Some rationale:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I only wonder if we could shorten opentelemetry-api
and opentelemetry-sdk
to api
and sdk
.
I agree with short api/ and sdk/ dir names. |
Do we plan to have exporters and other plugins/extensions in this repo? If not, having names like |
IMO start with exporters in the same repo and split them out later if it makes sense to do so. I see https://github.com/open-telemetry/opentelemetry-java has exporters/ and contrib/ directories. |
That works for me. |
Origin/propagators
Fix observable attributes drop (open-telemetry#2557)
This is the proposed folder layout according to the spec.
I've always been bad at (or at least struggling with) naming things. For example:
opentelemetry_api/opentelemetry/context
or justapi/context
? I imagine the C++ namespace would beopentelemetry.context
rather thanopentelemetry.api.context
.Would be happy to get more perspectives.