Skip to content

[rest] Unify the REST User-Agent format - #10308

Open
sundapeng wants to merge 1 commit into
apache:masterfrom
sundapeng:rest-user-agent
Open

sundapeng wants to merge 1 commit into
apache:masterfrom
sundapeng:rest-user-agent

Conversation

@sundapeng

@sundapeng sundapeng commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Purpose

REST catalog requests from Java carry httpclient's default User-Agent, Apache-HttpClient/5.5.1 (Java/<version>), so Paimon clients can't be told apart from other Java clients in the catalog server's request logs. An engine that wants to identify itself has to replace the whole value through header.User-Agent, which drops the Paimon version, and Hadoop PVFS does the same with a bare HadoopPVFS.

REST requests now carry Paimon's unified User-Agent format, <module>(<transport>[;<feature>...])[ <extended>], the one object storage requests adopt as well (#10306):

  • New catalog options user-agent.module, user-agent.features and user-agent.extended, shared with object storage requests, so an engine configures its identity once for both.
  • module Paimon/<version>, transport Apache-HttpClient/<version>. Both versions are written in at build time by the templating-maven-plugin, so no class loader lookup is involved.
  • A user-set header.User-Agent still replaces the whole value, so existing setups are unaffected.
  • Hadoop PVFS puts HadoopPVFS first in the features instead of replacing the User-Agent.

Examples:

Client and options User-Agent
REST catalog Paimon/2.2-SNAPSHOT(Apache-HttpClient/5.5.1)
user-agent.features=Flink, user-agent.extended=vvr Paimon/2.2-SNAPSHOT(Apache-HttpClient/5.5.1;Flink) vvr
header.User-Agent=starrocks/user starrocks/user
Hadoop PVFS with user-agent.features=Flink Paimon/2.2-SNAPSHOT(Apache-HttpClient/5.5.1;HadoopPVFS;Flink)

Related: #10306 (Java OSS), #10321 (Jindo FileIO), #10309 (Python REST), apache/paimon-rust#992 (Rust REST). This PR, #10306 and #10321 only share the templating-maven-plugin entry in the root pom.xml.

Tests

HttpClientUtilsTest, MockRESTCatalogTest and MockRestVirtualFileSystemTest cover the default, the new options, the header.User-Agent override and PVFS; ConfigOptionsDocsCompletenessITCase passed. Also checked on a live DLF REST catalog: its request log shows the configured features and extended part.

Documentation

catalog_configuration.html documents the three new options.

REST requests carried httpclient's default User-Agent, and Hadoop PVFS
replaced it with a bare HadoopPVFS. REST catalog requests now carry
Paimon's unified User-Agent format, module(transport;features) extended,
with Apache-HttpClient/<version> as the transport.

The new catalog options user-agent.module, user-agent.features and
user-agent.extended fill the other parts; object storage requests read
the same keys, so one setting covers both. The module defaults to
Paimon/<version>. A user-set header.User-Agent still replaces the whole
value, and PVFS adds HadoopPVFS as the first feature.

Both versions are written into BuildVersions at build time by the
templating-maven-plugin, so reading them needs no class loader lookup.

@Akash3121 Akash3121 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed the unified REST User-Agent implementation end to end. The generated version metadata, default and configured formatting, explicit header.User-Agent precedence, server-config merge behavior, and Hadoop PVFS feature propagation all look consistent. The focused formatter, REST request, and PVFS tests pass. No blocking issues found from my side.

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

Successfully merging this pull request may close these issues.

2 participants