Skip to content

[exporter/clickhouse] Add client info for identifying exporter in system.query_log #37146

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

Merged
merged 27 commits into from
Feb 21, 2025

Conversation

SpencerTorres
Copy link
Member

@SpencerTorres SpencerTorres commented Jan 10, 2025

Description:
(reopen from #34915)

This change will include information about the collector version and OS/Arch for every INSERT. Users can then track the origin of these queries in system.query_log. For an official build this will look something like otelcol/v0.114.0.

This is implemented by setting client_info_product in the DSN. The underlying ClickHouse Go driver will then attach it upon connection. Users can already add their own version info in endpoint or connection_params, but this change will now safely set or append to that value with the binary's information.

Documentation:

  • Added notes to README for client_product_info

Testing:

  • Add/updated unit tests

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jan 25, 2025
@SpencerTorres
Copy link
Member Author

not stale 👉

@github-actions github-actions bot removed the Stale label Jan 26, 2025
@SpencerTorres
Copy link
Member Author

@dmitryax I have updated the code to use exporter.Settings.BuildInfo.Version. Note that this may not include the architecture/os like the original implementation, although I don't think it's necessary. By default the build version is latest which may be misleading if the user's build doesn't include a specific version number.

Overall the code is simpler though, let me know if anything else stands out. Thanks!

Copy link
Contributor

@atoulme atoulme left a comment

Choose a reason for hiding this comment

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

the changes look ok to me.

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 21, 2025
@dmitryax dmitryax merged commit 963b7c1 into open-telemetry:main Feb 21, 2025
163 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 21, 2025
@SpencerTorres SpencerTorres deleted the ch-otel-user-agent branch February 21, 2025 22:01
yiquanzhou added a commit to dash0hq/opentelemetry-collector-contrib that referenced this pull request Feb 24, 2025
* main: (55 commits)
  [chore] Update core dependencies (open-telemetry#38124)
  Add kafka topics observer implementation (open-telemetry#38060)
  [exporter/splunk_hec] Mute errors from draining the response body (open-telemetry#38118)
  [chore] [exporter/splunk_hec] Remove dead code (open-telemetry#38113)
  Add support for JUnit test results (open-telemetry#37941)
  [chore] amend changelog for prometheus receiver change (open-telemetry#38109)
  [chore] Fix dead links in issue-triaging.md (open-telemetry#38105)
  [chore] fix deprecation (open-telemetry#38107)
  [exporter/coralogix] Add new batch options to Coralogix exporter (open-telemetry#38082)
  [chore][exporter/datadog] fix integration test (open-telemetry#38091)
  [chore] Update otel to unblock contrib test in core repo (open-telemetry#38100)
  [chore] Bump go-version match to 1.23 (open-telemetry#38099)
  [exporter/elasticsearch] Add _metric_names_hash to avoid metric rejections (open-telemetry#37511)
  elasticsearchexporter: refactor encoding; drop metrics support from raw/none/bodymap mapping modes (open-telemetry#37928)
  [exporter/stefexporter] Fix incorrectly implemented STEF exporter zstd compression option (open-telemetry#38089)
  [exporter/clickhouse] Add client info for identifying exporter in `system.query_log` (open-telemetry#37146)
  [chore] Prepare release 0.120.1 (open-telemetry#38055)
  [extension/httpforwarder] Shutdown should wait server exit (open-telemetry#37735)
  receiver/prometheusremotewrite: Add two fields timestamp and value. (open-telemetry#37895)
  [reciver/sqlqueryreceiver] Add support for SapASE (sybase) (open-telemetry#37773)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants