aboutsummaryrefslogtreecommitdiffstats
path: root/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/dimensions/BlocklistDimensions.java
blob: c5f1d20b23a1993f893bf61041126a822a2425a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.metricsproxy.metric.dimensions;

import ai.vespa.metricsproxy.metric.model.DimensionId;

import java.util.EnumSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author olaa
 */
public enum BlocklistDimensions {

    /**
     * Deployment related metrics - most of which are redundant
     * E.g. app/applicationName/tenantName/instanceName is already included in applicationId
     */
    APP("app"),
    APPLICATION_NAME("applicationName"),
    CLUSTER_NAME("clustername"),
    CLUSTER_ID("clusterid"),
    CLUSTER_TYPE("clustertype"),
    DEPLOYMENT_CLUSTER("deploymentCluster"),
    GROUP_ID("groupId"),
    INSTANCE("instance"),
    INSTANCE_NAME("instanceName"),
    TENANT_NAME("tenantName"),

    /**
     * State related dimensions - will always be the same value for a given snapshot
     */
    METRIC_TYPE("metrictype"),
    ROLE("role"),
    STATE("state"),
    SYSTEM("system"),
    VESPA_VERSION("vespaVersion"),

    /**  Metric specific dimensions  **/
    ARCHITECTURE("arch"),
    AUTHZ_REQUIRED("authz-equired"),
    HOME("home"),
    PORT("port"),
    SCHEME("scheme"),
    DRYRUN("dryrun"),
    VERSION("version");

    private final DimensionId dimensionId;

    BlocklistDimensions(String dimensionId) {
        this.dimensionId = DimensionId.toDimensionId(dimensionId);
    }

    public DimensionId getDimensionId() {
        return dimensionId;
    }

    public static Set<DimensionId> getAll() {
        return EnumSet.allOf(BlocklistDimensions.class)
                .stream()
                .map(BlocklistDimensions::getDimensionId)
                .collect(Collectors.toSet());
    }

}