Skip to content

Commit

Permalink
Span tags for "unified naming conventions" (#20)
Browse files Browse the repository at this point in the history
* net_util -> platform_util

* get_process_id()

* move pthread_atfork into platform_util.cpp

* Tag every span with the process ID.

- glibc does not cache the process ID in user space.  So, as a
  (premature?) optimization, we cache the process ID and recalculate it
  whenever the process forks.
- The existing behavior of tagging each span with _dd.origin wasn't
  tested, so in testing this process ID change I also added a test for
  origin.

* Tag every span with the language "cpp".

* move random number generation into its own component

* Tag every span with a resource-id UUID.

* update includes graph

* missed a spot

* fix typo

* be consistent with the order

* wrong again!

* inline some at_fork handlers

* remove unnecessary includes

* comment the cached_* functions

* fix tag name: error.msg -> error.message

* remove unnecessary caveat

* delambdify

* generate 64 bits of randomness in a go, not 63

* modify bits high-to-low

* zero most significant bit of 64-bit trace IDs

* zero most significant bit of span IDs
  • Loading branch information
dgoffredo authored Jan 26, 2023
1 parent ae90dc5 commit a0f9a74
Show file tree
Hide file tree
Showing 21 changed files with 2,596 additions and 2,258 deletions.
6 changes: 4 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ cc_library(
"src/datadog/limiter.cpp",
"src/datadog/logger.cpp",
"src/datadog/msgpack.cpp",
"src/datadog/net_util.cpp",
"src/datadog/null_collector.cpp",
"src/datadog/optional.cpp",
"src/datadog/parse_util.cpp",
"src/datadog/platform_util.cpp",
"src/datadog/propagation_style.cpp",
"src/datadog/random.cpp",
"src/datadog/rate.cpp",
"src/datadog/sampling_decision.cpp",
"src/datadog/sampling_mechanism.cpp",
Expand Down Expand Up @@ -79,11 +80,12 @@ cc_library(
"src/datadog/limiter.h",
"src/datadog/logger.h",
"src/datadog/msgpack.h",
"src/datadog/net_util.h",
"src/datadog/null_collector.h",
"src/datadog/optional.h",
"src/datadog/parse_util.h",
"src/datadog/platform_util.h",
"src/datadog/propagation_style.h",
"src/datadog/random.h",
"src/datadog/rate.h",
"src/datadog/sampling_decision.h",
"src/datadog/sampling_mechanism.h",
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@ target_sources(dd_trace_cpp PRIVATE
src/datadog/limiter.cpp
src/datadog/logger.cpp
src/datadog/msgpack.cpp
src/datadog/net_util.cpp
src/datadog/null_collector.cpp
src/datadog/optional.cpp
src/datadog/parse_util.cpp
src/datadog/platform_util.cpp
src/datadog/propagation_style.cpp
src/datadog/random.cpp
src/datadog/rate.cpp
src/datadog/sampling_decision.cpp
src/datadog/sampling_mechanism.cpp
Expand Down Expand Up @@ -154,11 +155,12 @@ target_sources(dd_trace_cpp PUBLIC
src/datadog/limiter.h
src/datadog/logger.h
src/datadog/msgpack.h
src/datadog/net_util.h
src/datadog/null_collector.h
src/datadog/optional.h
src/datadog/parse_util.h
src/datadog/platform_util.h
src/datadog/propagation_style.h
src/datadog/random.h
src/datadog/rate.h
src/datadog/sampling_decision.h
src/datadog/sampling_mechanism.h
Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ all: ownership.svg includes.svg
%.svg: %.dot
dot -Grankdir=LR -Tsvg -o $@ $<

includes.dot: $(wildcard ../src/*)
includes.dot: $(wildcard ../src/datadog/*)
raco graph-includes --exclude-std-c --exclude-std-cpp --exclude-posix --extension h --extension cpp ../src/ >$@
Loading

0 comments on commit a0f9a74

Please sign in to comment.