Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

monolog scope name from channel #174

Merged
merged 6 commits into from
Jul 11, 2023
Merged

Conversation

brettmc
Copy link
Collaborator

@brettmc brettmc commented Jun 27, 2023

  • exceptions were being emitted as an array under the 'exception' key, which does not conform to our new enforcement that array attribute values must be homogeneous. Instead, format the exception to use the proper sementic convention attributes ('exception.xyz`)
  • do not emit context + extra as their own attribute keys. This will very often break the 'must be homogeneous' test, so move them up to top-level attribute (with context taking precedence if the same key exists in both)
  • use the monolog channel name to create a scope for each channel (which means now the logger will create and reference one logger per scope/channel)

Fixes: open-telemetry/opentelemetry-php#1049

* exceptions were being emitted as an array under the 'exception' key, which does not
conform to our new enforcement that array attribute values must be homogeneous. Instead,
format the exception to use the proper sementic convention attributes ('exception.xyz`)
* do not emit context + extra as their own attribute keys. This will very often break
the 'must be homogeneous' test, so move them up to top-level attribute (with context
taking precedence if the same key exists in both)
* use the monolog channel name to create a scope for each channel (which means now
the logger will create and reference one logger per scope/channel)
@brettmc brettmc requested a review from a team June 27, 2023 01:53
@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Merging #174 (dbd69af) into main (e866749) will increase coverage by 25.29%.
The diff coverage is 25.00%.

❗ Current head dbd69af differs from pull request most recent head 188946e. Consider uploading reports for the commit 188946e to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##              main     #174       +/-   ##
============================================
+ Coverage     7.98%   33.27%   +25.29%     
- Complexity     239      762      +523     
============================================
  Files           24       66       +42     
  Lines          952     2897     +1945     
============================================
+ Hits            76      964      +888     
- Misses         876     1933     +1057     
Flag Coverage Δ
7.4 47.53% <34.69%> (+29.88%) ⬆️
8.0 35.59% <25.00%> (+25.65%) ⬆️
8.1 28.92% <26.92%> (+18.85%) ⬆️
8.2 25.31% <26.92%> (+17.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Aws/src/AwsSdkInstrumentation.php 49.01% <ø> (ø)
src/Instrumentation/Laravel/src/QueryWatcher.php 0.00% <ø> (ø)
...c/Instrumentation/Psr3/src/Psr3Instrumentation.php 0.00% <0.00%> (ø)
...telSdkBundle/DependencyInjection/Configuration.php 0.00% <0.00%> (ø)
...SdkBundle/DependencyInjection/OtelSdkExtension.php 0.00% <0.00%> (ø)
src/Aws/src/Xray/Propagator.php 100.00% <100.00%> (ø)
src/Logs/Monolog/src/Handler.php 100.00% <100.00%> (ø)
...fony/src/OtelBundle/HttpKernel/RequestListener.php 77.34% <100.00%> (ø)
...src/OtelSdkBundle/Debug/TraceableSpanProcessor.php 100.00% <100.00%> (ø)
...ymfony/src/OtelSdkBundle/Trace/ExporterFactory.php 100.00% <100.00%> (ø)

... and 32 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e866749...188946e. Read the comment docs.

the original code was correct, but required an upstream (sdk) fix
to support complex attributes for a LogRecord
@brettmc brettmc changed the title monolog array handling + scope name monolog scope name from channel Jul 11, 2023
@brettmc brettmc merged commit 795c7d5 into open-telemetry:main Jul 11, 2023
49 of 51 checks passed
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.

Monolog integration adds "channel" attribute to every log record
3 participants