Skip to content

Commit

Permalink
refactor(OpenTelemetry): remove SDK version from meter name
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Sep 23, 2024
1 parent a00f039 commit 2e2be25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions openfga_sdk/telemetry/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from opentelemetry.metrics import Counter, Histogram, Meter, get_meter

from openfga_sdk import __version__
from openfga_sdk.telemetry.attributes import (
TelemetryAttribute,
TelemetryAttributes,
Expand Down Expand Up @@ -32,7 +31,7 @@ def __init__(

def meter(self) -> Meter:
if self._meter is None:
self._meter = get_meter("openfga-sdk", __version__)
self._meter = get_meter("openfga-sdk")

return self._meter

Expand Down
3 changes: 1 addition & 2 deletions test/telemetry/metrics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest
from opentelemetry.metrics import Counter, Histogram, Meter

from openfga_sdk import __version__
from openfga_sdk.telemetry.attributes import TelemetryAttributes
from openfga_sdk.telemetry.counters import TelemetryCounters
from openfga_sdk.telemetry.histograms import TelemetryHistograms
Expand All @@ -23,7 +22,7 @@ def test_meter_lazy_initialization(mock_get_meter):
# Access the meter property, which should trigger lazy initialization
meter = telemetry.meter()
assert meter == mock_meter
mock_get_meter.assert_called_once_with("openfga-sdk", __version__)
mock_get_meter.assert_called_once_with("openfga-sdk")

# Access the meter property again, no new instance should be created
meter_again = telemetry.meter()
Expand Down

0 comments on commit 2e2be25

Please sign in to comment.