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

Update the parameter names in LoggerProvider::GetLogger

Open ThomsonTan opened this issue 1 year ago • 7 comments

The following spec says name and version' for "Get a Logger" in LoggerProvider, but they are named as library_nameandlibrary_version` in the OpenTelemetry C++ API (see the second link below). Could the parameter names be updated to be consistent with the spec which could reduce confusion for the users coming from spec or SDK from other languages?

https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md#get-a-logger

https://github.com/open-telemetry/opentelemetry-cpp/blob/main/api/include/opentelemetry/logs/logger_provider.h#L48

This is based on https://github.com/open-telemetry/opentelemetry-cpp/issues/2680#issuecomment-2140346314.

ThomsonTan avatar May 31 '24 00:05 ThomsonTan

Reviewed the GetTracer API. The same issue is not there. @lalitb thanks for the reminder.

https://github.com/open-telemetry/opentelemetry-cpp/blob/4f37503105d1572423e161ca171ac8d046d66341/api/include/opentelemetry/trace/tracer_provider.h#L121

ThomsonTan avatar Jun 03 '24 20:06 ThomsonTan

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

github-actions[bot] avatar Aug 05 '24 01:08 github-actions[bot]

This issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution! :sparkles:

github-actions[bot] avatar Feb 18 '25 15:02 github-actions[bot]

could i work on this since no body pick it? @ThomsonTan and @marcalff

zurex avatar Apr 01 '25 07:04 zurex

The spec link should be: get-a-logger

zurex avatar Apr 06 '25 16:04 zurex

Hi @ThomsonTan @marcalff and @lalitb , i want align with you for clarification on the design choices and potential next steps.

Background

The current C++ implementation of GetLogger uses parameters logger_name, library_name, library_version and schema_url, which appear to deviate from the OpenTelemetry Logger Specification. The spec defines name, version, schema_url, and attributes as the parameters for instrumentation scope identification.

Key Questions:

Parameter Naming Consistency

The spec uses name to identify the instrumentation scope (e.g., library/module/component). In the current implementation, logger_name seems to serve this role. Would renaming library_name to name align with the spec’s intent while maintaining backward compatibility?

Ambiguity Between logger_name and name

The parameter logger_name is used as a provider-specific identifier (e.g., ETW Provider name). However, this conflicts with the spec’s name, which is meant to identify the instrumentation scope.

How does logger_name conceptually differ from the spec’s name?

Could logger_name be moved to vendor-specific configurations (e.g., LoggerProvider options) to avoid confusion?

zurex avatar Apr 06 '25 16:04 zurex

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

github-actions[bot] avatar Jun 06 '25 02:06 github-actions[bot]