public class MetricsUtils extends Object
Constructor and Description |
---|
MetricsUtils() |
Modifier and Type | Method and Description |
---|---|
static Map<String,String> |
cleanLabelNames(Map<String,String> raw)
Converts the label keys to snake_case.
|
static String |
convertCase(String raw)
Converts a tag/name to match the telemetry naming conventions by converting snake_case.
|
static String |
fullMetricName(String domain,
String group,
String name)
Creates a metric name given the domain, group, and name.
|
static com.google.protobuf.Timestamp |
now() |
static com.google.protobuf.Timestamp |
now(Clock clock) |
static OffsetDateTime |
nowInUTC() |
static ZonedDateTime |
nowInUTC(Clock clock) |
static Instant |
toInstant(com.google.protobuf.Timestamp timestamp) |
static com.google.protobuf.Timestamp |
toTimestamp(Instant instant) |
public static com.google.protobuf.Timestamp now(Clock clock)
public static com.google.protobuf.Timestamp now()
public static com.google.protobuf.Timestamp toTimestamp(Instant instant)
public static Instant toInstant(com.google.protobuf.Timestamp timestamp)
public static ZonedDateTime nowInUTC(Clock clock)
public static OffsetDateTime nowInUTC()
public static String fullMetricName(String domain, String group, String name)
io.confluent.kafka.server
io.confluent.kafka.producer/request_metrics/produce_request_time_ms
public static String convertCase(String raw)
Kafka metrics have tags/name in lower case separated by hyphens. Eg: total-errors Yammer metrics have tags/name in upper camelcase. Eg: TotalErrors Some KSQL metrics have weird casing where the metric name is a mix of upper case words separated by underscore along with lower case words separated by hyphen. Eg: PENDING_SHUTDOWN-queries
raw
-