Skip to content

Commit

Permalink
rearrange config
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull committed May 6, 2024
1 parent 7910382 commit 3fdff3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/dotcom/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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]
]
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/mbta/api/stats.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down

0 comments on commit 3fdff3c

Please sign in to comment.