|
5 | 5 |
|
6 | 6 | package io.opentelemetry.instrumentation.docs.internal; |
7 | 7 |
|
8 | | -import com.fasterxml.jackson.annotation.JsonCreator; |
9 | | -import com.fasterxml.jackson.annotation.JsonValue; |
10 | | - |
11 | 8 | /** |
12 | 9 | * Represents functionality of instrumentations. This class is internal and is hence not for public |
13 | 10 | * use. Its APIs are unstable and can change at any time. |
14 | 11 | */ |
15 | 12 | public enum InstrumentationFunction { |
16 | | - HTTP_ROUTE_ENRICHER("http-route-enricher"), |
17 | | - LIBRARY_DOMAIN_ENRICHER("library-domain-enricher"), |
18 | | - EXPERIMENTAL_ONLY("experimental-only"), |
19 | | - CONTEXT_PROPAGATOR("context-propagator"), |
20 | | - UPSTREAM_ADAPTER("upstream-adapter"), |
21 | | - CONFIGURATION("configuration"), |
22 | | - CONTROLLER_SPANS("controller-spans"), |
23 | | - VIEW_SPANS("view-spans"), |
24 | | - SYSTEM_METRICS("system-metrics"); |
25 | | - |
26 | | - private final String name; |
27 | | - |
28 | | - InstrumentationFunction(String name) { |
29 | | - this.name = name; |
30 | | - } |
31 | | - |
32 | | - @JsonValue |
33 | | - public String getName() { |
34 | | - return name; |
35 | | - } |
36 | | - |
37 | | - @JsonCreator |
38 | | - public static InstrumentationFunction fromYamlName(String yamlName) { |
39 | | - for (InstrumentationFunction function : values()) { |
40 | | - if (function.name.equals(yamlName)) { |
41 | | - return function; |
42 | | - } |
43 | | - } |
44 | | - throw new IllegalArgumentException("Unknown instrumentation function: " + yamlName); |
45 | | - } |
| 13 | + HTTP_ROUTE_ENRICHER, |
| 14 | + LIBRARY_DOMAIN_ENRICHER, |
| 15 | + EXPERIMENTAL_ONLY, |
| 16 | + CONTEXT_PROPAGATION, |
| 17 | + UPSTREAM_ADAPTER, |
| 18 | + CONFIGURATION, |
| 19 | + CONTROLLER_SPANS, |
| 20 | + VIEW_SPANS, |
| 21 | + SYSTEM_METRICS |
46 | 22 | } |
0 commit comments