com.mysql.cj.telemetry

## Class NoopTelemetryHandler

- java.lang.Object
- - com.mysql.cj.telemetry.NoopTelemetryHandler

All Implemented Interfaces:
  TelemetryHandler

    public class NoopTelemetryHandler
    extends Object
    implements TelemetryHandler

No-op implementation of `TelemetryHandler`.

### Field Summary

Fields
`private static NoopTelemetryHandler` `INSTANCE`

### Constructor Summary

Constructors
`private` `NoopTelemetryHandler()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static NoopTelemetryHandler` `getInstance()`
`TelemetrySpan` `startSpan(TelemetrySpanName spanName, Object... args)` Start a telemetry span.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface com.mysql.cj.telemetry.TelemetryHandler

`addLinkTarget, getContextPropagationKey, propagateContext, removeLinkTarget`

### Field Detail

#### INSTANCE

    private static NoopTelemetryHandler INSTANCE

### Constructor Detail

#### NoopTelemetryHandler

    private NoopTelemetryHandler()

### Method Detail

#### getInstance

    public static NoopTelemetryHandler getInstance()

#### startSpan

    public TelemetrySpan startSpan(TelemetrySpanName spanName,
                                   Object... args)

Description copied from interface: `TelemetryHandler`
Start a telemetry span. Additionally, the returned `TelemetrySpan` object must be made current so that it gets recorded by the telemetry tracer. A `TelemetrySpan` object must be closed in a finally block after being made current, e.g.:

     TelemetrySpan span = telemetryHandler.startSpan(TelemetrySpanName.PING);
     try (TelemetryScope scope = span.makeCurrent()) {
         // your code goes here
     } finally {
         span.end();
     }

Specified by:
  `startSpan` in interface `TelemetryHandler`
Parameters:
  `spanName` - the span name that identifies this telemetry span
  `args` - arguments used for interpolating the specified span name via `String.format(String, Object...)`
Returns:
  the newly-created span object

Copyright © 2016, 2024, Oracle and/or its affiliates.