Skip to content
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

[Internal]: Kubernetes HTTP API request/response logging #2193

Closed
manusa opened this issue Jun 5, 2023 · 0 comments
Closed

[Internal]: Kubernetes HTTP API request/response logging #2193

manusa opened this issue Jun 5, 2023 · 0 comments
Milestone

Comments

@manusa
Copy link
Member

manusa commented Jun 5, 2023

Description

This issue is an internal executive summary of how the Eclipse JKube has improved the Kubernetes HTTP API request/response logging by leveraging changes in the Fabric8 Kubernetes Client and in this project itself.

Background

Until Eclipse JKube version 1.8.x and Fabric8 Kubernetes Client version 5.x, the ability to log HTTP conversations between JKube and the Kubernetes API was delegated and provided by OkHttp HttpLoggingInterceptor by setting its log level to trace.

In version 6.0.0, Fabric8 Kubernetes Client introduced the HttpClient abstractions which allowed the usage of other HTTP clients besides OkHttp. However, this meant that HTTP request/response logging would only work for OkHttp since this wasn't a feature that was directly provided by the Fabric8 Kubernetes Client.

There were also some problems related to logging reported #1950, #2000, and others, that were directly related to the way OkHttp was handling the traces.

Solution

The problem has been solved by multiple changes, both fixes and improvements that have been provided by the community and the core maintainer over a long period of time. These changes are incremental and their sum has allowed us to easily overcome this issue that otherwise would have been extremely hard to fix.

The majority of these changes have been made in the Fabric8 Kubernetes Client, the following list contains a summary:

  • Abstraction of the HttpClient.
  • Development of multiple HttpClient implementations.
  • Provision of Fabric8-specific HTTP interceptor interfaces compatible with all of the HttpClient implementations.
  • Development of a Fabric8-specific HTTP Logging interceptor:
    • Compatible with all HTTP clients.
    • Easy to set up.
    • Clear/pretty log messages.
    • Easy to maintain and open for future improvements.
  • Bumping the Kubernetes Client dependency in JKube - automatically takes advantage of the Fabric8 Kubernetes Client improvements with respect to HTTP logging.
@manusa manusa added this to the 1.13.0 milestone Jun 5, 2023
@manusa manusa closed this as completed Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant