itwinjs-core
itwinjs-core copied to clipboard
Improve telemetry capturing
Need a way to gather telemetry information, especially:
- what requests are being made and how long they take
- what rules/attributes are being used
Our current @alpha diagnostics' API could probably be enhanced for this.
Here's what I think is needed for performance diagnostics:
- [x] Add ability to filter-out diagnostics scopes based on duration. E.g. diagnostics props now accept a
perf: booleanattribute. We should add an option to specify duration instead of boolean and only include scopes that take longer than given duration.- https://github.com/iTwin/itwinjs-core/pull/4098
- [x] Once a backend request is handled and we receive diagnostics, need ability to convert our format to OpenTelemetry format.
- https://github.com/iTwin/itwinjs-core/pull/4139
- [x] Upload diagnostics to Honeycomb. Not all consumers will be using Honeycomb - we probably just need to provide consumers a way to supply a callback that accepts OpenTelemetry data. If the callback is provided, we request diagnostics, convert them to OpenTelemetry and pass to consumer. If not, then we shouldn't request diagnostics at all.
- https://github.com/iTwin/itwinjs-core/pull/4139
I'm not sure what's the best way to report rules / attributes used in requests - needs investigation.
Alina's PR: https://github.com/iTwin/itwinjs-core/pull/4133