wso2 / wso2/api-platform

[Bug]: Healthcheck API calls cannot be excluded from API Platform logs

Open
#3,486 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Aspect/Logging Severity/Minor Type/Bug
Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Please select the area the issue is related to

Gateway

Please select the aspect the issue is related to

Aspect/Logging (Log formats, instrumentation, improvements)

Description

Description

Health-check requests(/_gateway-health/ready and /_gateway-health/healthy) continue to appear in the following log outputs:

  1. Router/access logs ([rtr] output) – Envoy's stdout access logs do not have path-based filter. The requests are logged whenever router.access_logs.enabled = true, regardless of the ignore_path_prefixes configuration.

  2. Datalog/traffic logging output – These health-check requests to be excluded from datalog/traffic logging.

Expected Behaviour

Health-check requests under /_gateway-health should be excluded from:

  • Router/access logs ([rtr] stdout access logs).
  • Datalog/traffic logging output.

Proposed Fix

  1. Router/access logs ([rtr])
    Attach the same path-based access-log filter already used for the traffic-logging/analytics sink (collector.ignore_path_prefixes + the hardcoded /_gateway-health suppression) to the stdout access log sink as well. Currently that filter is only wired to the gRPC ALS sink, the file/stdout sink is created with no filter at all. Reusing the existing filter-builder for both sinks keeps them consistent with a small, self-contained change.

  2. Datalog/traffic logging (tracing spans)
    Health-check requests currently still generate OpenTelemetry trace spans that get exported to the tracing backend, since span sampling is a separate mechanism (RandomSampling, no path-based exclusion) from the access-log filters above. Add a route-level tracing override on the health-check routes that forces sampling to 0% for those routes specifically, so no span is ever created for them, independent of the global tracing sampling rate.

Steps to Reproduce
  1. Enable router.access_logs.enabled = true.
  2. Configure the relevant traffic logging/datalog settings.
  3. Start the API Platform Gateway.
  4. Invoke:
    • /_gateway-health/ready
    • /_gateway-health/healthy
  5. Observe that the requests are logged in the router stdout stream and datalog/traffic logging output.
Severity Level of the Issue

Severity/Minor (Non-critical functionality. Can be fixed in future releases)

Environment Details (with versions)

1.2.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing collector.ignore_path_prefixes filter-builder, the stdout access-log sink, and the /_gateway-health/ready and /_gateway-health/healthy route definitions. Inspect how tracing sampling is configured, then verify that both health-check paths are absent from router, traffic, and tracing outputs while other requests remain logged.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.