Skip to content

Commit cd6af63

Browse files
[Profiling] Annotate TODOs for 9.0.0 upgrade (#107150)
As suggested by David in #106592, we're adding the annotation `@UpdateForV9` to all places in the Universal Profiling plugin that can be removed once we move to 9.0.0. Closes #106592 Closes #106593 Closes #106596 Closes #106597 Closes #106681
1 parent 2cfcefb commit cd6af63

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/CO2Calculator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
package org.elasticsearch.xpack.profiling;
99

10+
import org.elasticsearch.core.UpdateForV9;
11+
1012
import java.util.Map;
1113

1214
final class CO2Calculator {
@@ -52,6 +54,7 @@ public double getAnnualCO2Tons(String hostID, long samples) {
5254
return getKiloWattsPerCore(host) * getCO2TonsPerKWH(host) * annualCoreHours * getDatacenterPUE(host);
5355
}
5456

57+
@UpdateForV9 // only allow OTEL semantic conventions
5558
private double getKiloWattsPerCore(HostMetadata host) {
5659
return switch (host.hostArchitecture) {
5760
// For the OTEL donation of the profiling agent, we switch to OTEL semantic conventions,

x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/GetFlamegraphResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.elasticsearch.common.io.stream.StreamOutput;
1414
import org.elasticsearch.common.xcontent.ChunkedToXContentHelper;
1515
import org.elasticsearch.common.xcontent.ChunkedToXContentObject;
16+
import org.elasticsearch.core.UpdateForV9;
1617
import org.elasticsearch.xcontent.ToXContent;
1718

1819
import java.io.IOException;
@@ -24,7 +25,9 @@ public class GetFlamegraphResponse extends ActionResponse implements ChunkedToXC
2425
private final int size;
2526
private final double samplingRate;
2627
private final long selfCPU;
28+
@UpdateForV9 // remove this field - it is unused in Kibana
2729
private final long totalCPU;
30+
@UpdateForV9 // remove this field - it is unused in Kibana
2831
private final long totalSamples;
2932
private final List<Map<String, Integer>> edges;
3033
private final List<String> fileIds;

x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/GetStackTracesResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.elasticsearch.common.xcontent.ChunkedToXContentHelper;
1515
import org.elasticsearch.common.xcontent.ChunkedToXContentObject;
1616
import org.elasticsearch.core.Nullable;
17+
import org.elasticsearch.core.UpdateForV9;
1718
import org.elasticsearch.xcontent.ToXContent;
1819

1920
import java.util.Collections;
@@ -29,8 +30,10 @@ public class GetStackTracesResponse extends ActionResponse implements ChunkedToX
2930
private final Map<String, StackFrame> stackFrames;
3031
@Nullable
3132
private final Map<String, String> executables;
33+
@UpdateForV9 // remove this field - it is unused in Kibana
3234
@Nullable
3335
private final Map<String, TraceEvent> stackTraceEvents;
36+
@UpdateForV9 // remove this field - it is unused in Kibana
3437
private final int totalFrames;
3538
private final double samplingRate;
3639
private final long totalSamples;

x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/HostMetadata.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
package org.elasticsearch.xpack.profiling;
99

10+
import org.elasticsearch.core.UpdateForV9;
1011
import org.elasticsearch.xcontent.ToXContentObject;
1112
import org.elasticsearch.xcontent.XContentBuilder;
1213

@@ -30,6 +31,7 @@ final class HostMetadata implements ToXContentObject {
3031
this.profilingNumCores = profilingNumCores != null ? profilingNumCores : DEFAULT_PROFILING_NUM_CORES;
3132
}
3233

34+
@UpdateForV9 // remove fallback to the "profiling.host.machine" field and remove it from the component template "profiling-hosts".
3335
public static HostMetadata fromSource(Map<String, Object> source) {
3436
if (source != null) {
3537
String hostID = (String) source.get("host.id");

x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/InstanceType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
package org.elasticsearch.xpack.profiling;
99

10+
import org.elasticsearch.core.UpdateForV9;
1011
import org.elasticsearch.xcontent.ToXContentObject;
1112
import org.elasticsearch.xcontent.XContentBuilder;
1213

@@ -73,6 +74,7 @@ public static InstanceType fromHostSource(Map<String, Object> source) {
7374
return new InstanceType(provider, region, null);
7475
}
7576

77+
@UpdateForV9 // remove this method
7678
private static InstanceType fromObsoleteHostSource(Map<String, Object> source) {
7779
// Check and handle AWS.
7880
String region = (String) source.get("ec2.placement.region");

0 commit comments

Comments
 (0)