Skip to content

Commit

Permalink
Fix counter variable name
Browse files Browse the repository at this point in the history
The counter is referenced in the next section with a different name.
  • Loading branch information
driv authored Sep 11, 2023
1 parent 746a28f commit 2b40f51
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -633,15 +633,15 @@ Complete the following to add a custom counter:
private static final AttributeKey<Boolean> ATTR_VALID_N = AttributeKey.booleanKey("fibonacci.valid.n");
private final Tracer tracer;
private final LongCounter myCounter;
private final LongCounter fibonacciInvocations;
@Autowired
Controller(OpenTelemetry openTelemetry) {
// Initialize tracer
tracer = openTelemetry.getTracer(Controller.class.getName());
// Initialize instrument
Meter meter = openTelemetry.getMeter(Controller.class.getName());
myCounter = meter
fibonacciInvocations = meter
.counterBuilder("fibonacci.invocations")
.setDescription("Measures the number of times the fibonacci method is invoked.")
.build();
Expand Down

0 comments on commit 2b40f51

Please sign in to comment.