Skip to content
This repository was archived by the owner on Dec 27, 2021. It is now read-only.

Commit bf8d867

Browse files
authored
issue #184: remove instrumentation stuff and testkit 🚑 (#185)
1 parent 5ec5cf5 commit bf8d867

File tree

10 files changed

+6
-55
lines changed

10 files changed

+6
-55
lines changed

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ lazy val `lagompb-core` = project
1818
.settings(
1919
name := "lagompb-core",
2020
unmanagedResources / excludeFilter := HiddenFileFilter || "*tests*",
21-
coverageExcludedPackages := CoverageWhitelist.whitelist.mkString(";"),
21+
coverageExcludedPackages := CoverageExclusionList.whitelist.mkString(";"),
2222
PB.protoSources in Compile ++= Seq(file("submodules/protobuf"), file("core/lagompb-core/src/test/protobuf")),
2323
PB.includePaths in Compile ++= Seq(file("submodules/protobuf")),
2424
PB.targets in Compile := Seq(
@@ -31,7 +31,7 @@ lazy val `lagompb-readside` = project
3131
.enablePlugins(LagomScala)
3232
.enablePlugins(BuildSettings)
3333
.enablePlugins(Publish)
34-
.settings(name := "lagompb-readside", coverageExcludedPackages := CoverageWhitelist.whitelist.mkString(";"))
34+
.settings(name := "lagompb-readside", coverageExcludedPackages := CoverageExclusionList.whitelist.mkString(";"))
3535
.dependsOn(`lagompb-core`)
3636

3737
lazy val `lagompb-plugin` = project
@@ -40,7 +40,7 @@ lazy val `lagompb-plugin` = project
4040
.enablePlugins(Publish)
4141
.settings(
4242
name := "lagompb-plugin",
43-
coverageExcludedPackages := CoverageWhitelist.whitelist.mkString(";"),
43+
coverageExcludedPackages := CoverageExclusionList.whitelist.mkString(";"),
4444
crossScalaVersions := Dependencies.Versions.CrossScalaForPlugin,
4545
scalaVersion := Dependencies.Versions.Scala212,
4646
resolvers += Resolver.bintrayRepo("playframework", "maven"),

core/lagompb-core/src/main/resources/lagompb.conf

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -459,20 +459,4 @@ lagompb {
459459
tagname: ${lagompb.service-name}
460460
tagname: ${?EVENTS_TAG_NAME}
461461
}
462-
463-
instrumentation {
464-
enabled = true
465-
enabled = ${?ENABLE_INSTRUMENTATION}
466-
}
467-
}
468-
469-
kamon {
470-
trace {
471-
tick-interval = 1 millisecond
472-
sampler = always
473-
}
474-
475-
propagation.http.default.tags.mappings {
476-
request-id = "x-request-id"
477-
}
478462
}

core/lagompb-core/src/main/scala/io/superflat/lagompb/BaseApplication.scala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.lightbend.lagom.scaladsl.persistence.slick.SlickPersistenceComponents
88
import com.lightbend.lagom.scaladsl.playjson.{EmptyJsonSerializerRegistry, JsonSerializerRegistry}
99
import com.lightbend.lagom.scaladsl.server.{LagomApplication, LagomApplicationContext, LagomServer}
1010
import io.superflat.lagompb.encryption.{EncryptionAdapter, ProtoEncryption}
11-
import kamon.Kamon
1211
import play.api.db.HikariCPComponents
1312
import play.api.libs.ws.ahc.AhcWSComponents
1413
import play.api.mvc.EssentialFilter
@@ -41,11 +40,6 @@ abstract class BaseApplication(context: LagomApplicationContext)
4140
with PostgresPersistenceComponents
4241
with BaseApplicationComponents {
4342

44-
// $COVERAGE-OFF$
45-
// initialize instrumentation and tracing if it is enabled
46-
if (ConfigReader.isInstrumentationEnabled)
47-
Kamon.init()
48-
4943
ProtosRegistry.load()
5044

5145
// Json Serializer registry not needed
@@ -101,8 +95,6 @@ abstract class BaseApplication(context: LagomApplicationContext)
10195
selectShard(ConfigReader.eventsConfig.numShards, entityContext.entityId)
10296
aggregateRoot.create(entityContext, shardIndex)
10397
})
104-
105-
// $COVERAGE-ON$
10698
}
10799

108100
/**
@@ -115,8 +107,6 @@ abstract class BaseStatelessApplication(context: LagomApplicationContext)
115107
extends LagomApplication(context)
116108
with BaseApplicationComponents {
117109

118-
// $COVERAGE-OFF$
119-
120110
// lagomServer is set by the server definition in the implementation class
121111
override lazy val lagomServer: LagomServer = server
122112

@@ -133,6 +123,4 @@ abstract class BaseStatelessApplication(context: LagomApplicationContext)
133123
* @return ServiceLocator
134124
*/
135125
override def serviceLocator: ServiceLocator
136-
137-
// $COVERAGE-ON$
138126
}

