changed
CHANGELOG.md
|
@@ -1,5 1,11 @@
|
1
1
|
## CHANGELOG
|
2
2
|
|
3
|
### `v1.5.0`
|
4
|
|
5
|
* More flexible datastore metric reporting in prep for `Ecto` instrumentation. [#76](https://github.com/newrelic/elixir_agent/pull/76)
|
6
|
|
7
|
-------
|
8
|
|
3
9
|
### `v1.4.0`
|
4
10
|
|
5
11
|
* Support nested Function Tracers in Transaction Traces and Distributed Tracing. [#58](https://github.com/newrelic/elixir_agent/pull/58)
|
changed
README.md
|
@@ -2,7 2,6 @@
|
2
2
|
|
3
3
|
[![Hex.pm Version](https://img.shields.io/hexpm/v/new_relic_agent.svg)](https://hex.pm/packages/new_relic_agent)
|
4
4
|
[![Build Status](https://travis-ci.org/newrelic/elixir_agent.svg?branch=master)](https://travis-ci.org/newrelic/elixir_agent)
|
5
|
- [![License](https://img.shields.io/badge/license-Apache 2-blue.svg)](https://github.com/newrelic/elixir_agent/blob/master/LICENSE)
|
6
5
|
|
7
6
|
The Open-Source Elixir Agent allows you to monitor your `Elixir` applications with New Relic. It helps you track transactions, distributed traces and other parts of your application's behavior and provides an overview of underlying [BEAM activity](https://github.com/newrelic/elixir_agent/wiki/BEAM-stats-page).
|
8
7
|
|
|
@@ -56,8 55,8 @@ Out of the box, we will report Error Traces & some general BEAM VM stats. For fu
|
56
55
|
There are a few adapters which leverage this agent to provide library / framework specific instrumentation:
|
57
56
|
|
58
57
|
* `Phoenix` https://github.com/binaryseed/new_relic_phoenix
|
58
|
* `Absinthe` https://github.com/binaryseed/new_relic_absinthe
|
59
59
|
* `Ecto` (coming soon) https://github.com/binaryseed/new_relic_ecto
|
60
|
- * `Absinthe` (coming soon) https://github.com/binaryseed/new_relic_absinthe
|
61
60
|
|
62
61
|
#### Plug
|
changed
VERSION
|
@@ -1 1 @@
|
1
|
- 1.4.0
|
1
|
1.5.0
|
changed
hex_metadata.config
|
@@ -87,4 87,4 @@
|
87
87
|
{<<"optional">>,false},
|
88
88
|
{<<"repository">>,<<"hexpm">>},
|
89
89
|
{<<"requirement">>,<<"~> 1.0">>}]]}.
|
90
|
- {<<"version">>,<<"1.4.0">>}.
|
90
|
{<<"version">>,<<"1.5.0">>}.
|
changed
lib/new_relic/harvest/collector/metric_data.ex
|
@@ -56,10 56,10 @@ defmodule NewRelic.Harvest.Collector.MetricData do
|
56
56
|
}
|
57
57
|
]
|
58
58
|
|
59
|
- def transform({:datastore, name}, duration_s: duration_s),
|
59
|
def transform({:datastore, datastore, table, operation}, duration_s: duration_s),
|
60
60
|
do: [
|
61
61
|
%Metric{
|
62
|
- name: join(["Datastore/statement/Postgres", name]),
|
62
|
name: join(["Datastore/statement", datastore, table, operation]),
|
63
63
|
call_count: 1,
|
64
64
|
total_call_time: duration_s,
|
65
65
|
total_exclusive_time: duration_s,
|
|
@@ -67,7 67,15 @@ defmodule NewRelic.Harvest.Collector.MetricData do
|
67
67
|
max_call_time: duration_s
|
68
68
|
},
|
69
69
|
%Metric{
|
70
|
- name: "Datastore/Postgres/all",
|
70
|
name: join(["Datastore/operation", datastore, operation]),
|
71
|
call_count: 1,
|
72
|
total_call_time: duration_s,
|
73
|
total_exclusive_time: duration_s,
|
74
|
min_call_time: duration_s,
|
75
|
max_call_time: duration_s
|
76
|
},
|
77
|
%Metric{
|
78
|
name: join(["Datastore", datastore, "all"]),
|
71
79
|
call_count: 1,
|
72
80
|
total_call_time: duration_s,
|
73
81
|
total_exclusive_time: duration_s,
|
|
@@ -147,6 155,7 @@ defmodule NewRelic.Harvest.Collector.MetricData do
|
147
155
|
defp join(segments) when is_list(segments) do
|
148
156
|
segments
|
149
157
|
|> Enum.filter(& &1)
|
158
|
|> Enum.map(&to_string/1)
|
150
159
|
|> Enum.map(&String.replace_leading(&1, "/", ""))
|
151
160
|
|> Enum.map(&String.replace_trailing(&1, "/", ""))
|
152
161
|
|> Enum.join("/")
|
changed
lib/new_relic/tracer/report.ex
|
@@ -45,7 45,6 @@ defmodule NewRelic.Tracer.Report do
|
45
45
|
)
|
46
46
|
|
47
47
|
NewRelic.incr_attributes(
|
48
|
- timestamp_ms: System.convert_time_unit(start_time, :native, :milliseconds),
|
49
48
|
datastore_call_count: 1,
|
50
49
|
datastore_duration_ms: duration_ms,
|
51
50
|
"datastore.#{function_name({module, function}, name)}.call_count": 1,
|
|
@@ -62,7 61,7 @@ defmodule NewRelic.Tracer.Report do
|
62
61
|
)
|
63
62
|
|
64
63
|
NewRelic.report_metric(
|
65
|
- {:datastore, "/#{function_name({module, function}, name)}"},
|
64
|
{:datastore, "Database", inspect(module), function_name(function, name)},
|
66
65
|
duration_s: duration_s
|
67
66
|
)
|
68
67
|
end
|
|
@@ -171,4 170,6 @@ defmodule NewRelic.Tracer.Report do
|
171
170
|
defp function_name({m, f}, i), do: "#{inspect(m)}.#{f}:#{i}"
|
172
171
|
defp function_name({m, f, a}, f), do: "#{inspect(m)}.#{f}/#{a}"
|
173
172
|
defp function_name({m, f, a}, i), do: "#{inspect(m)}.#{f}:#{i}/#{a}"
|
173
|
defp function_name(f, f), do: "#{f}"
|
174
|
defp function_name(_f, i), do: "#{i}"
|
174
175
|
end
|