cpp_client_telemetry icon indicating copy to clipboard operation
cpp_client_telemetry copied to clipboard

How to override the DeviceInfo.OsVersion field from client app?

Open lalitb opened this issue 2 years ago • 5 comments

Discussed in https://github.com/microsoft/cpp_client_telemetry/discussions/1092

Originally posted by nishchith-cp January 20, 2023 Need to set the DeviceInfo.OsVersion from the client side. Currently, the DeviceInfo.OsVersion is being populated within the SDK. We want to set this from our client to support the format xx.xx.xx

I don't see any APIs exposed for the same. I tried to override the field using setContext API but it doesn't seem to work.

Kindly help with the same. Is there any way to override this from the client side?

lalitb avatar Jan 20 '23 19:01 lalitb

Sorry for confusion, moving this back from Discussion to Issue. Adding comment here again -

The 1ds core C++ provides ISemanticContext::SetOsVersion() to explicitly set the OS version. But I don't see this implemented for iOS - https://github.com/microsoft/cpp_client_telemetry/blob/974c581854d4f6d72a3f889b5520e0e08ba96d86/wrappers/obj-c/ODWSemanticContext.mm. I faster way would be to contribute the change.

lalitb avatar Jan 20 '23 19:01 lalitb

@lalitb When can we expect this change from the OneDS team?

nishchith-cp avatar Feb 01 '23 04:02 nishchith-cp

@nishchith-cp - faster way would be to contribute the change. I don't think it is any of the maintainers would have required bandwidth for this anytime soon.

lalitb avatar Feb 01 '23 07:02 lalitb

@lalitb @nishchith-cp - I have a change that'd expose this via C API, verifying in a test that ext.os.ver is populated. You can also use C++ semantic context pattern that'd be shown in my PR. One of the tricks that in CS3 schema the field should actually be set via COMMONFIELDS_OS_BUILD.

maxgolov avatar Mar 30 '23 04:03 maxgolov

@maxgolov Would the setContext API work with your changes? Could you share your PR for the same?

nishchith-cp avatar Apr 26 '23 09:04 nishchith-cp