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

refactor(OpenTelemetry): remove SDK version from meter name #134

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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