Skip to content

Commit

Permalink
First attempt at deprecating methods
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbley committed Jun 10, 2024
1 parent f3523c7 commit bc06150
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion splunk_otel/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import logging
import warnings

from opentelemetry.metrics import get_meter_provider
from opentelemetry.sdk.metrics import MeterProvider
Expand All @@ -21,5 +22,6 @@


def start_metrics() -> MeterProvider:
# FIXME mark deprecated and/or log warning
# FIXME better message
warnings.warn("splunk_otel.start_metrics has been deprecated")
return get_meter_provider()
5 changes: 3 additions & 2 deletions splunk_otel/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import logging
import warnings
from typing import Collection, Dict, Optional, Union

from opentelemetry import trace
Expand All @@ -31,10 +32,10 @@ def start_tracing(
resource_attributes: Optional[Dict[str, Union[str, bool, int, float]]] = None,
trace_response_header_enabled: Optional[bool] = None,
) -> trace.TracerProvider:
# FIXME mark as deprecated or document the change or something
# FIXME document the change, better message
# document new ways to either use otel apis or ours to do same config work
# (x 5 fields)
# also posibly log

# FIXME set_global_response_propagator needs to be called somewhere
warnings.warn("splunk_otel.start_tracing has been deprecated")
return trace.get_tracer_provider()

0 comments on commit bc06150

Please sign in to comment.