Skip to content

Commit

Permalink
non-nullable temporality
Browse files Browse the repository at this point in the history
  • Loading branch information
brettmc committed Jan 29, 2025
1 parent 6ae0ffb commit 178b31a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/SDK/Metrics/MetricMetadataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function description(): ?string;
/**
* Returns the underlying temporality of this metric.
*
* @return ?Temporality internal temporality
* @return Temporality internal temporality
*/
public function temporality(): ?Temporality;
public function temporality(): Temporality;
}
6 changes: 3 additions & 3 deletions tests/Unit/Contrib/Otlp/MetricExporterFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function test_create_with_temporality(array $env, ?Temporality $expected)

$this->assertInstanceOf(AggregationTemporalitySelectorInterface::class, $exporter);
$metric = $this->createMock(MetricMetadataInterface::class);
$metric->method('temporality')->willReturn(null);
$metric->method('temporality')->willReturn(Temporality::DELTA);
$this->assertSame($expected, $exporter->temporality($metric));
}

Expand All @@ -85,11 +85,11 @@ public static function temporalityProvider(): array
[
'OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE' => 'lowmemory',
],
null,
Temporality::DELTA,
],
'CuMuLaTiVe (mixed case)' => [
[
'OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE' => 'cumulative',
'OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE' => 'CuMuLaTiVe',
],
Temporality::CUMULATIVE,
],
Expand Down

0 comments on commit 178b31a

Please sign in to comment.