mirror of
https://github.com/google/nomulus.git
synced 2025-05-30 01:10:14 +02:00
Cardinality of this metric: clientId: there are currently 650 (on sandbox, because of OTE), and 200 on production. explicitClientId: 2 roles: 2 now, might be 3 soon if we add vendors status: 2 So we're talking about a cardinality of 2,000-8,000. Less when you consider that registrars only seldom actually need to access the console (certainly not daily or even weekly). Compare with, e.g., the /epp/processing_time from the above EppMetrics.java which has: Epp commands: 26 (manual counting) client IDs: 200 on prod status: the actual status CODE of the command. Can have many values, but looking at the past few weeks' metrics I counted 20 Note that not every command results in every status. Looking a few weeks back we can see around 80-100 (commands+status) combination. buckets: 16 so that's over 250,000-1,000,000 cardinality, on a very high-volume metric. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=218699280
69 lines
2.9 KiB
Java
69 lines
2.9 KiB
Java
// Copyright 2018 The Nomulus Authors. All Rights Reserved.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package google.registry.ui.server.registrar;
|
|
|
|
import com.google.common.collect.ImmutableSet;
|
|
import com.google.monitoring.metrics.IncrementableMetric;
|
|
import com.google.monitoring.metrics.LabelDescriptor;
|
|
import com.google.monitoring.metrics.MetricRegistryImpl;
|
|
import google.registry.ui.server.registrar.AuthenticatedRegistrarAccessor.Role;
|
|
import javax.inject.Inject;
|
|
|
|
final class RegistrarConsoleMetrics {
|
|
|
|
private static final ImmutableSet<LabelDescriptor> CONSOLE_LABEL_DESCRIPTORS =
|
|
ImmutableSet.of(
|
|
LabelDescriptor.create("clientId", "target registrar client ID"),
|
|
LabelDescriptor.create("explicitClientId", "whether the client ID is set explicitly"),
|
|
LabelDescriptor.create("role", "Role[s] of the user making the request"),
|
|
LabelDescriptor.create("status", "whether the request is successful"));
|
|
|
|
static final IncrementableMetric consoleRequestMetric =
|
|
MetricRegistryImpl.getDefault()
|
|
.newIncrementableMetric(
|
|
"/console/registrar/console_requests",
|
|
"Count of /registrar requests",
|
|
"count",
|
|
CONSOLE_LABEL_DESCRIPTORS);
|
|
|
|
private static final ImmutableSet<LabelDescriptor> SETTINGS_LABEL_DESCRIPTORS =
|
|
ImmutableSet.of(
|
|
LabelDescriptor.create("clientId", "target registrar client ID"),
|
|
LabelDescriptor.create("action", "action performed"),
|
|
LabelDescriptor.create("role", "Role[s] of the user making the request"),
|
|
LabelDescriptor.create("status", "whether the request is successful"));
|
|
|
|
static final IncrementableMetric settingsRequestMetric =
|
|
MetricRegistryImpl.getDefault()
|
|
.newIncrementableMetric(
|
|
"/console/registrar/setting_requests",
|
|
"Count of /registrar-settings requests",
|
|
"count",
|
|
SETTINGS_LABEL_DESCRIPTORS);
|
|
|
|
@Inject
|
|
public RegistrarConsoleMetrics() {}
|
|
|
|
void registerConsoleRequest(
|
|
String clientId, boolean explicitClientId, ImmutableSet<Role> roles, String status) {
|
|
consoleRequestMetric.increment(
|
|
clientId, String.valueOf(explicitClientId), String.valueOf(roles), status);
|
|
}
|
|
|
|
void registerSettingsRequest(
|
|
String clientId, String action, ImmutableSet<Role> roles, String status) {
|
|
settingsRequestMetric.increment(clientId, action, String.valueOf(roles), status);
|
|
}
|
|
}
|