Skip to content

Add AttributeLimits, SpanLimits and dropped event/links counting#417

Merged
bobstrecansky merged 2 commits into
open-telemetry:mainfrom
lalex:span-limits
Sep 20, 2021
Merged

Add AttributeLimits, SpanLimits and dropped event/links counting#417
bobstrecansky merged 2 commits into
open-telemetry:mainfrom
lalex:span-limits

Conversation

@lalex

@lalex lalex commented Sep 19, 2021

Copy link
Copy Markdown
Contributor

This PR adds support for Span Limits and common Attribute Limits.

The Span class counts attributes, events and links dropped due to limits. These counters are exported via OTLP.

Fixed: Numeric attribute key is interpreted as an integer value which breaks string-key type checks on reading from Attributes.

@codecov

codecov Bot commented Sep 19, 2021

Copy link
Copy Markdown

Codecov Report

Merging #417 (8b5d31f) into main (b44df6d) will increase coverage by 0.23%.
The diff coverage is 94.48%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #417      +/-   ##
============================================
+ Coverage     94.09%   94.33%   +0.23%     
- Complexity      720      758      +38     
============================================
  Files            59       63       +4     
  Lines          1745     1854     +109     
============================================
+ Hits           1642     1749     +107     
- Misses          103      105       +2     
Impacted Files Coverage Δ
sdk/Trace/NoopSpan.php 82.05% <0.00%> (-4.44%) ⬇️
sdk/Internal/StringUtil.php 75.00% <75.00%> (ø)
sdk/Trace/Attributes.php 95.00% <96.00%> (ø)
contrib/OtlpGrpc/SpanConverter.php 93.80% <100.00%> (+0.28%) ⬆️
contrib/OtlpHttp/SpanConverter.php 93.80% <100.00%> (+0.28%) ⬆️
sdk/Trace/AttributeLimits.php 100.00% <100.00%> (ø)
sdk/Trace/Span.php 98.22% <100.00%> (+0.18%) ⬆️
sdk/Trace/SpanLimits.php 100.00% <100.00%> (ø)
sdk/Trace/SpanLimitsBuilder.php 100.00% <100.00%> (ø)
sdk/Trace/Tracer.php 96.42% <100.00%> (-0.05%) ⬇️
... and 6 more

Continue to review full report at Codecov.

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

@bobstrecansky bobstrecansky left a comment

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.

One question but it's definitely not a blocker. Going to merge this!

{
public static function substr(string $value, int $offset, int $length): string
{
if (function_exists('mb_substr')) {

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.

Can you think of a particular place where mb_substr and mb_strlen wouldn't exist? I can't, but I'm probably a bit jaded here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mbstring is a non-default extension (https://www.php.net/manual/en/mbstring.installation.php) while Docker image has it enabled by default.

This check in code could be replaced by the additional requirement in composer.json. But I'm not sure which is better. When the user doesn't have mbstring installed that means the user code doesn't care about Unicode at all. The library would not help.

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.

Thank you for the context. I think this is sufficient for now; we can most certainly include that in composer.json if we ever decided we wanted to. I like the direction you took.

@bobstrecansky
bobstrecansky merged commit 45362de into open-telemetry:main Sep 20, 2021
@Blacksmoke16 Blacksmoke16 mentioned this pull request Sep 21, 2021
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.

2 participants