Skip to content

Commit

Permalink
Removed dropwizard dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
daravep committed Mar 13, 2024
1 parent 16e70f6 commit c938ab6
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 711 deletions.
5 changes: 0 additions & 5 deletions bazel-java-deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ def install_java_deps():
"io.circe:circe-generic_{}:{}".format(scala_major_version, circe_version),
"io.circe:circe-parser_{}:{}".format(scala_major_version, circe_version),
"io.circe:circe-yaml_{}:{}".format(scala_major_version, "0.15.0-RC1"),
"io.dropwizard.metrics:metrics-core:{}".format(dropwizard_version),
"io.dropwizard.metrics:metrics-jmx:{}".format(dropwizard_version),
"io.dropwizard.metrics:metrics-jvm:{}".format(dropwizard_version),
# "io.gatling.highcharts:gatling-charts-highcharts:{}".format(gatling_version),
# "io.gatling:gatling-app:{}".format(gatling_version),
# "io.gatling:gatling-charts:{}".format(gatling_version),
Expand Down Expand Up @@ -199,7 +196,6 @@ def install_java_deps():
"io.opentelemetry:opentelemetry-sdk:{}".format(opentelemetry_version),
"io.opentelemetry:opentelemetry-semconv:{}-alpha".format(opentelemetry_version),
"io.prometheus:simpleclient:{}".format(prometheus_version),
"io.prometheus:simpleclient_dropwizard:{}".format(prometheus_version),
"io.prometheus:simpleclient_httpserver:{}".format(prometheus_version),
"io.prometheus:simpleclient_servlet:{}".format(prometheus_version),
"io.reactivex.rxjava2:rxjava:2.2.21",
Expand Down Expand Up @@ -266,7 +262,6 @@ def install_java_deps():
"org.wartremover:wartremover_{}:2.4.21".format(scala_version),
"org.xerial:sqlite-jdbc:3.36.0.1",
maven.artifact("com.github.pureconfig", "pureconfig-macros_2.12", "0.14.0", neverlink = True),
maven.artifact("io.dropwizard.metrics", "metrics-graphite", dropwizard_version, exclusions = ["com.rabbitmq:amqp-client"]),
],
fetch_sources = True,
maven_install_json = "@com_github_digital_asset_daml//:maven_install_{}.json".format(scala_major_version),
Expand Down
1 change: 0 additions & 1 deletion canton/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ da_scala_library(
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
"@maven//:commons_codec_commons_codec",
"@maven//:commons_io_commons_io",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_netty",
"@maven//:io_grpc_grpc_protobuf",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package com.digitalasset.canton.metrics

import com.daml.metrics.api.MetricDoc.MetricQualification.{Debug, Saturation, Traffic}
import com.daml.metrics.api.MetricHandle.*
import com.daml.metrics.api.dropwizard.DropwizardTimer
import com.daml.metrics.api.{MetricDoc, MetricName}

class ServicesMetrics(
Expand Down Expand Up @@ -224,18 +223,6 @@ class ServicesMetrics(
object write {
val prefix: MetricName = ServicesMetrics.this.prefix :+ "write"

@MetricDoc.Tag(
summary = "The number of submitted transactions by the write service.",
description = """The write service is an internal interface for changing the state through
|the synchronization services. The methods in this interface are all methods
|that are supported uniformly across all ledger implementations. This metric
|exposes the total number of the sumbitted transactions.""",
qualification = Traffic,
)
@SuppressWarnings(Array("org.wartremover.warts.Null"))
val submitOperationForDocs: Timer =
DropwizardTimer(prefix :+ "submit_transaction" :+ "count", null)

@MetricDoc.FanInstanceTag
val submitTransaction: Timer = openTelemetryMetricsFactory.timer(prefix :+ "submit_transaction")
@MetricDoc.FanInstanceTag
Expand Down
1 change: 0 additions & 1 deletion daml-script/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,5 @@ da_scala_test_suite(
"//observability/metrics",
"//test-common/canton/it-lib",
"@maven//:com_auth0_java_jwt",
"@maven//:io_dropwizard_metrics_metrics_core",
],
)
2 changes: 0 additions & 2 deletions ledger-service/metrics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ da_scala_library(
"//observability/metrics",
"//observability/pekko-http-metrics",
"//observability/telemetry",
"@maven//:io_dropwizard_metrics_metrics_core",
"@maven//:io_dropwizard_metrics_metrics_jmx",
"@maven//:io_netty_netty_transport",
"@maven//:io_opentelemetry_opentelemetry_api",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

package com.daml.http.metrics

import com.codahale.metrics.MetricRegistry
import com.daml.metrics.api.MetricHandle.{Counter, LabeledMetricsFactory, MetricsFactory, Timer}
import com.daml.metrics.api.MetricName
import com.daml.metrics.api.dropwizard.DropwizardMetricsFactory
import com.daml.metrics.api.noop.NoOpMetricsFactory
import com.daml.metrics.http.{DamlHttpMetrics, DamlWebSocketMetrics}
import com.daml.metrics.{CacheMetrics, HealthMetrics}
Expand All @@ -29,13 +27,6 @@ class HttpJsonApiMetrics(
) {
import HttpJsonApiMetrics._

@nowarn
def getMetricRegistry: Option[MetricRegistry] =
defaultMetricsFactory match {
case mf: DropwizardMetricsFactory => Some(mf.registry)
case _ => None
}

val prefix: MetricName = MetricName.Daml :+ "http_json_api"

@nowarn
Expand Down
13 changes: 0 additions & 13 deletions observability/metrics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ da_scala_library(
srcs = glob(["src/main/scala/**/*.scala"]),
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
"@maven//:com_chuusai_shapeless",
"@maven//:com_github_pureconfig_pureconfig_core",
"@maven//:com_github_pureconfig_pureconfig_generic",
"@maven//:com_github_scopt_scopt",
"@maven//:com_thesamet_scalapb_scalapb_runtime",
"@maven//:org_apache_pekko_pekko_actor",
"@maven//:org_apache_pekko_pekko_stream",
Expand All @@ -27,23 +23,15 @@ da_scala_library(
],
runtime_deps = [],
deps = [
"//libs-scala/build-info",
"//libs-scala/concurrent",
"//libs-scala/scala-utils",
"@maven//:com_google_code_findbugs_jsr305",
"@maven//:com_google_protobuf_protobuf_java",
"@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_instrumentation_opentelemetry_runtime_metrics",
"@maven//:io_opentelemetry_opentelemetry_api",
"@maven//:io_opentelemetry_opentelemetry_context",
"@maven//:io_opentelemetry_opentelemetry_sdk_common",
"@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",
],
)
Expand All @@ -61,7 +49,6 @@ da_scala_library(
deps = [
":metrics",
"//libs-scala/scala-utils",
"@maven//:io_dropwizard_metrics_metrics_core",
],
)

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,4 @@

package com.daml.metrics

import com.daml.metrics.api.reporters.MetricsReporter
import pureconfig.{ConfigReader, ConvertHelpers}
import pureconfig.generic.semiauto.deriveReader

import scala.concurrent.duration._

final case class HistogramDefinition(nameRegex: String, bucketBoundaries: Seq[Double])

final case class MetricsConfig(
reporter: MetricsReporter,
reportingInterval: FiniteDuration,
histograms: Seq[HistogramDefinition],
)

object MetricsConfig {

val DefaultMetricsReportingInterval: FiniteDuration = 10.seconds

implicit val metricReporterReader: ConfigReader[MetricsReporter] = {
ConfigReader.fromString[MetricsReporter](ConvertHelpers.catchReadError { s =>
MetricsReporter.parseMetricsReporter(s.toLowerCase())
})
}

implicit val histogramDefinitionReader: ConfigReader[HistogramDefinition] =
deriveReader[HistogramDefinition]

implicit val metricsConfigReader: ConfigReader[MetricsConfig] =
ConfigReader.forProduct3[MetricsConfig, MetricsReporter, FiniteDuration, Option[
Seq[HistogramDefinition]
]](
"reporter",
"reporting-interval",
"histograms",
) { (reporter, reportingInterval, optionalHistograms) =>
MetricsConfig(reporter, reportingInterval, optionalHistograms.getOrElse(Seq.empty))
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit c938ab6

Please sign in to comment.