Cut fragments ctx out of audit logs (#19)

They provide too much redundant information at no tangible benefit.

Also stop adding woody metadata to audit log events.
This commit is contained in:
Andrew Mayorov 2021-02-08 11:12:39 +03:00 committed by GitHub
parent 6a7ca8f2e9
commit 2e575b0654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

2
Jenkinsfile vendored
View File

@ -18,6 +18,6 @@ build('bouncer', 'docker-host', finalHook) {
pipeErlangService = load("${env.JENKINS_LIB}/pipeErlangService.groovy")
}
pipeErlangService.runPipe(true, true)
pipeErlangService.runPipe(true, false)
}

View File

@ -264,9 +264,10 @@ encode_context(Context = #{}) ->
Context.
encode_fragments(Fragments = #{}) ->
% TODO
% See above.
Fragments.
maps:map(fun encode_fragment/2, Fragments).
encode_fragment(_ID, Fragment) ->
maps:with([type, metadata], Fragment).
extract_woody_ctx(WoodyCtx = #{rpc_id := RpcID}, Acc) ->
extract_woody_meta(WoodyCtx, extract_woody_rpc_id(RpcID, Acc));
@ -276,7 +277,13 @@ extract_woody_ctx(undefined, Acc) ->
extract_woody_rpc_id(RpcID = #{span_id := _, trace_id := _, parent_id := _}, Acc) ->
maps:merge(Acc, RpcID).
extract_woody_meta(#{meta := Meta}, Acc) when map_size(Meta) > 0 ->
Acc#{woody => #{metadata => Meta}};
%% TODO
%% This currently duplicates scoper-related metadata in every audit log
%% message. However, scoper is not a must, so we should probably allow
%% to turn this thing on and off through options.
%%
%% extract_woody_meta(#{meta := Meta}, Acc) when map_size(Meta) > 0 ->
%% Acc#{woody => #{metadata => Meta}};
%% Acc;
extract_woody_meta(#{}, Acc) ->
Acc.