Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Migrate reporters to gen_event #136

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*]
indent_style = space

[*.erl]
indent_size = 4

[*.yml]
indent_size = 2
18 changes: 6 additions & 12 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,21 +178,16 @@ $ rebar3 protobuf compile


<table width="100%" border="0" summary="list of modules">
<tr><td><a href="oc_internal_timer.md" class="module">oc_internal_timer</a></td></tr>
<tr><td><a href="oc_producer.md" class="module">oc_producer</a></td></tr>
<tr><td><a href="oc_producer_registry.md" class="module">oc_producer_registry</a></td></tr>
<tr><td><a href="oc_reporter.md" class="module">oc_reporter</a></td></tr>
<tr><td><a href="oc_reporter_noop.md" class="module">oc_reporter_noop</a></td></tr>
<tr><td><a href="oc_reporter_sequential.md" class="module">oc_reporter_sequential</a></td></tr>
<tr><td><a href="oc_reporter_stdout.md" class="module">oc_reporter_stdout</a></td></tr>
<tr><td><a href="oc_reporter_zipkin.md" class="module">oc_reporter_zipkin</a></td></tr>
<tr><td><a href="oc_sampler.md" class="module">oc_sampler</a></td></tr>
<tr><td><a href="oc_sampler_always.md" class="module">oc_sampler_always</a></td></tr>
<tr><td><a href="oc_sampler_impl.md" class="module">oc_sampler_impl</a></td></tr>
<tr><td><a href="oc_sampler_never.md" class="module">oc_sampler_never</a></td></tr>
<tr><td><a href="oc_sampler_period_or_count.md" class="module">oc_sampler_period_or_count</a></td></tr>
<tr><td><a href="oc_sampler_probability.md" class="module">oc_sampler_probability</a></td></tr>
<tr><td><a href="oc_self_producer.md" class="module">oc_self_producer</a></td></tr>
<tr><td><a href="oc_server.md" class="module">oc_server</a></td></tr>
<tr><td><a href="oc_span.md" class="module">oc_span</a></td></tr>
<tr><td><a href="oc_span_ctx_binary.md" class="module">oc_span_ctx_binary</a></td></tr>
<tr><td><a href="oc_span_ctx_header.md" class="module">oc_span_ctx_header</a></td></tr>
Expand All @@ -204,20 +199,19 @@ $ rebar3 protobuf compile
<tr><td><a href="oc_stat_aggregation_distribution.md" class="module">oc_stat_aggregation_distribution</a></td></tr>
<tr><td><a href="oc_stat_aggregation_latest.md" class="module">oc_stat_aggregation_latest</a></td></tr>
<tr><td><a href="oc_stat_aggregation_sum.md" class="module">oc_stat_aggregation_sum</a></td></tr>
<tr><td><a href="oc_stat_config.md" class="module">oc_stat_config</a></td></tr>
<tr><td><a href="oc_stat_exporter.md" class="module">oc_stat_exporter</a></td></tr>
<tr><td><a href="oc_stat_exporter_stdout.md" class="module">oc_stat_exporter_stdout</a></td></tr>
<tr><td><a href="oc_stat_measure.md" class="module">oc_stat_measure</a></td></tr>
<tr><td><a href="oc_stat_reporter.md" class="module">oc_stat_reporter</a></td></tr>
<tr><td><a href="oc_stat_stdout_handler.md" class="module">oc_stat_stdout_handler</a></td></tr>
<tr><td><a href="oc_stat_transform.md" class="module">oc_stat_transform</a></td></tr>
<tr><td><a href="oc_stat_unit.md" class="module">oc_stat_unit</a></td></tr>
<tr><td><a href="oc_stat_view.md" class="module">oc_stat_view</a></td></tr>
<tr><td><a href="oc_std_encoder.md" class="module">oc_std_encoder</a></td></tr>
<tr><td><a href="oc_tag_ctx_binary.md" class="module">oc_tag_ctx_binary</a></td></tr>
<tr><td><a href="oc_tag_ctx_header.md" class="module">oc_tag_ctx_header</a></td></tr>
<tr><td><a href="oc_tags.md" class="module">oc_tags</a></td></tr>
<tr><td><a href="oc_trace.md" class="module">oc_trace</a></td></tr>
<tr><td><a href="oc_trace_reporter.md" class="module">oc_trace_reporter</a></td></tr>
<tr><td><a href="oc_trace_stdout_handler.md" class="module">oc_trace_stdout_handler</a></td></tr>
<tr><td><a href="ocp.md" class="module">ocp</a></td></tr>
<tr><td><a href="opencensus.md" class="module">opencensus</a></td></tr>
<tr><td><a href="opencensus_app.md" class="module">opencensus_app</a></td></tr>
<tr><td><a href="opencensus_sup.md" class="module">opencensus_sup</a></td></tr></table>
<tr><td><a href="opencensus_app.md" class="module">opencensus_app</a></td></tr></table>

