Skip to content

Conversation

@AndrewDryga
Copy link
Member

This PR is WIP on improving traceability and monitoring features of PR.

@@ -0,0 +1,17 @@
defmodule Annon.Monitoring.TraceCollector do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modules should have a @moduledoc tag.

conn
|> Conn.register_before_send(&write_metrics(&1, api))
|> Conn.register_before_send(&assign_latencies(&1, request_start_time))
|> Conn.register_before_send(&track_latencies(&1, request_id, request_start_time, collector_opts))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a function call when a pipeline is only one function long

@@ -0,0 +1,5 @@
defmodule Annon.Monitoring.Trace.BinaryAnnotation do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modules should have a @moduledoc tag.

@@ -0,0 +1,5 @@
defmodule Annon.Monitoring.Trace.Annotation do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modules should have a @moduledoc tag.

enabled?: {:system, :boolean, "METRICS_COLLECTOR_ENABLED", true},
send_tags: {:system, :boolean, "METRICS_COLLECTOR_SEND_TAGS", true},
host: {:system, :string, "METRICS_COLLECTOR_HOST", "localhost"},
port: {:system, :number, "METRICS_COLLECTOR_PORT", 32768},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Large numbers should be written with underscores: 32_768


def start_span(%Conn{} = conn, opts \\ []) do
request_id = get_request_id(conn, Ecto.UUID.generate())
timestamp = System.monotonic_time() |> System.convert_time_unit(:native, :microseconds)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a function call when a pipeline is only one function long

@@ -0,0 +1,63 @@
defmodule Annon.Monitoring.Trace do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modules should have a @moduledoc tag.

@AndrewDryga
Copy link
Member Author

Ebert has finished reviewing this Pull Request and has found:

  • 27 possible new issues (including those that may have been commented here).
  • 8 fixed issues! 🎉

But beware that this branch is 134 commits behind the Nebo15:master branch, and a review of an up to date branch would produce more accurate results.

You can see more details about this review at https://ebertapp.io/github/Nebo15/annon.api/pulls/249.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants