Skip to content

[exporter/clickhouseexporter] Support JSON type for logs and traces #40547

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 53 commits into from
Jun 27, 2025

Conversation

SpencerTorres
Copy link
Member

@SpencerTorres SpencerTorres commented Jun 9, 2025

Description

Depends on refactoring from #40536

Adds JSON support to the exporter.

Summary:

  • Added feature gate (clickhouse.json, alpha stability) for enabling the JSON type pipeline. The Map based pipeline is still functional and is the default. (How to use feature gates)
  • The JSON type replaces all Map columns with the new JSON type.
  • JSON is sent to the server as a string.
  • Due to how the server stores JSON paths, OTel standard paths such as a.b.c are returned as objects a { b { c } } by the server. This can be changed via server setting in the future to return all data as flattened paths a.b.c.

Let me know if you have any questions, suggestions, etc.

Thanks!

Testing

  • Added unit tests for related helper functions
  • Added integration tests for JSON logs/traces

Documentation

  • Updated README, changelog

@SpencerTorres SpencerTorres requested a review from dmitryax as a code owner June 9, 2025 06:46
@SpencerTorres
Copy link
Member Author

SpencerTorres commented Jun 17, 2025

This PR includes a driver update that fixes the HTTP pipelines, if we don't get this merged before the next release I can submit a separate PR to update the module.

clickhouse-go v2.37.1 includes the fix, main is currently on v2.37.0

Without the fix, HTTP pipelines risk starving connections and inconsistent HTTP/400 errors.

Resolved in #40766

@github-actions github-actions bot requested a review from Frapschen June 22, 2025 00:39
@SpencerTorres SpencerTorres requested a review from dmitryax June 22, 2025 00:44
@dmitryax dmitryax merged commit b8746a9 into open-telemetry:main Jun 27, 2025
177 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 27, 2025
@SpencerTorres SpencerTorres deleted the clickhouse_json_feature branch June 27, 2025 18:10
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.

6 participants