Skip to content

interpreter/php: use structured logging - #1644

Open
lucasly-ba wants to merge 1 commit into
open-telemetry:mainfrom
lucasly-ba:php-structured-logging
Open

interpreter/php: use structured logging#1644
lucasly-ba wants to merge 1 commit into
open-telemetry:mainfrom
lucasly-ba:php-structured-logging

Conversation

@lucasly-ba

Copy link
Copy Markdown

Part of #891

@lucasly-ba
lucasly-ba requested review from a team as code owners July 16, 2026 01:00
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 16, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: lucasly-ba / name: Lucas Ly Ba (02dd27e)

Comment thread interpreter/php/php.go Outdated
log.Debugf("PHP version %x: an error occurred while determining "+
"the VM kind (%v)",
version, err)
log.Debug("an error occurred while determining the VM kind",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log messages should start with capital letter (error message with small); keep also the PHP as context in the message

Suggested change
log.Debug("an error occurred while determining the VM kind",
log.Debug("An error occurred while determining the PHP VM kind",

Comment thread interpreter/php/php.go Outdated
if err != nil {
log.Debugf("PHP version %x: an error occurred while determining "+
"the return address for execute_ex: (%v)", version, err)
log.Debug("an error occurred while determining the return address for execute_ex",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.Debug("an error occurred while determining the return address for execute_ex",
log.Debug("An error occurred while determining the return address for PHP execute_ex",

Comment thread interpreter/php/php.go Outdated
log.Debugf("PHP version %x: an error occurred while determining "+
"the return address for execute_ex: (%v)", version, err)
log.Debug("an error occurred while determining the return address for execute_ex",
"version", version, "error", err)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is first of these translations, I'm raising some questions for other maintainers:

  • should the version be more specific, like php_version?
  • should there be an additional subsystem or module or similar tag to indicate it's php related?
Suggested change
"version", version, "error", err)
"php_version", version, "error", err)

@christos68k christos68k Jul 31, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a separate key (e.g. subsystem or module or package) for the main components and then additional keys like php_version wouldn't need the extra qualifier, so module:php, version:xyz would retain interpretability.

I think it'd be nice to have some basic guidelines for structured logging (e.g. in doc/logging-dev.md) before we start rewriting our existing logging en masse. We'd want to do that primarily for consistency which enables better UX on the consumer who'd be able to filter based on known keys.

@lucasly-ba Would you be interested in taking a crack at this?

A relevant issue is #417 which structured logging could also address by splitting the values with '/'. For example, we could have a module key with reporter, processmanager, tracer, collector and so on but logging code that requires an additional level of grouping could introduce its own nesting, e.g. going back to #417 we could have module:processmanager/pid and module:reporter/pdata.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes of course ! Will do it in quite a long time but ill ping you when i dig more into this

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 26, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-09-10 22:26 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@opentelemetry-pr-dashboard

This comment has been minimized.

Signed-off-by: Lucas Ly Ba <hi@lucaslyba.com>
@lucasly-ba
lucasly-ba force-pushed the php-structured-logging branch from 02dd27e to 48e7264 Compare September 10, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants