mirror of
https://github.com/mii443/prometheus-android-exporter.git
synced 2025-08-22 15:15:35 +00:00
rename package name
This commit is contained in:
@ -28,7 +28,7 @@ CTRL + SHIFT + ALT + L
|
|||||||
Client application is configurable via a configuration file.
|
Client application is configurable via a configuration file.
|
||||||
Place such file on your android device at a following path:
|
Place such file on your android device at a following path:
|
||||||
```
|
```
|
||||||
data/user/0/com.birdthedeveloper.prometheus.android.prometheus.android.exporter/files/
|
data/user/0/com.birdthedeveloper.prometheus.android.exporter/files/
|
||||||
```
|
```
|
||||||
The name of such configuration file can be either `config.yaml` or `config.yml`
|
The name of such configuration file can be either `config.yaml` or `config.yml`
|
||||||
|
|
||||||
|
@ -11,11 +11,11 @@ apply plugin: 'com.google.protobuf'
|
|||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace 'com.birdthedeveloper.prometheus.android.prometheus.android.exporter'
|
namespace 'com.birdthedeveloper.prometheus.android.exporter'
|
||||||
compileSdk 33
|
compileSdk 33
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.birdthedeveloper.prometheus.android.prometheus.android.exporter"
|
applicationId "com.birdthedeveloper.prometheus.android.exporter"
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode 1
|
versionCode 1
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter
|
package com.birdthedeveloper.prometheus.android.exporter
|
||||||
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
@ -20,7 +20,7 @@ class ExampleInstrumentedTest {
|
|||||||
// Context of the app under test.
|
// Context of the app under test.
|
||||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"com.birdthedeveloper.prometheus.android.prometheus.android.exporter",
|
"com.birdthedeveloper.prometheus.android.exporter",
|
||||||
appContext.packageName
|
appContext.packageName
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.compose
|
package com.birdthedeveloper.prometheus.android.exporter.compose
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
@ -102,7 +102,7 @@ data class PromConfiguration(
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
// data/user/0/com.birdthedeveloper.prometheus.android.prometheus.android.exporter/files
|
// data/user/0/com.birdthedeveloper.prometheus.android.exporter/files
|
||||||
private const val filename: String = "config.yaml"
|
private const val filename: String = "config.yaml"
|
||||||
private const val alternativeFilename: String = "config.yml"
|
private const val alternativeFilename: String = "config.yml"
|
||||||
fun configFileExists(context: Context): Boolean {
|
fun configFileExists(context: Context): Boolean {
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.compose
|
package com.birdthedeveloper.prometheus.android.exporter.compose
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@ -176,7 +176,7 @@ private fun StartStopButton(
|
|||||||
private fun TabPage(
|
private fun TabPage(
|
||||||
promViewModel: PromViewModel,
|
promViewModel: PromViewModel,
|
||||||
) {
|
) {
|
||||||
val tabs = mapOf(0 to "Prom Server", 1 to "PushProx", 2 to "Remote write")
|
val tabs = mapOf(0 to "Prom Server", 1 to "PushProx", 2 to "Batch exporter")
|
||||||
val uiState: PromUiState by promViewModel.uiState.collectAsState()
|
val uiState: PromUiState by promViewModel.uiState.collectAsState()
|
||||||
|
|
||||||
Column {
|
Column {
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.compose
|
package com.birdthedeveloper.prometheus.android.exporter.compose
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
@ -15,7 +15,7 @@ import androidx.navigation.NavHostController
|
|||||||
import androidx.navigation.compose.NavHost
|
import androidx.navigation.compose.NavHost
|
||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import androidx.navigation.compose.rememberNavController
|
import androidx.navigation.compose.rememberNavController
|
||||||
import com.birdthedeveloper.prometheus.android.prometheus.android.exporter.ui.theme.PrometheusAndroidExporterTheme
|
import com.birdthedeveloper.prometheus.android.exporter.ui.theme.PrometheusAndroidExporterTheme
|
||||||
|
|
||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.compose
|
package com.birdthedeveloper.prometheus.android.exporter.compose
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
@ -16,7 +16,7 @@ import androidx.work.OutOfQuotaPolicy
|
|||||||
import androidx.work.WorkInfo
|
import androidx.work.WorkInfo
|
||||||
import androidx.work.WorkManager
|
import androidx.work.WorkManager
|
||||||
import androidx.work.WorkQuery
|
import androidx.work.WorkQuery
|
||||||
import com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker.PromWorker
|
import com.birdthedeveloper.prometheus.android.exporter.worker.PromWorker
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.flow.StateFlow
|
import kotlinx.coroutines.flow.StateFlow
|
||||||
import kotlinx.coroutines.flow.asStateFlow
|
import kotlinx.coroutines.flow.asStateFlow
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.compose
|
package com.birdthedeveloper.prometheus.android.exporter.compose
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
@ -1,4 +1,4 @@
|
|||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.ui.theme
|
package com.birdthedeveloper.prometheus.android.exporter.ui.theme
|
||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.ui.theme
|
package com.birdthedeveloper.prometheus.android.exporter.ui.theme
|
||||||
|
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.Shapes
|
import androidx.compose.material.Shapes
|
@ -1,4 +1,4 @@
|
|||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.ui.theme
|
package com.birdthedeveloper.prometheus.android.exporter.ui.theme
|
||||||
|
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material.MaterialTheme
|
@ -1,4 +1,4 @@
|
|||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.ui.theme
|
package com.birdthedeveloper.prometheus.android.exporter.ui.theme
|
||||||
|
|
||||||
import androidx.compose.material.Typography
|
import androidx.compose.material.Typography
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import io.prometheus.client.Collector
|
import io.prometheus.client.Collector
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import kotlinx.coroutines.CancellationException
|
import kotlinx.coroutines.CancellationException
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import android.app.NotificationManager
|
import android.app.NotificationManager
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
@ -10,8 +10,8 @@ import androidx.work.CoroutineWorker
|
|||||||
import androidx.work.ForegroundInfo
|
import androidx.work.ForegroundInfo
|
||||||
import androidx.work.WorkManager
|
import androidx.work.WorkManager
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import com.birdthedeveloper.prometheus.android.prometheus.android.exporter.R
|
import com.birdthedeveloper.prometheus.android.exporter.R
|
||||||
import com.birdthedeveloper.prometheus.android.prometheus.android.exporter.compose.PromConfiguration
|
import com.birdthedeveloper.prometheus.android.exporter.compose.PromConfiguration
|
||||||
import io.prometheus.client.CollectorRegistry
|
import io.prometheus.client.CollectorRegistry
|
||||||
import io.prometheus.client.exemplars.ExemplarConfig
|
import io.prometheus.client.exemplars.ExemplarConfig
|
||||||
import io.prometheus.client.exporter.common.TextFormat
|
import io.prometheus.client.exporter.common.TextFormat
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import io.ktor.http.HttpStatusCode
|
import io.ktor.http.HttpStatusCode
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
import android.util.Log
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.ConnectivityManager
|
import android.net.ConnectivityManager
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
//import android.content.Context
|
//import android.content.Context
|
||||||
//import androidx.annotation.EmptySuper
|
//import androidx.annotation.EmptySuper
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import remote.write.RemoteWrite
|
import remote.write.RemoteWrite
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import io.prometheus.client.Collector.MetricFamilySamples
|
import io.prometheus.client.Collector.MetricFamilySamples
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
private const val TAG = "SCRAPE_RECORDER"
|
private const val TAG = "SCRAPE_RECORDER"
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
// Author: Martin Ptacek
|
// Author: Martin Ptacek
|
||||||
|
|
||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.ConnectivityManager
|
import android.net.ConnectivityManager
|
@ -1,4 +1,4 @@
|
|||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Assert.*
|
import org.junit.Assert.*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.birdthedeveloper.prometheus.android.prometheus.android.exporter.worker
|
package com.birdthedeveloper.prometheus.android.exporter.worker
|
||||||
|
|
||||||
import org.junit.Assert.*
|
import org.junit.Assert.*
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
Reference in New Issue
Block a user