Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Apr 20, 2022
1 parent 94cd558 commit c7d8abb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions docs/examples/metrics/example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Iterable

from opentelemetry._metrics import get_meter_provider, set_meter_provider
from opentelemetry._metrics.measurement import Measurement
from opentelemetry._metrics.observation import Observation
from opentelemetry.exporter.otlp.proto.grpc._metric_exporter import (
OTLPMetricExporter,
)
Expand All @@ -14,16 +14,16 @@
set_meter_provider(provider)


def observable_counter_func() -> Iterable[Measurement]:
yield Measurement(1, {})
def observable_counter_func() -> Iterable[Observation]:
yield Observation(1, {})


def observable_up_down_counter_func() -> Iterable[Measurement]:
yield Measurement(-10, {})
def observable_up_down_counter_func() -> Iterable[Observation]:
yield Observation(-10, {})


def observable_gauge_func() -> Iterable[Measurement]:
yield Measurement(9, {})
def observable_gauge_func() -> Iterable[Observation]:
yield Observation(9, {})


meter = get_meter_provider().get_meter("getting-started", "0.1.2")
Expand Down
14 changes: 7 additions & 7 deletions docs/getting_started/metrics_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from typing import Iterable

from opentelemetry._metrics import get_meter_provider, set_meter_provider
from opentelemetry._metrics.measurement import Measurement
from opentelemetry._metrics.observation import Observation
from opentelemetry.sdk._metrics import MeterProvider
from opentelemetry.sdk._metrics.export import (
ConsoleMetricExporter,
Expand All @@ -31,16 +31,16 @@
set_meter_provider(provider)


def observable_counter_func() -> Iterable[Measurement]:
yield Measurement(1, {})
def observable_counter_func() -> Iterable[Observation]:
yield Observation(1, {})


def observable_up_down_counter_func() -> Iterable[Measurement]:
yield Measurement(-10, {})
def observable_up_down_counter_func() -> Iterable[Observation]:
yield Observation(-10, {})


def observable_gauge_func() -> Iterable[Measurement]:
yield Measurement(9, {})
def observable_gauge_func() -> Iterable[Observation]:
yield Observation(9, {})


meter = get_meter_provider().get_meter("getting-started", "0.1.2")
Expand Down

0 comments on commit c7d8abb

Please sign in to comment.