ASCOMInitiative / ASCOMRemote

The ASCOM REST based Remote Driver Server and Remote Access Clients
GNU General Public License v3.0
57 stars 16 forks source link

[REQUEST] feat(logging): add open telemetry standard logging support #55

Open michealroberts opened 6 months ago

michealroberts commented 6 months ago

I was wondering if it were possible to add the possibility of formatting logs 🪵 in the Open Telemetry 🔭 standard as outlined here: Open Telemetry - Logs Data Model Specification.

I'd imagine, for backwards compatibility, if this could be opt-in initially as to not break any current implementations that anyone might be employing in wrapping the current log format.

Peter-Simpson commented 6 months ago

Hi Michael,

I've not come across this before so have likely missed some basic stuff as I read around the subject! 😁

Exceptions aside, ASCOM Remote logs comprise three fields of information, which I think map to these OpenTelemetry data fields:

  1. Time stamp ==> TimeStamp
  2. Originating area or data type key ==> Resource (I think, or possibly Attribute?)
  3. Informational message ==> Body

In addition, some ASCOM Remote entries are classed as debug and can be enabled if required, but most are information level. The debug messages aren't really helpful without the information messages that provide context.

Are these three elements what you would expect to form the basis of the telemetry log file?

I'm also not sure what form the output should take. The documentation suggests I could use the OpenTelemetry Protocol File Exporter to write OpenTelemetry format JSON files. Is this what you are expecting?

ASCOM Remote also implements log file rotation how would you expect this to be handled?

Having had a look at the specs they seem vast and overwhelming! I'm concerned about taking on something that later turns into a nightmare through further extension requests, but am prepared to have a go at something straightforward such as:

Would this work for you or something else that is straightforward to implement?

I see there is a .NET library so hopefully this would eliminate some of the grunt-work.

Best wishes, Peter