From 0a327b0450f6d4bcb27a2bd3992be463fcaaf762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pt=C3=A1=C4=8Dek?= Date: Sun, 4 Jun 2023 08:57:17 +0200 Subject: [PATCH] protobuf #2 --- client/Makefile | 12 ++++++++++++ .../android/exporter/proto/remote-write.proto | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 client/Makefile rename remote-write.proto => client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/proto/remote-write.proto (92%) diff --git a/client/Makefile b/client/Makefile new file mode 100644 index 0000000..a57b084 --- /dev/null +++ b/client/Makefile @@ -0,0 +1,12 @@ +# Makefile for protobuf generation for remote write prometheus protocol + +.PHONY: protobuf + +SRC_DIR_PROTO=app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/proto +DST_DIR_PROTO=../proto-gen/ + +protobuf: + mkdir -p $(DST_DIR_PROTO) + protoc -I=$(SRC_DIR_PROTO) --kotlin_out=$(DST_DIR_PROTO) $(SRC_DIR_PROTO)/remote-write.proto + +#TODO diff --git a/remote-write.proto b/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/proto/remote-write.proto similarity index 92% rename from remote-write.proto rename to client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/proto/remote-write.proto index a26bad3..76dbe09 100644 --- a/remote-write.proto +++ b/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/proto/remote-write.proto @@ -1,5 +1,7 @@ syntax = "proto3"; +package proto; + message WriteRequest { repeated TimeSeries timeseries = 1; // Cortex uses this field to determine the source of the write request. @@ -23,5 +25,5 @@ message Label { message Sample { double value = 1; - int64 timestamp = 2; + int64 timestamp = 2; // in ms }