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

[Logs] Reporting logger name, log bridge name and version

Open pellared opened this issue 1 year ago • 8 comments

What are you trying to achieve?

I would like a convention on how the log bridges should report:

  • logger name
  • log bridge [package] name
  • log bridge [package] version

Thanks to this backends would get telemetry of the log bridges in use that can help with troubleshooting and provide information what log bridges are popular.

Currently instrumentation scope name is supposed to be used as a "logger name" per: opentelemetry-specification/specification/logs/bridge-api.md

For log sources which define a logger name (e.g. Java Logger Name) the Logger Name should be recorded as the instrumentation scope name.

An initial proposal for the change was here, but it was postponed until now.

Slack thread before the issue was created: https://cloud-native.slack.com/archives/C041APFBYQP/p1721231579496729

Proposal A

Add bridge.name and bridge.version instrumentation scope attributes to report the log bridge package name and version. Use logger's instrumentation scope name parameter via Bridge API to report the logger name.

Benefits:

  • Does not require changing the Bridge API specification.

Drawbacks:

  • Hard to implement bridges for log libraries which do not have a concept of a "logger name" or they do not use them by default.
  • Most SDKs does not support instrumentation scope attributes. Related PR: https://github.com/open-telemetry/opentelemetry-specification/pull/4146
  • Acquiring a logger on hot-path may be less performant
  • High cardinality of instrumentation scope name. More here.

Proposal B

Use logger's instrumentation scope parameters via Bridge API to report the log bridge package name and version. Add logger.name log attribute to report the logger name.

Benefits:

  • Similar pattern to instrumentation libraries where library name and version is reported as instrumentation scope.
  • Since there is no need to obtain different Loggers for each name, performance hit in hot path can be avoided
  • Not all logging libraries have a concept of a logger name. But all bridges should have some name.

Drawbacks:

  • May require changing the Bridge API specification. The change would not be breaking the specification as it does not include normative wording. However, it may be seen a breaking change for the Bridge Log API libraries if such requirement is settled e.g. via documentation. Analysis of existing API docs: here.

pellared avatar Jul 22 '24 14:07 pellared

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Nov 10 '24 20:11 github-actions[bot]

This issue was closed because it has been marked as stale for 30 days with no activity.

github-actions[bot] avatar Dec 15 '24 20:12 github-actions[bot]