Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenTracing #249

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

OpenTracing #249

wants to merge 9 commits into from

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.

1 participant