core/lagompb-core/src/main/scala/io/superflat/lagompb/ConfigReader.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,4 @@ object ConfigReader {
3838

3939
def createOffsetStore: Boolean =
4040
config.getBoolean("lagompb.projection.create-tables.auto")
41-
42-
def isInstrumentationEnabled: Boolean =
43-
config.getBoolean(s"$LP.instrumentation.enabled")
4441
}

project/BuildSettings.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,8 @@ object BuildSettings extends AutoPlugin {
3636
Compile.AkkaManagementClusterBootstrap,
3737
Compile.AkkaManagementClusterHttp,
3838
Compile.AkkaKubernetesDiscoveryApi,
39-
Compile.JwtPlayJson,
4039
Compile.ScalapbJson4s,
4140
Compile.Reflections,
42-
Compile.KamonBundle,
43-
Compile.KamonPrometheus,
44-
Compile.KamonJaeger,
45-
Compile.ApacheCommonValidator,
4641
Compile.ScalapbCommonProtos,
4742
Compile.AkkaProjectionCore,
4843
Compile.AkkaProjectionKafka,

project/CoverageWhitelist.scala renamed to project/CoverageExclusionList.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
object CoverageWhitelist {
1+
object CoverageExclusionList {
22

33
val whitelist = Seq(
44
"<empty>",
@@ -7,6 +7,8 @@ object CoverageWhitelist {
77
"io.superflat.lagompb.testkit.*",
88
"io.superflat.lagompb.readside.*",
99
"io.superflat.lagompb.BaseServiceImpl",
10+
"io.superflat.lagompb.BaseApplication",
11+
"io.superflat.lagompb.BaseStatelessApplication",
1012
"io.superflat.lagompb.BaseGrpcServiceImpl",
1113
"io.superflat.lagompb.BaseServiceImpl",
1214
"io.superflat.lagompb.InternalServerError",

project/Dependencies.scala

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,13 @@ object Dependencies {
2222
val AkkaManagementVersion = "1.0.8"
2323
val AkkaManagementClusterBootstrapVersion = "1.0.8"
2424
val AkkaManagementClusterHttpVersion = "1.0.8"
25-
val JwtPlayJsonVersion = "4.3.0"
26-
val SlickMigrationApiVersion = "0.7.0"
2725
val ScalaMockVersion = "5.0.0"
28-
val KamonVersion = "2.1.6"
29-
val KanelaVersion = "1.0.6"
3026
val SilencerVersion = "1.6.0"
3127
val AkkaGrpcVersion = "1.0.0"
3228
val H2Version = "1.4.200"
3329
val ScalapbJson4sVersion = "0.10.1"
3430
val PlayGrpcVersion = "0.9.0"
3531
val ReflectionsVersion = "0.9.12"
36-
val ApacheCommonValidatorVersion = "1.7"
3732
val ScalapbCommonProtoVersion = "1.18.0-0"
3833
val EmbeddedPostgresVersion = "0.13.3"
3934
val EmbeddedKafkaVersion = "2.6.0"
@@ -67,19 +62,10 @@ object Dependencies {
6762

6863
val AkkaManagementClusterHttp: ModuleID =
6964
"com.lightbend.akka.management" %% "akka-management-cluster-http" % Versions.AkkaManagementClusterHttpVersion
70-
val JwtPlayJson: ModuleID = "com.pauldijou" %% "jwt-play-json" % Versions.JwtPlayJsonVersion
71-
val SlickMigrationApi: ModuleID = "io.github.nafg" %% "slick-migration-api" % Versions.SlickMigrationApiVersion
72-
val KamonBundle: ModuleID = "io.kamon" %% "kamon-bundle" % Versions.KamonVersion
73-
val KamonPrometheus: ModuleID = "io.kamon" %% "kamon-prometheus" % Versions.KamonVersion
74-
val KamonZipkin: ModuleID = "io.kamon" %% "kamon-zipkin" % Versions.KamonVersion
75-
val KamonJaeger: ModuleID = "io.kamon" %% "kamon-jaeger" % Versions.KamonVersion
76-
val Kanela: ModuleID = "io.kamon" % "kanela-agent" % Versions.KanelaVersion
7765

7866
val H2Driver: ModuleID = "com.h2database" % "h2" % Versions.H2Version
7967
val ScalapbJson4s: ModuleID = "com.thesamet.scalapb" %% "scalapb-json4s" % Versions.ScalapbJson4sVersion
8068
val Reflections: ModuleID = "org.reflections" % "reflections" % Versions.ReflectionsVersion
81-
val ApacheCommonValidator: ModuleID =
82-
"commons-validator" % "commons-validator" % Versions.ApacheCommonValidatorVersion
8369

8470
val ScalapbCommonProtos: ModuleID =
8571
"com.thesamet.scalapb.common-protos" %% "proto-google-common-protos-scalapb_0.10" % Versions.ScalapbCommonProtoVersion

project/TestSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ object TestSettings extends AutoPlugin {
1818
Dependencies.Test.AkkaTestkit,
1919
Dependencies.Test.AkkaStreamTestkit,
2020
Dependencies.Test.AkkaActorTestkitTyped,
21-
Dependencies.Compile.SlickMigrationApi,
2221
Dependencies.Compile.postgresDriver,
2322
Dependencies.Compile.H2Driver
2423
)

0 commit comments

Comments
 (0)