Skip to content

Fix API usage typos #502

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

Merged
merged 1 commit into from
Oct 8, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ public static void asyncCounterUsage(Meter meter) {
// Uncomment to optionally change the type to double
// .ofDoubles()
.buildWithCallback(
// the callback is invoked a MetricReader reads metrics
// the callback is invoked when a MetricReader reads metrics
observableMeasurement -> {
long currentWidgetCount = widgetCount.get();

2 changes: 1 addition & 1 deletion doc-snippets/api/src/main/java/otel/AsyncGaugeUsage.java
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public static void asyncGaugeUsage(Meter meter) {
// Uncomment to optionally change the type to long
// .ofLongs()
.buildWithCallback(
// the callback is invoked a MetricReader reads metrics
// the callback is invoked when a MetricReader reads metrics
observableMeasurement -> {
double currentWidgetCount = processingLineTemp.get();

Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public static void asyncUpDownCounterUsage(Meter meter) {
// Uncomment to optionally change the type to double
// .ofDoubles()
.buildWithCallback(
// the callback is invoked a MetricReader reads metrics
// the callback is invoked when a MetricReader reads metrics
observableMeasurement -> {
long currentWidgetCount = queueLength.get();

4 changes: 2 additions & 2 deletions doc-snippets/api/src/main/java/otel/ContextUsage.java
Original file line number Diff line number Diff line change
@@ -49,10 +49,10 @@ public static void contextUsage() throws Exception {
ExecutorService executorService = Executors.newSingleThreadExecutor();
ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);

// Context instances can be explicitly passed around application code, but its more convenient
// Context instances can be explicitly passed around application code, but it's more convenient
// to use implicit context, calling Context.makeCurrent() and accessing via Context.current().
// Context provides a number of utilities for implicit context propagation. These utilities wrap
// utility classes like Scheduler, and ExecutorService, ScheduledExecutorService, Runnable,
// utility classes like Scheduler, ExecutorService, ScheduledExecutorService, Runnable,
// Callable, Consumer, Supplier, Function, etc and modify their behavior to call
// Context.makeCurrent() before running.
context.wrap(ContextUsage::callable).call();
2 changes: 1 addition & 1 deletion doc-snippets/api/src/main/java/otel/GaugeUsage.java
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ public class GaugeUsage {
private static final Attributes WIDGET_RED_CIRCLE = Util.WIDGET_RED_CIRCLE;

public static void gaugeUsage(Meter meter) {
// Construct a gauge to record measurements as they occur when cannot be spatially
// Construct a gauge to record measurements as they occur, which cannot be spatially
// re-aggregated.
DoubleGauge gauge =
meter