Skip to content

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

Closed
SpencerTorres wants to merge 18 commits into
open-telemetry:mainfrom
SpencerTorres:ch-otel-user-agent
Closed

[exporter/clickhouse] Add client info for identifying exporter in system.query_log#34915
SpencerTorres wants to merge 18 commits into
open-telemetry:mainfrom
SpencerTorres:ch-otel-user-agent

Conversation

@SpencerTorres
Copy link
Copy Markdown
Member

@SpencerTorres SpencerTorres commented Aug 29, 2024

Description:

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-lin-amd64.

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

Comment thread exporter/clickhouseexporter/config.go Outdated
Comment thread exporter/clickhouseexporter/version_info.go Outdated
@SpencerTorres
Copy link
Copy Markdown
Member Author

@dmitryax @crobert-1 I don't have perms to add the label, but this is ready to merge

@Frapschen
Copy link
Copy Markdown
Contributor

@SpencerTorres
Copy link
Copy Markdown
Member Author

Looks like my local tests were running differently, I cannot seem to figure out what SQL driver registration magic is happening, but it is all dependent on this line:

// exporter_logs.go:213
var driverName = "clickhouse" // for testing

I will investigate further and then update. This seems to only occur for the unit tests, not for integration tests

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added Stale and removed Stale labels Sep 18, 2024
@SpencerTorres
Copy link
Copy Markdown
Member Author

not stale

@github-actions
Copy link
Copy Markdown
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 Oct 17, 2024
@SpencerTorres
Copy link
Copy Markdown
Member Author

still active

@github-actions github-actions Bot removed the Stale label Oct 29, 2024
@github-actions
Copy link
Copy Markdown
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 Nov 13, 2024
@SpencerTorres
Copy link
Copy Markdown
Member Author

Updating the solution now, not stale. Found a way to avoid breaking the entire SQL driver

@SpencerTorres SpencerTorres requested a review from a team as a code owner November 27, 2024 00:41
@SpencerTorres
Copy link
Copy Markdown
Member Author

@Frapschen @hanjm Fixed with a simplified solution, let me know if this looks good. Thanks!

@github-actions github-actions Bot removed the Stale label Nov 27, 2024
@github-actions
Copy link
Copy Markdown
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 Dec 11, 2024
@SpencerTorres
Copy link
Copy Markdown
Member Author

not stale, ready for review

@github-actions github-actions Bot removed the Stale label Dec 12, 2024
@github-actions
Copy link
Copy Markdown
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 Dec 27, 2024
@github-actions
Copy link
Copy Markdown
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions Bot closed this Jan 10, 2025
@SpencerTorres
Copy link
Copy Markdown
Member Author

SpencerTorres commented Jan 10, 2025

not stale, will reopen

dmitryax pushed a commit that referenced this pull request Feb 21, 2025
…stem.query_log` (#37146)

**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
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.

4 participants