22 changes: 11 additions & 11 deletions doc/build.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#!/bin/bash

cd $(dirname $(realpath $0))
cd "$(dirname $(realpath $0))"

cp ../README.md index.md

make clean
make

# fix internal doc links
sed -i 's/https:\/\/github\.com\/doc\/\(.*\)\.md/\1.html/g' *.html
sed -i 's/\"\([a-zA-Z_-]*\)\.md\([a-zA-Z_-#]*\)\"/\"\1.html\2\"/g' *.html
sed -i 's/\"doc\/\([a-zA-Z_-]*\)\.md\"/\"\1.html\"/g' *.html
sed -i 's/\"\([a-zA-Z_-]*\)\.md\"/\"\1.html\"/g' *.html
sed -i 's/<br \/>//g' *.html
sed -i '' 's/https:\/\/github\.com\/doc\/\(.*\)\.md/\1.html/g' *.html
sed -i '' 's/\"\([a-zA-Z_-]*\)\.md\([a-zA-Z_#-]*\)\"/\"\1.html\2\"/g' *.html
sed -i '' 's/\"doc\/\([a-zA-Z_-]*\)\.md\"/\"\1.html\"/g' *.html
sed -i '' 's/\"\([a-zA-Z_-]*\)\.md\"/\"\1.html\"/g' *.html
sed -i '' 's/<br \/>//g' *.html

# sed -i 's/\"\(.*\)\.md\"/\"\1.html\"/g' *.html
# sed -i 's/\"\(.*\)\.md#\(.*\)\"/\"\1.html#\2\"/g' *.html

# fix external doc links
sed -i 's/maps\.html\#/http:\/\/erlang.org\/doc\/man\/maps\.html#/g' *.html
sed -i 's/unicode\.html\#/http:\/\/erlang.org\/doc\/man\/unicode\.html#/g' *.html
sed -i 's/maps\.md\#/http:\/\/erlang.org\/doc\/man\/maps\.html#/g' *.html
sed -i 's/unicode\.md\#/http:\/\/erlang.org\/doc\/man\/unicode\.html#/g' *.html
sed -i '' 's/maps\.html\#/http:\/\/erlang.org\/doc\/man\/maps\.html#/g' *.html
sed -i '' 's/unicode\.html\#/http:\/\/erlang.org\/doc\/man\/unicode\.html#/g' *.html
sed -i '' 's/maps\.md\#/http:\/\/erlang.org\/doc\/man\/maps\.html#/g' *.html
sed -i '' 's/unicode\.md\#/http:\/\/erlang.org\/doc\/man\/unicode\.html#/g' *.html

