opentelemetry-cpp
opentelemetry-cpp copied to clipboard
Review logger Implementation for the stable log data model.
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.
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.
InstrumentationLibraryis deprecated and we should useInstrumentationScopenow.This will also changes the trace and metrics. Should we add a option to switch between legacyInstrumentationLibraryand newInstrumentationScope?instrumentation_library_spansshould be replaced byscope_spansinstrumentation_library_metricsshould be replaced byscope_metricsinstrumentation_library_logsshould be replaced byscope_logs
LogProcessor::OnReceive(LogRecordable)should be renamed toLogProcessor::Emit(LogData)- Rename
LoggerProvidertoLogEmitterProvider - Rename
LoggerContexttoLogEmitterand moveInstrumentationScopefromLoggertoLogEmitter - Rename
LogRecordtoLogData
Am I missed anything?
Hi @owent, thanks for looking into this. I'd vote for not having a switch for supporting legacy.
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?
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
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.
#1383 closes it.
@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.
Yes my bad, we still need to implement LogEmitter. Reopening this issue.
This issue was marked as stale due to lack of activity.