Skip to content

Commit aaa4b65

Browse files
[OneDS] Integrate Event Tracking Mechanism in OneDS (#1115)
* Add * Integrate Event Tracking Mechanism in 1DS * Fix unnecessary file * Remove file checked in by mistake * Update description for macro * Comment Fix
1 parent ba37c8f commit aaa4b65

16 files changed

+42
-0
lines changed

docs/building-custom-SKU.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Build recipe must contain the following preprocessor definitions:
2626
| HAVE_MAT_ZLIB | on | Use zlib for HTTP requests compression. This option must always be turned on for any high-volume telemetry project |
2727
| HAVE_MAT_LOGGING | on | Enable internal SDK tracing / debug logging |
2828
| HAVE_MAT_WIN_LOG | off | Will log statements to disk on windows if trace enabled and HAVE_MAT_LOGGING defined |
29+
| HAVE_MAT_EVT_TRACEID | off | Enable event tracking by adding trace-id to http request header on Windows. This is for debugging purpose, and not recommended to be enabled in production. The collector doesn't parse/read this header. As of now, this is meant to be used through the capi, where the http-send handler should remove this header from the event data before sending it to collector. |
2930
| HAVE_MAT_STORAGE | on | Enable SQLite persistent offline storage |
3031
| HAVE_MAT_NETDETECT | on | _Win32 Desktop only_: Use NLM COM object for network cost detection on Windows 8+ |
3132
| HAVE_MAT_SHORT_NS | off | Use short "MAT::" namespace instead of "Microsoft::Applications::Events::" to reduce the .DLL size |

lib/http/HttpRequestEncoder.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ namespace MAT_NS_BEGIN {
4545
ctx->httpRequest->SetUrl(m_config.GetCollectorUrl());
4646

4747
ctx->httpRequest->GetHeaders().set("Expect", "100-continue");
48+
49+
#ifdef HAVE_MAT_EVT_TRACEID
50+
ctx->httpRequest->GetHeaders().set("Trace-Id", ctx->traceId);
51+
#endif //HAVE_MAT_EVT_TRACEID
52+
4853
ctx->httpRequest->GetHeaders().set("SDK-Version", PAL::getSdkVersion());
4954
ctx->httpRequest->GetHeaders().set("Client-Id", "NO_AUTH");
5055
ctx->httpRequest->GetHeaders().set("Content-Type", "application/bond-compact-binary");

lib/include/mat/config-MIP.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define HAVE_MAT_ZLIB
1414
#define HAVE_MAT_LOGGING
1515
#define HAVE_MAT_WIN_LOG
16+
#define HAVE_MAT_EVT_TRACEID
1617
#define HAVE_MAT_STORAGE
1718
#if defined(_WIN32)
1819
#define WIN_DESKTOP

lib/include/mat/config-MSIPC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define HAVE_MAT_ZLIB
1717
#define HAVE_MAT_LOGGING
1818
/* #define HAVE_MAT_WIN_LOG */
19+
/* #define HAVE_MAT_EVT_TRACEID */
1920
#define HAVE_MAT_STORAGE
2021
#define WIN_DESKTOP
2122
#define HAVE_MAT_DEFAULT_HTTP_CLIENT

lib/include/mat/config-compact-dll.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define HAVE_MAT_ZLIB
1515
/* #define HAVE_MAT_LOGGING */
1616
/* #define HAVE_MAT_WIN_LOG */
17+
/* #define HAVE_MAT_EVT_TRACEID */
1718
/* #define HAVE_MAT_STORAGE */
1819
/* #define HAVE_MAT_NETDETECT */
1920
/* #define HAVE_MAT_SHORT_NS */

lib/include/mat/config-compact-exp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define HAVE_MAT_ZLIB
1515
/* #define HAVE_MAT_LOGGING */
1616
/* #define HAVE_MAT_WIN_LOG */
17+
/* #define HAVE_MAT_EVT_TRACEID */
1718
#define HAVE_MAT_STORAGE
1819
/* #define HAVE_MAT_NETDETECT */
1920
/* #define HAVE_MAT_SHORT_NS */

lib/include/mat/config-compact-min.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/* #define HAVE_MAT_ZLIB */
1515
/* #define HAVE_MAT_LOGGING */
1616
/* #define HAVE_MAT_WIN_LOG */
17+
/* #define HAVE_MAT_EVT_TRACEID */
1718
/* #define HAVE_MAT_STORAGE */
1819
/* #define HAVE_MAT_NETDETECT */
1920
/* #define HAVE_MAT_SHORT_NS */

lib/include/mat/config-compact-noutc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/* #define HAVE_MAT_ZLIB */
1515
/* #define HAVE_MAT_LOGGING */
1616
/* #define HAVE_MAT_WIN_LOG */
17+
/* #define HAVE_MAT_EVT_TRACEID */
1718
/* #define HAVE_MAT_STORAGE */
1819
/* #define HAVE_MAT_NETDETECT */
1920
#define HAVE_MAT_SHORT_NS

lib/include/mat/config-compact.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/* #define HAVE_MAT_ZLIB */
1515
/* #define HAVE_MAT_LOGGING */
1616
/* #define HAVE_MAT_WIN_LOG */
17+
/* #define HAVE_MAT_EVT_TRACEID */
1718
/* #define HAVE_MAT_STORAGE */
1819
/* #define HAVE_MAT_NETDETECT */
1920
#define HAVE_MAT_SHORT_NS

lib/include/mat/config-default-cs4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define HAVE_MAT_ZLIB
2525
#define HAVE_MAT_LOGGING
2626
/* #define HAVE_MAT_WIN_LOG */
27+
/* #define HAVE_MAT_EVT_TRACEID */
2728
#define HAVE_MAT_STORAGE
2829
#define HAVE_MAT_DEFAULT_HTTP_CLIENT
2930
#define HAVE_MAT_LIVEEVENTINSPECTOR

0 commit comments

Comments
 (0)