-
Notifications
You must be signed in to change notification settings - Fork 117
Add gzip compression option for exporter #306
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
Add gzip compression option for exporter #306
Conversation
Codecov Report
@@ Coverage Diff @@
## main #306 +/- ##
==========================================
+ Coverage 38.29% 38.41% +0.12%
==========================================
Files 54 54
Lines 3562 3569 +7
==========================================
+ Hits 1364 1371 +7
Misses 2198 2198
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
For passing I'm thinking is either here: init(Opts) ->
%% ...
Compression = maps:get(compression, Opts1, undefined),
case maps:get(protocol, Opts1, http_protobuf) of
grpc ->
%% Pass in here?
ChannelOpts = maps:get(channel_opts, Opts1, #{}),
case grpcbox_channel:start_link(?MODULE, grpcbox_endpoints(Endpoints), ChannelOpts) of or here: export(Tab, Resource, #state{protocol=grpc,
grpc_metadata=Metadata,
channel_pid=_ChannelPid}) ->
%% ...
%% Pass in along side `#{channel => ?MODULE}`?
case opentelemetry_trace_service:export(Ctx, ExportRequest, #{channel => ?MODULE}) of Would be great if anyone can point me to the right direction here |
@tsloughter I'm trying to add the test for Do you have any idea what might caused this? Here's my diff: diff --git a/apps/opentelemetry_exporter/src/opentelemetry_exporter.erl b/apps/opentelemetry_exporter/src/opentelemetry_exporter.erl
index 79c89a9..59651e9 100644
--- a/apps/opentelemetry_exporter/src/opentelemetry_exporter.erl
+++ b/apps/opentelemetry_exporter/src/opentelemetry_exporter.erl
@@ -180,7 +180,11 @@ export(Tab, Resource, #state{protocol=grpc,
channel_pid=_ChannelPid}) ->
ExportRequest = tab_to_proto(Tab, Resource),
Ctx = grpcbox_metadata:append_to_outgoing_ctx(ctx:new(), Metadata),
- case opentelemetry_trace_service:export(Ctx, ExportRequest, #{channel => ?MODULE}) of
+ Result = opentelemetry_trace_service:export(Ctx, ExportRequest, #{channel
+ =>
+ ?MODULE}),
+ ct:print("~p~n", [Result]),
+ case Result of
{ok, _Response, _ResponseMetadata} ->
ok;
{error, {Status, Message}, _} ->
diff --git a/apps/opentelemetry_exporter/test/opentelemetry_exporter_SUITE.erl b/apps/opentelemetry_exporter/test/opentelemetry_exporter_SUITE.erl
index d2f73ac..e8afaff 100644
--- a/apps/opentelemetry_exporter/test/opentelemetry_exporter_SUITE.erl
+++ b/apps/opentelemetry_exporter/test/opentelemetry_exporter_SUITE.erl
@@ -9,12 +9,12 @@
-include_lib("opentelemetry/include/otel_span.hrl").
all() ->
- [{group, functional}, {group, http_protobuf}, {group,
- http_protobuf_gzip}, {group, grpc}].
+ [{group, functional}, {group, http_protobuf}, {group, http_protobuf_gzip}, {group, grpc}, {group, grpc_gzip}].
groups() ->
[{functional, [], [configuration, span_round_trip, ets_instrumentation_info]},
{grpc, [], [verify_export]},
+ {grpc_gzip, [], [verify_export]},
{http_protobuf, [], [verify_export]},
{http_protobuf_gzip, [], [verify_export]}].
@@ -31,6 +31,9 @@ init_per_group(Group, Config) when Group =:= grpc ;
init_per_group(http_protobuf_gzip, Config) ->
application:ensure_all_started(opentelemetry_exporter),
[{protocol, http_protobuf}, {compression, gzip} | Config];
+init_per_group(grpc_gzip, Config) ->
+ application:ensure_all_started(opentelemetry_exporter),
+ [{protocol, grpc}, {compression, gzip} | Config];
init_per_group(_, _) ->
application:load(opentelemetry_exporter),
ok. Output:
|
CI test failed due to collector:
|
@kw7oe yea, I got that too and am not able to reproduce locally so haven't figured out how to debug it :( |
This is referring to the CI/CD fail right? I think is a recent issues: open-telemetry/opentelemetry-collector-contrib#6238 I am able to replicate it using a different machine: I guess our local machine is cached or something so we can't replicate it Updates: After a few testing, the latest |
d4c108e
to
f5d41e7
Compare
f5d41e7
to
62af6cc
Compare
Address #123. WIP, just PR to get early feedback.
Todo: