Skip to content

Commit

Permalink
docs/getting_started/metrics_example.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sarafonseca-123 authored and ocelotl committed Feb 5, 2024
1 parent c371543 commit 2ac9b9e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
6 changes: 5 additions & 1 deletion docs/getting_started/metrics_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@ def observable_gauge_func(options: CallbackOptions) -> Iterable[Observation]:
histogram.record(99.9)

# Async Gauge
gauge = meter.create_observable_gauge("gauge", [observable_gauge_func])
observable_gauge = meter.create_observable_gauge("gauge", [observable_gauge_func])

# Sync Gauge
gauge = meter.create_gauge("gauge")
gauge.set(1)
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,10 @@
OTEL_EXPORTER_OTLP_METRICS_HEADERS,
OTEL_EXPORTER_OTLP_METRICS_INSECURE,
OTEL_EXPORTER_OTLP_METRICS_TIMEOUT,
<<<<<<< HEAD
=======
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE,
)
from opentelemetry.sdk.metrics import (
Counter,
Histogram,
Gauge,
ObservableCounter,
ObservableGauge,
ObservableUpDownCounter,
UpDownCounter,
>>>>>>> ad714a7ab (Add synchronous gauge)
)
from opentelemetry.sdk.metrics.export import (
AggregationTemporality,
DataPointT,
<<<<<<< HEAD
=======
Gauge as GaugeType,
Histogram as HistogramType,
>>>>>>> ad714a7ab (Add synchronous gauge)
Metric,
MetricExporter,
MetricExportResult,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,11 @@
LogarithmMapping,
)
from opentelemetry.sdk.metrics._internal.measurement import Measurement
<<<<<<< HEAD
from opentelemetry.sdk.metrics._internal.point import Buckets as BucketsPoint
from opentelemetry.sdk.metrics._internal.point import (
ExponentialHistogramDataPoint,
Gauge,
Gauge as GaugePoint,
)
=======
from opentelemetry.sdk.metrics._internal.point import Gauge as GaugePoint
>>>>>>> ad714a7ab (Add synchronous gauge)
from opentelemetry.sdk.metrics._internal.point import (
Histogram as HistogramPoint,
)
Expand Down

0 comments on commit 2ac9b9e

Please sign in to comment.