Skip to content
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

C API improvements. Host-Guest improvements. Ability to update context via C API. #1122

Open
wants to merge 56 commits into
base: main
Choose a base branch
from

Conversation

maxgolov
Copy link
Contributor

cc: @kindbe since we used to work originally on this feature, especially the scope parameter.

Description

There is a very detailed long-overdue markdown document that explains the Host-Guest feature, use-cases, purpose of scope (for sandboxing / isolation). And a separate file with fairly comprehensive Functional Tests (TADA!).

What it gives - TL;DR

Our team uses 1DS C API to pass telemetry contexts around in our hybrid app that is written in Unity C#, C/C++ and JavaScript (WebAssembly). Eventing works great. What we are missing is ability to consolidate telemetry contexts across languages. 1DS itself has the SetContext API and Semantic Context concept. Although these APIs were not exposed to C API. And did not have ability to intake parameters expressed in canonic Common Schema notation. Ex. you could not pass ext.device.localId or ext.os.ver to SetContext. Our team also uses exclusively the modern Common Schema. While old-style COMMONFIELD aliases could be appropriate for teams that export to A**a-Kusto, in our case we prefer our developers to operate on classic Common Schema events. The way you see them showing in Diagnostic Data Viewer application. Referencing old-style aliases causes confusion, questions, and unnecessary effort to remember things our devs would hardly ever need.

What's included:

  • design document.
  • comprehensive set of tests for Host-Guest functionality.
  • two new C APIs: evt_set_logmanager_context(s) and evt_set_logger_context(s). These APis are somewhat smarter than SetContext since they'd automagically detect a Common Schema Part A property if it starts with ext.. And remap it to corresponding place in Bond CsRecord. This would also be a gateway to eventual adoption of JSON notation: more and more customers move away from A**a-Kusto to their own private Kusto clusters - due to privacy, compliance, GDPR and EUDB requirements, that could be more easily satisfied with a private cluster. All these customers would prefer Common Schema notation ext.app.localid instead of AppInfo.Id. Also this matches precisely what you see on wire.

This PR also contains a stable C# ABI from my other older PR. I'll refactor the other one to use it as a C# usage example instead. API has been tested and proven to work on Windows, Mac, and Android ARM64 devices.

@maxgolov maxgolov marked this pull request as draft March 30, 2023 08:33
@maxgolov maxgolov marked this pull request as ready for review April 4, 2023 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants