opentelemetry-cpp icon indicating copy to clipboard operation
opentelemetry-cpp copied to clipboard

Review logger Implementation for the stable log data model.

Open lalitb opened this issue 3 years ago • 9 comments
trafficstars

Log Data Model specs are marked as stable - https://github.com/open-telemetry/opentelemetry-specification/pull/2387. It would be a good time to review the logger api and sdk implementation and validate if the existing log structure can be mapped to this data model. Also, how to continue supporting fields/attributes that are not part of this logger model - eg log-name.

lalitb avatar Mar 28 '22 19:03 lalitb

I have a quick look at opentelemetry-proto to v0.17.0 and the main branch of logging-library-sdk in opentelemetry-specification, and I want to confirm and disscuss the changes.

  • InstrumentationLibrary is deprecated and we should use InstrumentationScope now.This will also changes the trace and metrics. Should we add a option to switch between legacy InstrumentationLibrary and new InstrumentationScope?
    • instrumentation_library_spans should be replaced by scope_spans
    • instrumentation_library_metrics should be replaced by scope_metrics
    • instrumentation_library_logs should be replaced by scope_logs
  • LogProcessor::OnReceive(LogRecordable) should be renamed to LogProcessor::Emit(LogData)
  • Rename LoggerProvider to LogEmitterProvider
  • Rename LoggerContext to LogEmitter and move InstrumentationScope from Logger to LogEmitter
  • Rename LogRecord to LogData

Am I missed anything?

owent avatar May 07 '22 07:05 owent

Hi @owent, thanks for looking into this. I'd vote for not having a switch for supporting legacy.

esigo avatar May 07 '22 07:05 esigo

Without supporting legacy,there will be break changes to SDK and the output of OTLP exporters.Especially the trace APIs are already stable, is it acceptable?

owent avatar May 07 '22 08:05 owent

Sure we will have breaking changes here. I'd still vote for not supporting legacy. We are already low on resources, and supporting both legacy and new proto will make maintenance more complicated for us. We can discuss this in the next SIG meeting. I'll update you. cc @lalitb @ThomsonTan

esigo avatar May 07 '22 08:05 esigo

Thanks, @owent for summarising the changes required.

  • Have created a separate issue #1381 to support InstrumentationScope. This shouldn't break the API/SDK for Traces at least. We can discuss the approach for this in the issue.
  • For the Logger SDK/API changes (which are part of this issue), we don't need to support the old API.

lalitb avatar May 07 '22 16:05 lalitb

#1383 closes it.

lalitb avatar Jun 01 '22 17:06 lalitb

@lalitb This issue has not be finished completely.I'm waiting for #1413 and then continue to implement LogEmitter, there may be more conflicts if I do it now.

owent avatar Jun 02 '22 02:06 owent

Yes my bad, we still need to implement LogEmitter. Reopening this issue.

lalitb avatar Jun 02 '22 02:06 lalitb

This issue was marked as stale due to lack of activity.

github-actions[bot] avatar Aug 02 '22 02:08 github-actions[bot]