Skip to content

Commit 1b2b7b3

Browse files
committed
Remove protobuf for now
Protobuf will be added in a separate PR to keep the scope more contained
1 parent 952608d commit 1b2b7b3

File tree

7 files changed

+4
-403
lines changed

7 files changed

+4
-403
lines changed

x-pack/plugin/otel-data/build.gradle

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ plugins {
88
id 'elasticsearch.internal-es-plugin'
99
id 'elasticsearch.internal-yaml-rest-test'
1010
id 'elasticsearch.internal-cluster-test'
11-
id('com.google.protobuf') version '0.9.5'
1211
}
1312

1413
esplugin {
@@ -18,8 +17,6 @@ esplugin {
1817
extendedPlugins = ['x-pack-core']
1918
}
2019

21-
// manually update verification-metadata.xml via dev-tools/protoc_exe_sha256.sh when updating the protobuf version
22-
def protobufVersion = "4.32.0"
2320
dependencies {
2421
api project(":libs:exponential-histogram")
2522
compileOnly project(path: xpackModule('core'))
@@ -58,88 +55,4 @@ dependencies {
5855
testImplementation "io.opentelemetry:opentelemetry-exporter-sender-jdk:$otelVersion"
5956
testImplementation "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:$otelVersion"
6057
testImplementation "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:$otelVersion"
61-
62-
implementation "com.google.protobuf:protobuf-java:${protobufVersion}"
63-
}
64-
65-
protobuf {
66-
protoc {
67-
// The artifact spec for the Protobuf Compiler
68-
artifact = "com.google.protobuf:protoc:${protobufVersion}"
69-
}
70-
}
71-
72-
def otlpProtoVersion = "1.7.0" // Version of the OpenTelemetry proto files to use
73-
74-
// To generate the checksum, download the file and run "shasum -a 256 ~/path/to/vfoo.zip"
75-
def protoChecksum = "ddb80357ff146f5e3bda584907185b1f635412a4b31edf6f96b102a18b8e05dc"
76-
def protoArchivePath = layout.buildDirectory.file("archives/opentelemetry-proto-${otlpProtoVersion}.zip")
77-
78-
def downloadProtoArchive = tasks.register("downloadProtoArchive") {
79-
outputs.file(protoArchivePath)
80-
onlyIf { !protoArchivePath.get().asFile.exists() }
81-
doLast {
82-
protoArchivePath.get().asFile.parentFile.mkdirs()
83-
"https://github.com/open-telemetry/opentelemetry-proto/archive/v${otlpProtoVersion}.zip".toURL()
84-
.withInputStream { is ->
85-
protoArchivePath.get().asFile.withOutputStream {os -> os << is }
86-
}
87-
}
88-
}
89-
90-
def verifyProtoArchive = tasks.register("verifyProtoArchive") {
91-
dependsOn(downloadProtoArchive)
92-
doLast {
93-
protoArchivePath.get().asFile.withInputStream { inputStream ->
94-
def sha256 = inputStream.readAllBytes().digest("SHA-256")
95-
if (sha256 != protoChecksum) {
96-
throw new GradleException("Checksum verification failed for $protoArchivePath: expected $protoChecksum, got $sha256")
97-
}
98-
}
99-
}
100-
}
101-
102-
def unzipProtoArchive = tasks.register("unzipProtoArchive", Copy) {
103-
dependsOn(verifyProtoArchive)
104-
from zipTree(protoArchivePath)
105-
into layout.buildDirectory.dir("protos")
106-
}
107-
108-
// Avoid unnecessary String allocations in the generated AnyValue class
109-
// We always need the ByteString (UTF-8) representation of string attributes
110-
def adjustAnyValueBuilder = tasks.register("adjustAnyValueBuilder") {
111-
doLast {
112-
ant.replace(
113-
file: 'build/generated/sources/proto/main/java/io/opentelemetry/proto/common/v1/AnyValue.java',
114-
token: 'java.lang.String s = input.readStringRequireUtf8();',
115-
value: 'com.google.protobuf.ByteString s = input.readBytes();',
116-
encoding: 'UTF-8'
117-
)
118-
}
119-
}
120-
121-
sourceSets {
122-
main {
123-
proto {
124-
srcDir layout.buildDirectory.dir("protos/opentelemetry-proto-${otlpProtoVersion}")
125-
}
126-
}
127-
}
128-
129-
afterEvaluate {
130-
tasks.named("generateProto") {
131-
dependsOn(unzipProtoArchive)
132-
finalizedBy(adjustAnyValueBuilder)
133-
}
134-
}
135-
136-
idea {
137-
module {
138-
sourceDirs += layout.buildDirectory.dir("generated/sources/proto/main/java").get().asFile
139-
}
140-
}
141-
142-
tasks.named("dependencyLicenses").configure {
143-
mapping from: /opentelemetry-.*/, to: 'opentelemetry'
144-
mapping from: /protobuf.*/, to: 'protobuf'
14558
}

x-pack/plugin/otel-data/licenses/opentelemetry-LICENSE.txt

Lines changed: 0 additions & 201 deletions
This file was deleted.

x-pack/plugin/otel-data/licenses/opentelemetry-NOTICE.txt

Whitespace-only changes.

x-pack/plugin/otel-data/licenses/protobuf-LICENSE.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.

x-pack/plugin/otel-data/licenses/protobuf-NOTICE.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.

x-pack/plugin/otel-data/src/main/java/org/elasticsearch/xpack/oteldata/otlp/OTLPMetricsRestAction.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
package org.elasticsearch.xpack.oteldata.otlp;
99

10-
import io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;
11-
1210
import org.elasticsearch.action.ActionListener;
1311
import org.elasticsearch.client.internal.node.NodeClient;
1412
import org.elasticsearch.common.bytes.BytesArray;
@@ -61,13 +59,7 @@ public RestResponse buildResponse(OTLPMetricsTransportAction.MetricsResponse r)
6159
// (a request that does not carry any telemetry data)
6260
// the server SHOULD respond with success.
6361
// https://opentelemetry.io/docs/specs/otlp/#full-success-1
64-
return channel -> channel.sendResponse(
65-
new RestResponse(
66-
RestStatus.OK,
67-
"application/x-protobuf",
68-
new BytesArray(ExportMetricsServiceResponse.newBuilder().build().toByteArray())
69-
)
70-
);
62+
return channel -> channel.sendResponse(new RestResponse(RestStatus.OK, "application/x-protobuf", new BytesArray(new byte[0])));
7163
}
7264

7365
}

0 commit comments

Comments
 (0)