# cleans up the indentation of code blocks
sed -i 's/ <a/<a/g' index.html
sed -i '' 's/ <a/<a/g' index.html
19 changes: 9 additions & 10 deletions doc/edoc-info
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
%% encoding: UTF-8
{application,opencensus}.
{modules,[oc_producer,oc_producer_registry,oc_reporter,oc_reporter_noop,
oc_reporter_sequential,oc_reporter_stdout,oc_reporter_zipkin,
oc_sampler,oc_sampler_always,oc_sampler_impl,oc_sampler_never,
{modules,[oc_internal_timer,oc_producer,oc_producer_registry,oc_sampler,
oc_sampler_always,oc_sampler_impl,oc_sampler_never,
oc_sampler_period_or_count,oc_sampler_probability,oc_self_producer,
oc_server,oc_span,oc_span_ctx_binary,oc_span_ctx_header,
oc_span_sweeper,oc_span_transform,oc_stat,oc_stat_aggregation,
oc_span,oc_span_ctx_binary,oc_span_ctx_header,oc_span_sweeper,
oc_span_transform,oc_stat,oc_stat_aggregation,
oc_stat_aggregation_count,oc_stat_aggregation_distribution,
oc_stat_aggregation_latest,oc_stat_aggregation_sum,oc_stat_config,
oc_stat_exporter,oc_stat_exporter_stdout,oc_stat_measure,
oc_stat_transform,oc_stat_unit,oc_stat_view,oc_std_encoder,
oc_tag_ctx_binary,oc_tag_ctx_header,oc_tags,oc_trace,ocp,opencensus,
opencensus_app,opencensus_sup]}.
oc_stat_aggregation_latest,oc_stat_aggregation_sum,oc_stat_measure,
oc_stat_reporter,oc_stat_stdout_handler,oc_stat_transform,
oc_stat_unit,oc_stat_view,oc_tag_ctx_binary,oc_tag_ctx_header,
oc_tags,oc_trace,oc_trace_reporter,oc_trace_stdout_handler,ocp,
opencensus,opencensus_app]}.
15 changes: 4 additions & 11 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ Headers = [{oc_span_ctx_header:field_name(), EncodedSpanCtx}],

#### <a name="Reporters">Reporters</a> ####

[Google Cloud Trace](https://github.com/tsloughter/oc_google_reporter): Support for v1 in master, v2 and grpc coming soon;
[Zipkin](https://github.com/opencensus-beam/opencensus_zipkin): Zipkin v2 reporter.

[Prometheus](https://github.com/deadtrickster/opencensus-erlang-prometheus): Exports spans as Prometheus metrics.
[Google Cloud Trace](https://github.com/opencensus-beam/oc_google_reporter): Support for v1 in master, v2 and grpc coming soon;

[Prometheus](https://github.com/opencensus-beam/prometheus): Exports spans as Prometheus metrics.

[DataDog][oc_datadog]: Export spans to DataDog APM

Expand Down Expand Up @@ -185,13 +187,4 @@ Running tests:
$ rebar3 ct
```

#### Updating OpenCensus standard protobuf encoder and decoder

Language independent interface types for Census are found in the `opencensus-proto` repo. The opencensus Erlang app provides functionality for converting from the apps internal representation to the standard protobuf interface. Below are the steps to update the Erlang module and header for encoding and decoding the protobufs:

```sh
$ git clone https://github.com/census-instrumentation/opencensus-proto priv/opencensus-proto
$ rebar3 protobuf compile
```

[oc_datadog]: https://github.com/hauleth/oc_datadog
50 changes: 50 additions & 0 deletions doc/oc_internal_timer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@


# Module oc_internal_timer #
* [Function Index](#index)
* [Function Details](#functions)

__This module defines the `oc_internal_timer` behaviour.__<br /> Required callback functions: `ping/0`.

<a name="index"></a>

## Function Index ##


<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td></td></tr><tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td></td></tr><tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td></td></tr><tr><td valign="top"><a href="#init-1">init/1</a></td><td></td></tr><tr><td valign="top"><a href="#start_link-2">start_link/2</a></td><td></td></tr></table>


<a name="functions"></a>

## Function Details ##

<a name="handle_call-3"></a>

### handle_call/3 ###

`handle_call(Msg, From, State) -> any()`

<a name="handle_cast-2"></a>

### handle_cast/2 ###

`handle_cast(Msg, State) -> any()`

<a name="handle_info-2"></a>

### handle_info/2 ###

`handle_info(X1, State) -> any()`

<a name="init-1"></a>

### init/1 ###

`init(X1) -> any()`

<a name="start_link-2"></a>

### start_link/2 ###

`start_link(Interval, Module) -> any()`

77 changes: 0 additions & 77 deletions doc/oc_reporter.md

This file was deleted.

35 changes: 0 additions & 35 deletions doc/oc_reporter_noop.md

This file was deleted.

74 changes: 0 additions & 74 deletions doc/oc_reporter_sequential.md

This file was deleted.

Loading