Skip to content

Commit

Permalink
update exporter readme and default ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan Sloughter committed Jan 3, 2022
1 parent 956ffea commit e16ffd3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
21 changes: 17 additions & 4 deletions apps/opentelemetry_exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,27 @@ config :opentelemetry, :processors,
- `otlp_endpoint`: The URL to send traces and metrics to, for traces the path `v1/traces` is appended to the path in the URL.
- `otlp_traces_endpoint`: URL to send only traces to. This takes precedence for exporting traces and the path of the URL is kept as is, no suffix is appended.
- `otlp_headers`: List of additional headers (`[{unicode:chardata(), unicode:chardata()}]`) to add to export requests.
- `otlp_traces_headers`: Additional headers (`[{unicode:chardata(), unicode:chardata()}]`) to add to only trace export requests.

- `otlp_traces_headers`: Additional headers (`[{unicode:chardata(),
unicode:chardata()}]`) to add to only trace export requests.
- `otlp_protocol`: The transport protocol, supported values: `grpc` and `http_protobuf`. Defaults to `http_protobuf`.
- `otlp_traces_protocol`: The transport protocol to use for exporting traces, supported values: `grpc` and `http_protobuf`. Defaults to `http_protobuf`.
- `otlp_compression`: Compression type to use, supported values: `gzip`. Defaults to no compression.
- `otlp_traces_compression`: Compression type to use for exporting traces, supported values: `gzip`. Defaults to no compression.

``` erlang
{opentelemetry_exporter,
[{otlp_endpoint, "https://api.honeycomb.io:443"},
[{otlp_protocol, grpc},
{otlp_compression, gzip},
{otlp_endpoint, "https://api.honeycomb.io:443"},
{otlp_headers, [{"x-honeycomb-dataset", "experiments"}]}]}
```

An Elixir release uses `releases.exs`:

``` elixir
config :opentelemetry_exporter,
otlp_protocol: :grpc,
otlp_compression: :gzip,
otlp_endpoint: "https://api.honeycomb.io:443",
otlp_headers: [{"x-honeycomb-dataset", "experiments"}]
```
Expand All @@ -87,11 +95,16 @@ for more information on securing HTTP requests in Erlang.
- `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`: URL to send only traces to. This takes precedence for exporting traces and the path of the URL is kept as is, no suffix is appended.
- `OTEL_EXPORTER_OTLP_HEADERS`: List of additional headers to add to export requests.
- `OTEL_EXPORTER_OTLP_TRACES_HEADERS`: Additional headers to add to only trace export requests.
- `OTEL_EXPORTER_OTLP_PROTOCOL`: The transport protocol to use, supported values: `grpc` and `http_protobuf`. Defaults to `http_protobuf`
- `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`: The transport protocol to use for exporting traces, supported values: `grpc` and `http_protobuf`. Defaults to `http_protobuf`.
- `OTEL_EXPORTER_OTLP_COMPRESSION`: Compression to use, supported value: gzip. Defaults to no compression.
- `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION`: Compression to use when exporting traces, supported value: gzip. Defaults to no compression.

Example usage of setting the environment variables:
```
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://api.honeycomb.io:443
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
OTEL_EXPORTER_OTLP_TRACES_COMPRESSION=gzip
OTEL_EXPORTER_OTLP_TRACES_HEADERS=x-honeycomb-team=<HONEYCOMB API TOKEN>,x-honeycomb-dataset=experiments
```

Expand Down
6 changes: 3 additions & 3 deletions apps/opentelemetry_exporter/src/opentelemetry_exporter.erl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@

-define(DEFAULT_ENDPOINTS, [#{host => "localhost",
path => [],
port => 4317,
scheme => "https"}]).
-define(DEFAULT_PORT, 4317).
port => 4318,
scheme => "http"}]).
-define(DEFAULT_PORT, 4318).
-define(DEFAULT_TRACES_PATH, "v1/traces").

-type headers() :: [{unicode:chardata(), unicode:chardata()}].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ configuration(_Config) ->
?assertMatch([#{scheme := "https", host := "localhost", port := 443, path := "/used/path"}],
opentelemetry_exporter:endpoints(<<"https://localhost:443/used/path">>, [])),

?assertMatch([#{scheme := "http", host := "localhost", port := 4317, path := []}],
?assertMatch([#{scheme := "http", host := "localhost", port := 4318, path := []}],
opentelemetry_exporter:endpoints("http://localhost", [])),

?assertMatch([], opentelemetry_exporter:endpoints("://badendpoint", [])),
Expand Down Expand Up @@ -243,7 +243,7 @@ verify_export(Config) ->
grpc ->
4317;
http_protobuf ->
55681
4318
end,
{ok, State} = opentelemetry_exporter:init(#{protocol => Protocol,
compression => Compression,
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 @@ -5,7 +5,7 @@ receivers:
grpc:
endpoint: "0.0.0.0:4317"
http:
endpoint: "0.0.0.0:55681"
endpoint: "0.0.0.0:4318"
processors:
batch:
send_batch_size: 1024
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ services:
command: ["--config=/conf/otel-collector-config.yaml"]
privileged: true
ports:
- 55681:55681
- 4317:4317
- 4318:4318
volumes:
- ./config/otel-collector-config.yaml:/conf/otel-collector-config.yaml
links:
Expand Down

0 comments on commit e16ffd3

Please sign in to comment.