54 Commits

Author SHA1 Message Date
Ray Jenkins
6567409a39 Simplify MessagePack string decoding logic.
Remove use of strcmp, handle reading size in readMPString.
2022-04-07 14:55:35 -05:00
Andrew Noyes
966402a7a2
Allocate at least sizeof(ArenaBlock) for an ArenaBlock (#6770)
* Allocate at least sizeof(ArenaBlock) for an ArenaBlock

* Fix message pack unit test

Previously we were using only the 4 least significan bits as the length
of a message pack string, but it should be 5 according to https://github.com/msgpack/msgpack/blob/master/spec.md#str-format-family
2022-04-05 18:14:10 -07:00
Ray Jenkins
bb9b9d2471
OpenTelemetry API Tracing. (#6478)
* OTEL Span Implementation.

* Addi trace logging, refactor constructors, unit tests.

* Unit tests for creating OTELSpans

* refactor flag names

* Additional comments.

* Formatting.

* Add back Arena.h include

* cleanup header includes

* Remove include cstddef.

* Remove memory include.

* Remove trailing commas on enums.

* Enum formatting.

* Changing SpanStatus enum from ERROR to ERR to see if it is clashing with Windows.h.

* Move OTELEvents to SmallVectorRef<KeyValueRef>.

* Clean up unused includes.

* Unit tests

* Const reference arguments for OTEL constructors and additional addAttribute
unit tests. Adding return of OTELSpan reference on addAttribute.

* Formatting.

* Begin messagepack encoding tests.

* Formatting.

* MessagePack encoding unit tests.

* Formatting.

* Remove swapBinary.

* remove ambiguous helper methods

* Formatting fixes

* Fix ambiguous calls in AddEvents unit tests.

* Include AddAttributes unit test.

* descope windows for UDP encoding test

* Move ifndef WIN32 around MPEncoding unit test.

* Fix AddEvents Attributes size assertion.

* Formatting.

* Enable AddLinks unit test.

* Full MP encoding testing.

* Fix for encoding longer strings with MessagePack and unit test.

* Remove unnecessary header includes and serialize_string_ref function.

* Fix typos

* Update flow/Tracing.actor.cpp

Co-authored-by: Lukas Joswiak <lukas.joswiak@snowflake.com>

* Update flow/Tracing.actor.cpp

Co-authored-by: Lukas Joswiak <lukas.joswiak@snowflake.com>

* Use ASSERT_WE_THINK and add logging.

We don't want people creating incredibly large traces, so we are only
supporting a subset of MessagePack collection and string sizes. Assert
and log when we hit these unsupported sizes.

* Remove TODOs no longer applicable.

* Refactor OTELEvent to OTELEventRef.

* Remove unnecessary public declaration in struct.

* fix OTELEventRef attribute size assertion

* Formatting

Co-authored-by: Lukas Joswiak <lukas.joswiak@snowflake.com>
2022-04-04 17:55:38 -07:00
sfc-gh-tclinkenbeard
a71099471b Update copyright header dates 2022-03-21 13:36:23 -07:00
Ray Jenkins
250b57cc8d Force loopback address when in simulation mode. 2022-02-07 15:49:35 -08:00
Ray Jenkins
a5681c52bf Force loopback addr when in simulation mode. 2022-02-07 15:49:35 -08:00
Ray Jenkins
226236600e Preserving original LISTENER_PORT knob and adding new Knob TRACING_UDB_LISTENER_ADDR 2022-02-07 15:49:35 -08:00
Ray Jenkins
b588089fe7 formatting 2022-02-07 15:49:35 -08:00
Ray Jenkins
1bd084810c Refactor TRACING_UDP_LISTENER_PORT to TRACING_UDP_LISTENER_ADDR. 2022-02-07 15:49:35 -08:00
Lukas Joswiak
1da288822f Remove distributed trace database option 2021-11-10 13:33:49 -08:00
Lukas Joswiak
8bc0c3e8a2 Convert distributed trace sampling rate to a database option 2021-11-10 13:33:49 -08:00
sfc-gh-tclinkenbeard
25257f6f87 Enable unused-function warning for clang 2021-11-01 14:18:31 -07:00
Lukas Joswiak
e034f66fc2 Add knob to control trace recording percentage 2021-10-01 16:30:46 -07:00
sfc-gh-tclinkenbeard
3442ebd3b7 Fix more -Wreorder-ctor warnings across many files 2021-07-24 11:20:51 -07:00
FDB Formatster
df90cc89de apply clang-format to *.c, *.cpp, *.h, *.hpp files 2021-03-10 10:18:07 -08:00
Lukas Joswiak
d676cb32e1 Separate tracers that will run in simulation from those that won't 2021-03-02 10:35:37 -08:00
Lukas Joswiak
f9c8674bc9 Use auto 2021-02-16 16:48:51 -08:00
Lukas Joswiak
30d2d9ff82 Remove async tracer 2021-02-16 16:36:33 -08:00
Andrew Noyes
4ee97c0784 Use clang-tidy to automatically fix missing overrides
Use `clang-tidy -p . $file -checks='-*,modernize-use-override' -header-filter='.*' -fix`
to fix missing overrides, and then use git clang-format to reformat just
those changes. This went pretty well for most files.

Formatting the following files went off the rails, so I'm going to
follow up with a commit that's just clang-tidy and no clang-format.

- fdbclient/DatabaseBackupAgent.actor.cpp
- fdbclient/FileBackupAgent.actor.cpp
- fdbserver/OldTLogServer_4_6.actor.cpp
- fdbmonitor/SimpleIni.h
- fdbserver/workloads/ClientTransactionProfileCorrectness.actor.cpp
2021-01-26 02:04:12 +00:00
Andrew Noyes
0ef44739ea Fix OPEN_FOR_IDE build in preparation for using clang-tidy 2021-01-26 02:04:11 +00:00
Lukas Joswiak
4d6fbf099c Use StringRef for span tags 2021-01-20 13:57:36 -08:00
Lukas Joswiak
34ad4b617b Add support for longer strings 2021-01-20 13:57:36 -08:00
Lukas Joswiak
5f5f487967 Allow zero length strings 2021-01-20 13:57:36 -08:00
Lukas Joswiak
e27f2ca3fb Remove some tracers from Windows 2021-01-20 13:57:36 -08:00
Lukas Joswiak
b9c6ca2481 Fix Windows compilation 2021-01-20 13:57:36 -08:00
Lukas Joswiak
3f7e19a182 Add tags to spans to provide additional metadata 2021-01-20 13:57:36 -08:00
Lukas Joswiak
f6f53c7a73 Style updates 2021-01-20 13:57:36 -08:00
Lukas Joswiak
e8397b3812 Move UDP listen port to knob 2021-01-20 13:57:36 -08:00
Lukas Joswiak
8cc55a3ed5 Fix merge issues 2021-01-20 13:57:36 -08:00
Lukas Joswiak
e8038cd2c1 Remove debug code 2021-01-20 13:57:36 -08:00
Lukas Joswiak
de8bf9f6cf Write span context as separate 64-bit ints 2021-01-20 13:57:36 -08:00
Lukas Joswiak
ecdb96a7b9 Add IP address and port to serialized spans 2021-01-20 13:57:36 -08:00
Lukas Joswiak
98e6ba6962 Add POSIX send functionality 2021-01-20 13:57:36 -08:00
Lukas Joswiak
13858a853c Backoff future send attempts if a send failure occurs 2021-01-20 13:57:36 -08:00
Lukas Joswiak
d2143f184a Add fast UDP tracer 2021-01-20 13:57:36 -08:00
Lukas Joswiak
4ea5267bfd Add TEST macro 2021-01-20 13:57:36 -08:00
Lukas Joswiak
6800a4dcb3 Fix incorrect simulation check for first byte
The array representing fields of the Span can be size 4 or 5, depending
on whether the Span has any parents or not.
2021-01-20 13:57:36 -08:00
Lukas Joswiak
3c11b4b1bd Cleanup 2021-01-20 13:57:36 -08:00
Lukas Joswiak
3132c38bff Rename fluentd -> UDP 2021-01-20 13:57:36 -08:00
Lukas Joswiak
069d75b6f2 Update format of serialized spans
Write span context as a string instead of as two 64-bit integers. Also
removes some debug code.
2021-01-20 13:57:36 -08:00
Lukas Joswiak
abedd7a147 Fix msgpack array size format
Was being written in little-endian, should be written in big-endian.
2021-01-20 13:57:36 -08:00
Lukas Joswiak
e2f57b0845 Modify trace calls 2021-01-20 13:57:36 -08:00
Lukas Joswiak
45699f82be Abandon sending traces after first failed attempt 2021-01-20 13:57:36 -08:00
Lukas Joswiak
cfba197302 Catch errors around async_send 2021-01-20 13:57:36 -08:00
Lukas Joswiak
3b8a84a153 Add per-test buffers created trace 2021-01-20 13:57:36 -08:00
Lukas Joswiak
aa16ea6024 Add additional trace calls 2021-01-20 13:57:36 -08:00
Lukas Joswiak
b3879d7919 Remove actor ready assertions 2021-01-20 13:57:35 -08:00
Lukas Joswiak
753bdd235e Add UDP server to check received packets in simulation 2021-01-20 13:57:35 -08:00
Lukas Joswiak
96029ca08f Serialize span as array instead of as map 2021-01-20 13:57:35 -08:00
Lukas Joswiak
add80be134 Add support for arrays with up to 65535 elements 2021-01-20 13:57:35 -08:00