diff --git a/client/Makefile b/client/Makefile
index ebc15ac..d7ba652 100644
--- a/client/Makefile
+++ b/client/Makefile
@@ -6,9 +6,9 @@
.PHONY: protobuf
SRC_DIR_PROTO=app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/proto
-DST_DIR_PROTO=app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter
+DST_DIR_PROTO=app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/
protobuf:
mkdir -p $(DST_DIR_PROTO)
- protoc -I=$(SRC_DIR_PROTO) --kotlin_out=$(DST_DIR_PROTO) $(SRC_DIR_PROTO)/remote-write.proto
+ protoc -I=$(SRC_DIR_PROTO) --kotlin_out=$(DST_DIR_PROTO) $(SRC_DIR_PROTO)/remote_write.proto
diff --git a/client/app/build.gradle b/client/app/build.gradle
index 1b2b310..d72213d 100644
--- a/client/app/build.gradle
+++ b/client/app/build.gradle
@@ -4,6 +4,8 @@ plugins {
id 'kotlinx-serialization'
}
+apply plugin: 'com.google.protobuf'
+
android {
namespace 'com.birdthedeveloper.prometheus.android.prometheus.android.exporter'
compileSdk 33
@@ -47,6 +49,17 @@ android {
}
}
+protobuf {
+ protoc { artifact = 'com.google.protobuf:protoc:3.11.0' }
+ generateProtoTasks {
+ all().each { task ->
+ task.builtins {
+ java { option 'lite' }
+ }
+ }
+ }
+}
+
dependencies {
implementation 'androidx.work:work-multiprocess:2.8.1'
def core_version = "1.10.1"
@@ -84,6 +97,10 @@ dependencies {
implementation("com.charleskorn.kaml:kaml:0.54.0")
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1'
+ // custom - protocol buffers
+ implementation 'com.google.protobuf:protobuf-javalite:3.20.1'
+ implementation 'com.google.protobuf:protobuf-kotlin-lite:3.20.1'
+
diff --git a/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/LabelKt.kt b/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/LabelKt.kt
deleted file mode 100644
index 52cece6..0000000
--- a/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/LabelKt.kt
+++ /dev/null
@@ -1,62 +0,0 @@
-//Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: remote-write.proto
-
-package protogen;
-
-@kotlin.jvm.JvmSynthetic
-public inline fun label(block: protogen.LabelKt.Dsl.() -> kotlin.Unit): protogen.RemoteWrite.Label =
- protogen.LabelKt.Dsl._create(protogen.RemoteWrite.Label.newBuilder()).apply { block() }._build()
-public object LabelKt {
- @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
- @com.google.protobuf.kotlin.ProtoDslMarker
- public class Dsl private constructor(
- private val _builder: protogen.RemoteWrite.Label.Builder
- ) {
- public companion object {
- @kotlin.jvm.JvmSynthetic
- @kotlin.PublishedApi
- internal fun _create(builder: protogen.RemoteWrite.Label.Builder): Dsl = Dsl(builder)
- }
-
- @kotlin.jvm.JvmSynthetic
- @kotlin.PublishedApi
- internal fun _build(): protogen.RemoteWrite.Label = _builder.build()
-
- /**
- * string name = 1;
- */
- public var name: kotlin.String
- @JvmName("getName")
- get() = _builder.getName()
- @JvmName("setName")
- set(value) {
- _builder.setName(value)
- }
- /**
- * string name = 1;
- */
- public fun clearName() {
- _builder.clearName()
- }
-
- /**
- * string value = 2;
- */
- public var value: kotlin.String
- @JvmName("getValue")
- get() = _builder.getValue()
- @JvmName("setValue")
- set(value) {
- _builder.setValue(value)
- }
- /**
- * string value = 2;
- */
- public fun clearValue() {
- _builder.clearValue()
- }
- }
-}
-@kotlin.jvm.JvmSynthetic
-public inline fun protogen.RemoteWrite.Label.copy(block: protogen.LabelKt.Dsl.() -> kotlin.Unit): protogen.RemoteWrite.Label =
- protogen.LabelKt.Dsl._create(this.toBuilder()).apply { block() }._build()
diff --git a/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/RemoteWriteKt.kt b/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/RemoteWriteKt.kt
deleted file mode 100644
index e69de29..0000000
diff --git a/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/SampleKt.kt b/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/SampleKt.kt
deleted file mode 100644
index 850059d..0000000
--- a/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/SampleKt.kt
+++ /dev/null
@@ -1,70 +0,0 @@
-//Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: remote-write.proto
-
-package protogen;
-
-@kotlin.jvm.JvmSynthetic
-public inline fun sample(block: protogen.SampleKt.Dsl.() -> kotlin.Unit): protogen.RemoteWrite.Sample =
- protogen.SampleKt.Dsl._create(protogen.RemoteWrite.Sample.newBuilder()).apply { block() }._build()
-public object SampleKt {
- @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
- @com.google.protobuf.kotlin.ProtoDslMarker
- public class Dsl private constructor(
- private val _builder: protogen.RemoteWrite.Sample.Builder
- ) {
- public companion object {
- @kotlin.jvm.JvmSynthetic
- @kotlin.PublishedApi
- internal fun _create(builder: protogen.RemoteWrite.Sample.Builder): Dsl = Dsl(builder)
- }
-
- @kotlin.jvm.JvmSynthetic
- @kotlin.PublishedApi
- internal fun _build(): protogen.RemoteWrite.Sample = _builder.build()
-
- /**
- * double value = 1;
- */
- public var value: kotlin.Double
- @JvmName("getValue")
- get() = _builder.getValue()
- @JvmName("setValue")
- set(value) {
- _builder.setValue(value)
- }
- /**
- * double value = 1;
- */
- public fun clearValue() {
- _builder.clearValue()
- }
-
- /**
- *
- * in ms - *- * - *
int64 timestamp = 2;
- */
- public var timestamp: kotlin.Long
- @JvmName("getTimestamp")
- get() = _builder.getTimestamp()
- @JvmName("setTimestamp")
- set(value) {
- _builder.setTimestamp(value)
- }
- /**
- * - * in ms - *- * - *
int64 timestamp = 2;
- */
- public fun clearTimestamp() {
- _builder.clearTimestamp()
- }
- }
-}
-@kotlin.jvm.JvmSynthetic
-public inline fun protogen.RemoteWrite.Sample.copy(block: protogen.SampleKt.Dsl.() -> kotlin.Unit): protogen.RemoteWrite.Sample =
- protogen.SampleKt.Dsl._create(this.toBuilder()).apply { block() }._build()
diff --git a/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/TimeSeriesKt.kt b/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/TimeSeriesKt.kt
deleted file mode 100644
index 6427f48..0000000
--- a/client/app/src/main/java/com/birdthedeveloper/prometheus/android/prometheus/android/exporter/protogen/TimeSeriesKt.kt
+++ /dev/null
@@ -1,158 +0,0 @@
-//Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: remote-write.proto
-
-package protogen;
-
-@kotlin.jvm.JvmSynthetic
-public inline fun timeSeries(block: protogen.TimeSeriesKt.Dsl.() -> kotlin.Unit): protogen.RemoteWrite.TimeSeries =
- protogen.TimeSeriesKt.Dsl._create(protogen.RemoteWrite.TimeSeries.newBuilder()).apply { block() }._build()
-public object TimeSeriesKt {
- @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
- @com.google.protobuf.kotlin.ProtoDslMarker
- public class Dsl private constructor(
- private val _builder: protogen.RemoteWrite.TimeSeries.Builder
- ) {
- public companion object {
- @kotlin.jvm.JvmSynthetic
- @kotlin.PublishedApi
- internal fun _create(builder: protogen.RemoteWrite.TimeSeries.Builder): Dsl = Dsl(builder)
- }
-
- @kotlin.jvm.JvmSynthetic
- @kotlin.PublishedApi
- internal fun _build(): protogen.RemoteWrite.TimeSeries = _builder.build()
-
- /**
- * An uninstantiable, behaviorless type to represent the field in
- * generics.
- */
- @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
- public class LabelsProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
- /**
- * repeated .protogen.Label labels = 1;
- */
- public val labels: com.google.protobuf.kotlin.DslListrepeated .protogen.Label labels = 1;
- * @param value The labels to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("addLabels")
- public fun com.google.protobuf.kotlin.DslListrepeated .protogen.Label labels = 1;
- * @param value The labels to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("plusAssignLabels")
- @Suppress("NOTHING_TO_INLINE")
- public inline operator fun com.google.protobuf.kotlin.DslListrepeated .protogen.Label labels = 1;
- * @param values The labels to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("addAllLabels")
- public fun com.google.protobuf.kotlin.DslListrepeated .protogen.Label labels = 1;
- * @param values The labels to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("plusAssignAllLabels")
- @Suppress("NOTHING_TO_INLINE")
- public inline operator fun com.google.protobuf.kotlin.DslListrepeated .protogen.Label labels = 1;
- * @param index The index to set the value at.
- * @param value The labels to set.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("setLabels")
- public operator fun com.google.protobuf.kotlin.DslListrepeated .protogen.Label labels = 1;
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("clearLabels")
- public fun com.google.protobuf.kotlin.DslListrepeated .protogen.Sample samples = 2;
- */
- public val samples: com.google.protobuf.kotlin.DslListrepeated .protogen.Sample samples = 2;
- * @param value The samples to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("addSamples")
- public fun com.google.protobuf.kotlin.DslListrepeated .protogen.Sample samples = 2;
- * @param value The samples to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("plusAssignSamples")
- @Suppress("NOTHING_TO_INLINE")
- public inline operator fun com.google.protobuf.kotlin.DslListrepeated .protogen.Sample samples = 2;
- * @param values The samples to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("addAllSamples")
- public fun com.google.protobuf.kotlin.DslListrepeated .protogen.Sample samples = 2;
- * @param values The samples to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("plusAssignAllSamples")
- @Suppress("NOTHING_TO_INLINE")
- public inline operator fun com.google.protobuf.kotlin.DslListrepeated .protogen.Sample samples = 2;
- * @param index The index to set the value at.
- * @param value The samples to set.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("setSamples")
- public operator fun com.google.protobuf.kotlin.DslListrepeated .protogen.Sample samples = 2;
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("clearSamples")
- public fun com.google.protobuf.kotlin.DslListrepeated .protogen.TimeSeries timeseries = 1;
- */
- public val timeseries: com.google.protobuf.kotlin.DslListrepeated .protogen.TimeSeries timeseries = 1;
- * @param value The timeseries to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("addTimeseries")
- public fun com.google.protobuf.kotlin.DslListrepeated .protogen.TimeSeries timeseries = 1;
- * @param value The timeseries to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("plusAssignTimeseries")
- @Suppress("NOTHING_TO_INLINE")
- public inline operator fun com.google.protobuf.kotlin.DslListrepeated .protogen.TimeSeries timeseries = 1;
- * @param values The timeseries to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("addAllTimeseries")
- public fun com.google.protobuf.kotlin.DslListrepeated .protogen.TimeSeries timeseries = 1;
- * @param values The timeseries to add.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("plusAssignAllTimeseries")
- @Suppress("NOTHING_TO_INLINE")
- public inline operator fun com.google.protobuf.kotlin.DslListrepeated .protogen.TimeSeries timeseries = 1;
- * @param index The index to set the value at.
- * @param value The timeseries to set.
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("setTimeseries")
- public operator fun com.google.protobuf.kotlin.DslListrepeated .protogen.TimeSeries timeseries = 1;
- */
- @kotlin.jvm.JvmSynthetic
- @kotlin.jvm.JvmName("clearTimeseries")
- public fun com.google.protobuf.kotlin.DslList