From 3fdff3cc14a16c8fb68de15041777c8e9cb2c627 Mon Sep 17 00:00:00 2001 From: Anthony Shull Date: Mon, 6 May 2024 13:00:44 -0500 Subject: [PATCH] rearrange config --- lib/dotcom/application.ex | 9 ++++++--- lib/mbta/api/stats.ex | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/dotcom/application.ex b/lib/dotcom/application.ex index 6bf0bb111d..734d55ab5b 100644 --- a/lib/dotcom/application.ex +++ b/lib/dotcom/application.ex @@ -34,7 +34,10 @@ defmodule Dotcom.Application do { TelemetryMetricsSplunk, [ - metrics: [Metrics.last_value("mbta_api.request")], + metrics: [ + Metrics.last_value("mbta_api.request.count"), + Metrics.last_value("mbta_api.request.avg") + ], token: telemetry_metrics_splunk_config[:token], url: telemetry_metrics_splunk_config[:url] ] @@ -45,8 +48,8 @@ defmodule Dotcom.Application do measurements: [ {MBTA.Api.Stats, :dispatch_stats, []} ], - period: :timer.seconds(60), - init_delay: :timer.seconds(15) + period: :timer.seconds(5), + init_delay: :timer.seconds(5) } ] ++ if Application.get_env(:dotcom, :env) != :test do diff --git a/lib/mbta/api/stats.ex b/lib/mbta/api/stats.ex index 240cf5f567..008e8ae90c 100644 --- a/lib/mbta/api/stats.ex +++ b/lib/mbta/api/stats.ex @@ -57,7 +57,7 @@ defmodule MBTA.Api.Stats do |> Kernel.div(count) |> System.convert_time_unit(:native, :millisecond) - :telemetry.execute([:mbta_api], %{request: %{count: count, avg: avg}}, %{ + :telemetry.execute([:mbta_api, :request], %{count: count, avg: avg}, %{ path: path, status: status })