Skip to content

Commit

Permalink
Merge branch 'main' into status-spec-compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
bryannaegele authored Jul 13, 2021
2 parents 7ba7c5c + 9110035 commit f4b7356
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 38 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docs_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update OpenTelemetry Website Docs
on:
# triggers only on a manual dispatch
workflow_dispatch:
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2.3.4
- name: make-pr
env:
API_TOKEN_GITHUB: ${{secrets.DOC_UPDATE_TOKEN}}
# Destination repo should always be 'open-telemetry/opentelemetry.io'
DESTINATION_REPO: open-telemetry/opentelemetry.io
# Destination path should be the absolute path to your language's friendly name in the docs tree (i.e, 'content/en/docs/java')
DESTINATION_PATH: content/en/docs/erlang
# Source path should be 'website_docs', all files and folders are copied from here to dest
SOURCE_PATH: website_docs
run: |
TARGET_DIR=$(mktemp -d)
export GITHUB_TOKEN=$API_TOKEN_GITHUB
git config --global user.name austinlparker
git config --global user.email austin@lightstep.com
git clone "https://$API_TOKEN_GITHUB@github.com/$DESTINATION_REPO.git" "$TARGET_DIR"
rsync -av --delete "$SOURCE_PATH/" "$TARGET_DIR/$DESTINATION_PATH/"
cd "$TARGET_DIR"
git checkout -b docs-$GITHUB_REPOSITORY-$GITHUB_SHA
git add .
git commit -m "Docs update from $GITHUB_REPOSITORY"
git push -u origin HEAD:docs-$GITHUB_REPOSITORY-$GITHUB_SHA
gh pr create -t "Docs Update from $GITHUB_REPOSITORY" -b "This is an automated pull request." -B main -H docs-$GITHUB_REPOSITORY-$GITHUB_SHA
echo "done"
64 changes: 42 additions & 22 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
- uses: erlef/setup-beam@v1
with:
otp-version: '23.1'
elixir-version: '1.11.1'
otp-version: '24.0.1'
elixir-version: '1.12.1'
- uses: actions/cache@v2
name: Cache
with:
Expand All @@ -33,19 +33,29 @@ jobs:
name: Test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) and ${{ matrix.os }}
strategy:
matrix:
otp_version: ['23.1', '22.3.4.2', '21.3.8.16']
elixir: ['1.11.1']
otp_version: ['24.0.2', '23.3.4.2', '22.3.4.20']
elixir_version: ['1.12.1', '1.11.4']
rebar3_version: ['3.16.1']
os: [ubuntu-18.04]
include:
- otp_version: '21.3.8.24'
elixir_version: '1.11.4'
rebar3_version: '3.15.2'
os: ubuntu-18.04
exclude:
- otp_version: '21.3.8.24'
elixir_version: '1.12.1'
env:
OTP_VERSION: ${{ matrix.otp_version }}
ELIXIR_VERSION: ${{ matrix.elixir }}
ELIXIR_VERSION: ${{ matrix.elixir_version }}
OTEL_TRACES_EXPORTER: "none"
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir }}
elixir-version: ${{ matrix.elixir_version }}
rebar3-version: ${{ matrix.rebar3_version }}
- name: Compile
run: rebar3 as test compile
- name: ExUnit
Expand All @@ -56,30 +66,40 @@ jobs:
name: Test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) and ${{ matrix.os }}
strategy:
matrix:
otp_version: ['23.1', '22.3.4.2', '21.3.8.16']
elixir: ['1.11.1']
otp_version: ['24.0.2', '23.3.4.2', '22.3.4.20']
elixir_version: ['1.12.1', '1.11.4']
rebar3_version: ['3.16.1']
os: [ubuntu-18.04]
include:
- otp_version: '21.3.8.24'
elixir_version: '1.11.4'
rebar3_version: '3.15.2'
os: ubuntu-18.04
exclude:
- otp_version: '21.3.8.24'
elixir_version: '1.12.1'
env:
OTP_VERSION: ${{ matrix.otp_version }}
ELIXIR_VERSION: ${{ matrix.elixir }}
ELIXIR_VERSION: ${{ matrix.elixir_version }}
defaults:
run:
working-directory: apps/opentelemetry_api/
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir }}
elixir-version: ${{ matrix.elixir_version }}
rebar3-version: ${{ matrix.rebar3_version }}
- uses: actions/cache@v2
name: Cache
with:
path: |
apps/opentelemetry_api/deps
apps/opentelemetry_api/_build
key: ${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir }}-v3-${{ hashFiles(format('{0}{1}', github.workspace, '/apps/opentelemetry_api/mix.lock')) }}
key: ${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-v3-${{ hashFiles(format('{0}{1}', github.workspace, '/apps/opentelemetry_api/mix.lock')) }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir }}-
${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-
- run: mix deps.get
name: Deps
- run: mix test --cover
Expand All @@ -96,30 +116,30 @@ jobs:
name: Dialyze on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) and ${{ matrix.os }}
strategy:
matrix:
otp_version: ['23.1']
elixir: ['1.11.1']
otp_version: ['24.0.2']
elixir_version: ['1.12.1']
os: [ubuntu-18.04]
env:
OTP_VERSION: ${{ matrix.otp_version }}
ELIXIR_VERSION: ${{ matrix.elixir }}
ELIXIR_VERSION: ${{ matrix.elixir_version }}
defaults:
run:
working-directory: apps/opentelemetry_api/
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir }}
elixir-version: ${{ matrix.elixir_version }}
- uses: actions/cache@v2
name: Cache
with:
path: |
apps/opentelemetry_api/deps
apps/opentelemetry_api/_build
key: ${{ runner.os }}-dialyzer-${{ matrix.otp_version }}-${{ matrix.elixir }}-v3-${{ hashFiles('apps/opentelemetry_api/mix.lock') }}
key: ${{ runner.os }}-dialyzer-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-v3-${{ hashFiles('apps/opentelemetry_api/mix.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir }}-
${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-
- run: mix deps.get
name: Deps
- run: mix dialyzer
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,24 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
otp_version: ['23.0.2', '22.3.4.2', '21.3.8.16']
otp_version: ['24.0.2', '23.3.4.2', '22.3.4.20']
rebar3_version: ['3.16.1']
os: [ubuntu-18.04]
include:
- otp_version: '21.3.8.24'
rebar3_version: '3.15.2'
os: ubuntu-18.04
env:
OTP_VERSION: ${{ matrix.otp_version }}
OTEL_TRACES_EXPORTER: "none"
steps:
- uses: actions/checkout@v2
- name: Run Collector
run: docker-compose up -d
- uses: erlef/setup-elixir@v1
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
rebar3-version: ${{ matrix.rebar3_version }}
elixir-version: '1.11.1'
- uses: actions/cache@v2
name: Cache
Expand Down Expand Up @@ -69,14 +75,19 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
otp_version: ['23.0.2', '22.3.4.2', '21.3.8.16']
otp_version: ['24.0.2', '23.3.4.2', '22.3.4.20']
rebar3_version: ['3.16.1']
os: [ubuntu-18.04]
include:
- otp_version: '21.3.8.24'
rebar3_version: '3.15.2'
os: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
elixir-version: '1.11.1'
rebar3-version: ${{ matrix.rebar3_version }}
- uses: actions/cache@v2
name: Cache
with:
Expand Down
1 change: 0 additions & 1 deletion apps/opentelemetry/src/otel_span_ets.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
update_name/2]).

-include_lib("opentelemetry_api/include/opentelemetry.hrl").
-include("otel_tracer.hrl").
-include("otel_span.hrl").
-include("otel_span_ets.hrl").

Expand Down
8 changes: 5 additions & 3 deletions apps/opentelemetry_api/src/opentelemetry.erl
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ set_default_tracer(Tracer) ->
set_tracer(Name, Tracer) ->
verify_and_set_term(Tracer, Name, otel_tracer).

-spec register_tracer(atom(), string()) -> boolean().
register_tracer(Name, Vsn) ->
otel_tracer_provider:register_tracer(Name, Vsn).
-spec register_tracer(atom(), string() | binary()) -> boolean().
register_tracer(Name, Vsn) when is_atom(Name) and is_binary(Vsn) ->
otel_tracer_provider:register_tracer(Name, Vsn);
register_tracer(Name, Vsn) when is_atom(Name) and is_list(Vsn) ->
otel_tracer_provider:register_tracer(Name, list_to_binary(Vsn)).

-spec register_application_tracer(atom()) -> boolean().
register_application_tracer(Name) ->
Expand Down
4 changes: 2 additions & 2 deletions apps/opentelemetry_api/src/otel_tracer_provider.erl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
-type cb_state() :: term().

-callback init(term()) -> {ok, cb_state()}.
-callback register_tracer(atom(), string(), cb_state()) -> boolean().
-callback register_tracer(atom(), binary(), cb_state()) -> boolean().
-callback resource(cb_state()) -> term() | undefined.

-record(state, {callback :: module(),
Expand All @@ -50,7 +50,7 @@ resource() ->
undefined
end.

-spec register_tracer(atom(), string()) -> boolean().
-spec register_tracer(atom(), binary()) -> boolean().
register_tracer(Name, Vsn) ->
try
gen_server:call(?MODULE, {register_tracer, Name, Vsn})
Expand Down
2 changes: 1 addition & 1 deletion apps/opentelemetry_exporter/rebar.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{erl_opts, [debug_info]}.
{deps, [grpcbox,
{deps, [{grpcbox, ">= 0.0.0"},
{opentelemetry, "~> 1.0.0-rc.1"},
{opentelemetry_api, "~> 1.0.0-rc.1"}]}.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ verify_export(Config) ->
Protocol = ?config(protocol, Config),
Port = case Protocol of
grpc ->
55680;
4317;
http_protobuf ->
55681
end,
Expand Down
2 changes: 1 addition & 1 deletion config/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ receivers:
otlp:
protocols:
grpc:
endpoint: "0.0.0.0:55680"
endpoint: "0.0.0.0:4317"
http:
endpoint: "0.0.0.0:55681"
processors:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: '3'
version: "3"
services:
otel:
image: otel/opentelemetry-collector-contrib-dev
command: ["--config=/conf/otel-collector-config.yaml"]
privileged: true
ports:
- 55681:55681
- 55680:55680
- 4317:4317
volumes:
- ./config/otel-collector-config.yaml:/conf/otel-collector-config.yaml
links:
Expand Down

0 comments on commit f4b7356

Please sign in to comment.