From d7160de593324f1d446cc88506e0f33a6e97403d Mon Sep 17 00:00:00 2001 From: Nikita Volodin Date: Mon, 29 Apr 2024 16:09:46 -0400 Subject: [PATCH] wip: debugging prose filter and presidio --- presidio/server/server.py | 5 +++++ .../pkg/envoyfilter/internal/common/pii_analysis.go | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/presidio/server/server.py b/presidio/server/server.py index 847ae7c9..d9e7c3ed 100644 --- a/presidio/server/server.py +++ b/presidio/server/server.py @@ -142,6 +142,11 @@ def http_exception(e): @self.app.route("/batchanalyze", methods=["POST"]) def batch_analyze() -> Tuple[Response, int]: """Execute the batch analyzer function.""" + + print("Headers received as part of batchanalyze:") + for k, v in request.headers.items(): + print(f"{k}: {v}") + # Parse the request params try: request_obj = request.get_json() diff --git a/privacy-profile-composer/pkg/envoyfilter/internal/common/pii_analysis.go b/privacy-profile-composer/pkg/envoyfilter/internal/common/pii_analysis.go index db0d3623..25885495 100644 --- a/privacy-profile-composer/pkg/envoyfilter/internal/common/pii_analysis.go +++ b/privacy-profile-composer/pkg/envoyfilter/internal/common/pii_analysis.go @@ -48,6 +48,14 @@ func PiiAnalysis(ctx context.Context, presidioSvcURL string, svcName string, buf req.Header.Set("Content-Type", "application/json") GlobalOtelPropagator.Inject(ctx, propagation.HeaderCarrier(req.Header)) + fmt.Println("injected headers before sending to presidio:") + for k, v := range req.Header { + fmt.Printf(" %s:\n", k) + for _, vv := range v { + fmt.Printf(" %s\n", vv) + } + } + resp, err := http.DefaultClient.Do(req) if err != nil { return empty, fmt.Errorf("presidio post error: %w", err)