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

drop string options for Temporality, InstrumentType #1493

Open
wants to merge 4 commits into
base: 2.x
Choose a base branch
from

Conversation

brettmc
Copy link
Collaborator

@brettmc brettmc commented Jan 29, 2025

Remove forwards-compatible Metrics features for 2.x:

  • No longer accept strings for Temporality and InstrumentType
  • $advisory added to DefaultAggregationProviderInterface

Temporality|string|null was allowed for temporality to avoid BC in 1.x
convert Temporality to an enum
- drop string|InstrumentType, which exists in 1.x for forward-compatibility
@brettmc brettmc requested a review from a team as a code owner January 29, 2025 04:25
*/
public function temporality();
public function temporality(): ?Temporality;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wasn't sure about this, however there is a lowmemory test that fails if null is not allowed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Non-nullable is correct here - test should be fixed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated the offending test. lowmemory = "it depends on the instrument", per spec so I set a default and confirm that's used.

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 70.52%. Comparing base (a537dbf) to head (178b31a).

Files with missing lines Patch % Lines
...K/Metrics/MetricExporter/ConsoleMetricExporter.php 0.00% 2 Missing ⚠️
src/Contrib/Otlp/MetricExporter.php 0.00% 1 Missing ⚠️
...rc/SDK/Metrics/MetricExporter/InMemoryExporter.php 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #1493      +/-   ##
============================================
+ Coverage     70.49%   70.52%   +0.02%     
+ Complexity     2792     2790       -2     
============================================
  Files           413      411       -2     
  Lines          8416     8407       -9     
============================================
- Hits           5933     5929       -4     
+ Misses         2483     2478       -5     
Flag Coverage Δ
8.2 70.40% <75.00%> (+0.08%) ⬆️
8.3 70.34% <75.00%> (-0.02%) ⬇️
8.4 70.41% <75.00%> (-0.01%) ⬇️
8.5 70.35% <75.00%> (+0.03%) ⬆️

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

Files with missing lines Coverage Δ
src/Contrib/Otlp/MetricExporterFactory.php 98.03% <100.00%> (ø)
src/SDK/Metrics/Data/Histogram.php 0.00% <ø> (ø)
src/SDK/Metrics/Data/Sum.php 0.00% <ø> (ø)
...rc/SDK/Metrics/DefaultAggregationProviderTrait.php 100.00% <100.00%> (ø)
src/SDK/Metrics/Instrument.php 0.00% <ø> (ø)
src/SDK/Metrics/Meter.php 66.80% <100.00%> (ø)
...trics/MetricFactory/StreamMetricSourceProvider.php 100.00% <100.00%> (ø)
src/SDK/Metrics/MetricReader/ExportingReader.php 72.72% <100.00%> (ø)
...rc/SDK/Metrics/Stream/AsynchronousMetricStream.php 100.00% <100.00%> (ø)
src/SDK/Metrics/Stream/SynchronousMetricStream.php 95.65% <100.00%> (ø)
... and 4 more

... and 13 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 a537dbf...178b31a. Read the comment docs.

@brettmc brettmc added the breaking A breaking change label Jan 29, 2025
@brettmc
Copy link
Collaborator Author

brettmc commented Feb 6, 2025

@open-telemetry/php-approvers I think this is ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants