Skip to content

Commit

Permalink
Move the metrics API to the observability module [PLEN-35] (digital-a…
Browse files Browse the repository at this point in the history
  • Loading branch information
nicu-da authored Dec 12, 2022
1 parent 6d27505 commit 25f1254
Show file tree
Hide file tree
Showing 73 changed files with 256 additions and 77 deletions.
1 change: 1 addition & 0 deletions daml-script/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ da_scala_test_suite(
"//libs-scala/resources",
"//libs-scala/resources-akka",
"//libs-scala/resources-grpc",
"//observability/metrics",
"@maven//:com_auth0_java_jwt",
"@maven//:io_dropwizard_metrics_metrics_core",
],
Expand Down
3 changes: 2 additions & 1 deletion language-support/scala/bindings-akka/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ da_scala_library(
"//ledger/ledger-api-client",
"//ledger/ledger-api-common",
"//ledger/ledger-api-domain",
"//ledger/metrics",
"//observability/telemetry",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:com_google_api_grpc_proto_google_common_protos",
Expand Down Expand Up @@ -99,6 +99,7 @@ da_scala_test_suite(
"//ledger-api/rs-grpc-bridge",
"//ledger/ledger-api-client",
"//ledger/metrics",
"//observability/telemetry",
"@maven//:com_google_api_grpc_proto_google_common_protos",
"@maven//:com_typesafe_config",
"@maven//:org_scalatest_scalatest_compatible",
Expand Down
2 changes: 1 addition & 1 deletion language-support/scala/codegen-sample-app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ da_scala_test(
"//ledger/ledger-api-common",
"//ledger/ledger-resources",
"//ledger/ledger-runner-common",
"//ledger/metrics",
"//ledger/participant-integration-api",
"//ledger/sandbox-on-x",
"//ledger/sandbox-on-x:sandbox-on-x-test-lib",
"//libs-scala/ports",
"//libs-scala/resources",
"//observability/telemetry",
],
)
2 changes: 1 addition & 1 deletion ledger-service/cli-opts/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ da_scala_library(
],
deps = [
"//ledger/ledger-api-common",
"//ledger/metrics",
"//observability/metrics",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:io_netty_netty_handler",
Expand Down
2 changes: 1 addition & 1 deletion ledger-service/db-backend/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ da_scala_library(
"//ledger-service/metrics",
"//ledger-service/utils",
"//ledger/caching",
"//ledger/metrics",
"//libs-scala/contextualized-logging",
"//libs-scala/nonempty",
"//libs-scala/nonempty-cats",
"//libs-scala/scala-utils",
"//observability/metrics",
],
)

Expand Down
2 changes: 1 addition & 1 deletion ledger-service/http-json-cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ da_scala_library(
"//ledger-service/cli-opts",
"//ledger-service/pureconfig-utils",
"//ledger/ledger-api-common",
"//ledger/metrics",
"//libs-scala/db-utils",
"//observability/metrics",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:com_typesafe_config",
"@maven//:io_netty_netty_handler",
Expand Down
1 change: 0 additions & 1 deletion ledger-service/http-json-testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ load("//ledger-service/utils:scalaopts.bzl", "hj_scalacopts")
"//ledger/ledger-api-common",
"//ledger/ledger-resources",
"//ledger/ledger-runner-common",
"//ledger/metrics",
"//ledger/participant-integration-api",
"//ledger/sandbox-on-x",
"//ledger/sandbox-on-x:sandbox-on-x-test-lib",
Expand Down
4 changes: 2 additions & 2 deletions ledger-service/http-json/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ load("//ledger-service/utils:scalaopts.bzl", "hj_scalacopts")
"//ledger/ledger-api-auth",
"//ledger/ledger-api-common",
"//ledger/ledger-resources",
"//ledger/metrics",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/db-utils",
Expand All @@ -79,6 +78,7 @@ load("//ledger-service/utils:scalaopts.bzl", "hj_scalacopts")
"//libs-scala/scala-utils",
"//libs-scala/struct-json",
"//observability/akka-http-metrics",
"//observability/metrics",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_opentelemetry_opentelemetry_api",
],
Expand Down Expand Up @@ -266,7 +266,6 @@ daml_compile(
"//language-support/scala/bindings-akka",
"//ledger-service/db-backend",
"//ledger-service/fetch-contracts",
"//ledger/metrics",
"//ledger-service/http-json-cli:{}".format(edition),
"//ledger-service/http-json-testing:{}".format(edition),
"//ledger-service/cli-opts",
Expand All @@ -283,6 +282,7 @@ daml_compile(
"//libs-scala/scalatest-utils",
"//libs-scala/test-evidence/scalatest:test-evidence-scalatest",
"//libs-scala/test-evidence/tag:test-evidence-tag",
"//observability/metrics",
"@maven//:org_scalatest_scalatest_compatible",
],
)
Expand Down
2 changes: 1 addition & 1 deletion ledger-service/metrics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ da_scala_library(
runtime_deps = [],
deps = [
"//ledger/ledger-resources",
"//ledger/metrics",
"//libs-scala/resources",
"//libs-scala/resources-akka",
"//libs-scala/resources-grpc",
"//observability/akka-http-metrics",
"//observability/metrics",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_dropwizard_metrics_metrics_jmx",
"@maven//:io_netty_netty_transport",
Expand Down
4 changes: 2 additions & 2 deletions ledger-service/pureconfig-utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ da_scala_library(
],
deps = [
"//ledger/ledger-api-common",
"//ledger/metrics",
"//libs-scala/db-utils",
"//libs-scala/jwt",
"//observability/metrics",
"@maven//:com_auth0_java_jwt",
"@maven//:com_typesafe_config",
"@maven//:io_netty_netty_handler",
Expand All @@ -55,8 +55,8 @@ da_scala_test(
scalacopts = lf_scalacopts,
deps = [
":pureconfig-utils",
"//ledger/metrics",
"//libs-scala/jwt",
"//observability/metrics",
"@maven//:org_scalatest_scalatest_compatible",
],
)
2 changes: 1 addition & 1 deletion ledger/caching/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ da_scala_library(
"//:__subpackages__",
],
deps = [
"//ledger/metrics",
"//observability/metrics",
"@maven//:com_github_ben_manes_caffeine_caffeine",
],
)
Expand Down
1 change: 1 addition & 0 deletions ledger/indexer-benchmark/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ da_scala_library(
"//libs-scala/resources",
"//libs-scala/resources-akka",
"//libs-scala/resources-grpc",
"//observability/metrics",
"@maven//:io_dropwizard_metrics_metrics_core",
],
)
3 changes: 2 additions & 1 deletion ledger/ledger-api-bench-tool/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ da_scala_library(
"//ledger/ledger-api-common",
"//ledger/ledger-api-errors",
"//ledger/ledger-resources",
"//ledger/metrics",
"//ledger/participant-local-store",
"//libs-scala/jwt",
"//libs-scala/resources",
Expand All @@ -69,6 +68,7 @@ da_scala_library(
"//libs-scala/timer-utils",
"//ledger/test-common:benchtool-tests-%s.scala" % "1.15", # TODO: make the LF version configurable
"//ledger/test-common:dar-files-%s-lib" % "1.15", # TODO: make the LF version configurable
"//observability/metrics",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_core",
Expand Down Expand Up @@ -159,6 +159,7 @@ da_scala_test_suite(
"//libs-scala/adjustable-clock",
"//libs-scala/ports",
"//libs-scala/resources",
"//observability/metrics",
"@maven//:com_typesafe_config",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_grpc_grpc_api",
Expand Down
7 changes: 6 additions & 1 deletion ledger/ledger-api-client/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ da_scala_library(
"//ledger/ledger-api-domain",
"//ledger/ledger-grpc",
"//ledger/ledger-resources",
"//ledger/metrics",
"//libs-scala/grpc-utils",
"//libs-scala/ports",
"//libs-scala/resources",
"//observability/metrics",
"//observability/telemetry",
"@maven//:com_google_api_grpc_proto_google_common_protos",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:io_dropwizard_metrics_metrics_core",
Expand Down Expand Up @@ -70,6 +71,8 @@ da_scala_test_suite(
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/grpc-utils",
"//observability/metrics",
"//observability/telemetry",
"@maven//:com_google_api_grpc_proto_google_common_protos",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:io_dropwizard_metrics_metrics_core",
Expand Down Expand Up @@ -119,6 +122,8 @@ da_scala_test_suite(
"//libs-scala/logging-entries",
"//libs-scala/ports",
"//libs-scala/resources",
"//observability/metrics",
"//observability/telemetry",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:io_netty_netty_handler",
],
Expand Down
6 changes: 5 additions & 1 deletion ledger/ledger-api-common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ da_scala_library(
"//libs-scala/resources-akka",
"//libs-scala/resources-grpc",
"//libs-scala/timer-utils",
"//observability/metrics",
"//observability/telemetry",
"@maven//:commons_codec_commons_codec",
"@maven//:commons_io_commons_io",
"@maven//:io_grpc_grpc_netty",
Expand Down Expand Up @@ -130,14 +132,16 @@ da_scala_test_suite(
"//ledger/ledger-api-health",
"//ledger/ledger-offset",
"//ledger/metrics",
"//ledger/metrics:metrics-test-lib",
"//ledger/participant-state-index",
"//ledger/test-common",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/grpc-utils",
"//libs-scala/logging-entries",
"//libs-scala/scala-utils",
"//observability/metrics",
"//observability/telemetry",
"//observability/telemetry:telemetry-test-lib",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:com_google_api_grpc_proto_google_common_protos",
Expand Down
5 changes: 3 additions & 2 deletions ledger/ledger-runner-common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ da_scala_library(
"//ledger/ledger-api-common",
"//ledger/ledger-configuration",
"//ledger/ledger-resources",
"//ledger/metrics",
"//ledger/participant-integration-api",
"//libs-scala/contextualized-logging",
"//libs-scala/jwt",
"//libs-scala/ports",
"//libs-scala/resources",
"//observability/metrics",
"@maven//:com_typesafe_config",
"@maven//:io_netty_netty_handler",
],
Expand All @@ -59,10 +59,10 @@ da_scala_library(
"//daml-lf/language",
"//daml-lf/transaction",
"//ledger/ledger-api-common",
"//ledger/metrics",
"//ledger/participant-integration-api",
"//libs-scala/jwt",
"//libs-scala/ports",
"//observability/metrics",
"@maven//:io_netty_netty_handler",
],
)
Expand Down Expand Up @@ -101,6 +101,7 @@ da_scala_test_suite(
"//ledger/participant-integration-api",
"//libs-scala/jwt",
"//libs-scala/ports",
"//observability/metrics",
"@maven//:com_typesafe_config",
"@maven//:io_netty_netty_handler",
"@maven//:org_scalatest_scalatest_compatible",
Expand Down
48 changes: 2 additions & 46 deletions ledger/metrics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,16 @@ da_scala_library(
srcs = glob(["src/main/scala/**/*.scala"]),
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
"@maven//:com_thesamet_scalapb_scalapb_runtime",
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_scalaz_scalaz_core",
"@maven//:com_github_scopt_scopt",
],
tags = ["maven_coordinates=com.daml:metrics:__VERSION__"],
tags = ["maven_coordinates=com.daml:ledger-metrics:__VERSION__"],
visibility = [
"//visibility:public",
],
runtime_deps = [],
deps = [
"//ledger/ledger-resources",
"//libs-scala/build-info",
"//libs-scala/concurrent",
"//libs-scala/resources",
"//libs-scala/scala-utils",
"@maven//:com_google_protobuf_protobuf_java",
"//observability/metrics",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_dropwizard_metrics_metrics_graphite",
"@maven//:io_dropwizard_metrics_metrics_jvm",
"@maven//:io_grpc_grpc_api",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_opentelemetry_opentelemetry_context",
"@maven//:io_opentelemetry_opentelemetry_exporter_prometheus",
"@maven//:io_opentelemetry_opentelemetry_sdk_metrics",
"@maven//:io_prometheus_simpleclient",
"@maven//:io_prometheus_simpleclient_dropwizard",
"@maven//:io_prometheus_simpleclient_httpserver",
"@maven//:org_slf4j_slf4j_api",
],
)

da_scala_library(
name = "metrics-test-lib",
srcs = glob(["src/test/lib/scala/**/*.scala"]),
scala_deps = [
"@maven//:org_scalactic_scalactic",
"@maven//:org_scalatest_scalatest_core",
],
tags = ["maven_coordinates=com.daml:metrics-test-lib:__VERSION__"],
visibility = [
"//visibility:public",
],
runtime_deps = [],
deps = [
":metrics",
"//libs-scala/scala-utils",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_opentelemetry_opentelemetry_context",
"@maven//:io_opentelemetry_opentelemetry_sdk_testing",
"@maven//:io_opentelemetry_opentelemetry_sdk_trace",
"@maven//:org_scalatest_scalatest_compatible",
],
)

Expand Down
8 changes: 6 additions & 2 deletions ledger/participant-integration-api/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ compile_deps = [
"//libs-scala/timer-utils",
"//libs-scala/nameof",
"//libs-scala/struct-json",
"//observability/telemetry",
"//observability/metrics",
"@maven//:com_google_guava_guava",
"@maven//:com_zaxxer_HikariCP",
"@maven//:io_dropwizard_metrics_metrics_core",
Expand Down Expand Up @@ -205,6 +207,7 @@ da_scala_library(
"//libs-scala/resources-grpc",
"//libs-scala/scala-utils",
"//libs-scala/timer-utils",
"//observability/metrics",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_netty_netty_common",
Expand Down Expand Up @@ -294,7 +297,6 @@ da_scala_test_suite(
"//ledger/ledger-resources",
"//ledger/ledger-resources:ledger-resources-test-lib",
"//ledger/metrics",
"//ledger/metrics:metrics-test-lib",
"//ledger/participant-local-store",
"//ledger/participant-local-store:participant-local-store-tests-lib",
"//ledger/participant-state",
Expand All @@ -314,6 +316,9 @@ da_scala_test_suite(
"//libs-scala/scala-utils",
"//libs-scala/scalatest-utils",
"//libs-scala/timer-utils",
"//observability/metrics",
"//observability/telemetry",
"//observability/telemetry:telemetry-test-lib",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
"@maven//:com_github_ben_manes_caffeine_caffeine",
Expand Down Expand Up @@ -387,7 +392,6 @@ da_scala_test_suite(
"//ledger/ledger-resources",
"//ledger/ledger-resources:ledger-resources-test-lib",
"//ledger/metrics",
"//ledger/metrics:metrics-test-lib",
"//ledger/participant-local-store",
"//ledger/participant-local-store:participant-local-store-tests-lib",
"//ledger/participant-state",
Expand Down
2 changes: 2 additions & 0 deletions ledger/participant-local-store/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ da_scala_library(
"//ledger/ledger-api-domain",
"//ledger/metrics",
"//libs-scala/contextualized-logging",
"//observability/metrics",
"@maven//:com_github_ben_manes_caffeine_caffeine",
],
)
Expand Down Expand Up @@ -84,6 +85,7 @@ da_scala_test_suite(
"//ledger/ledger-resources:ledger-resources-test-lib",
"//ledger/metrics",
"//libs-scala/contextualized-logging",
"//observability/metrics",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:org_mockito_mockito_core",
],
Expand Down
Loading

0 comments on commit 25f1254

Please sign in to comment.