itwinjs-core icon indicating copy to clipboard operation
itwinjs-core copied to clipboard

Improve telemetry capturing

Open grigasp opened this issue 3 years ago • 2 comments

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.

grigasp avatar Jun 10 '22 13:06 grigasp

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: boolean attribute. 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

grigasp avatar Jul 15 '22 07:07 grigasp

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

grigasp avatar Jul 15 '22 07:07 grigasp