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

[exporter/clickhouse] change how default database is read from config #33693

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

SpencerTorres
Copy link
Member

@SpencerTorres SpencerTorres commented Jun 21, 2024

EXTRACTED FROM #33614

Description:

Changes how the database is read from the config. The intent is to simplify the behavior, and give a proper default value. In the current version it's hard to distinguish in tests between empty string vs default.

Testing:
Updated tests, and test structure for parse DSN

@SpencerTorres SpencerTorres requested review from dmitryax and a team as code owners June 21, 2024 01:41
@dmitryax dmitryax merged commit 3e275ab into open-telemetry:main Jun 21, 2024
152 of 154 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 21, 2024
@SpencerTorres SpencerTorres deleted the change-default-database branch June 21, 2024 15:51
dmitryax added a commit that referenced this pull request Jun 24, 2024
#### EXTRACTED FROM #33614 
#### DEPENDS ON #33693 

**Description:**

A follow-up to #32282 that changes `create_schema` from `*bool` to
`bool`, while also properly using the default config / factory.

**Testing:** 
- Updated tests

---------

Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
tomasmota pushed a commit to SpringerPE/opentelemetry-collector-contrib that referenced this pull request Jul 1, 2024
…try#33694)

#### EXTRACTED FROM open-telemetry#33614 
#### DEPENDS ON open-telemetry#33693 

**Description:**

A follow-up to open-telemetry#32282 that changes `create_schema` from `*bool` to
`bool`, while also properly using the default config / factory.

**Testing:** 
- Updated tests

---------

Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
TylerHelmuth pushed a commit that referenced this pull request Jul 1, 2024
…onfig option. (#33614)

### DEPENDS ON #33693, #33694

**Description:**
Sets `async_insert` to true by default to enable [asynchronous
inserts](https://clickhouse.com/docs/en/optimize/asynchronous-inserts).
Because this value is being given a default, I have added a config
option under the same name.
Keep in mind that if `async_insert` is provided in `endpoint` or
`connection_params` it will take precedence and ignore this new config
option.

This is similar to how the `database` config option behaves.
The goal is to provide better insert performance by default, since not
all users will know to set it in their DSN URL.

This also opens the discussion to ___**whether or not this is a breaking
change**___. Depending on the deployment's telemetry throughput, this
could be an unexpected change that leads to
[`TOO_MANY_PARTS`](https://clickhouse.com/docs/knowledgebase/exception-too-many-parts)
errors. I don't expect this to be the case however, but I welcome any
discussion about this concern.

This PR is being resubmitted with suggestions from @crobert-1 and
@dmitryax applied.
Here are the extra changes with these suggestions applied:
- Extracted unrelated changes into separate PRs
- Updated `async_insert` to avoid using a `bool` pointer
- Updated tests to be able to support these
non-pointer-yet-still-optional test cases

**Testing:**
Ran integration tests. Also added an abundance of tests to check the
behavior of `async_insert` when present in `endpoint`,
`connection_params`, and exporter config.

**Documentation:**
- Updated README for all related changes

Unrelated change, also updated README's SQL samples to use `sql` instead
of `clickhouse` for the code samples to enable proper syntax
highlighting. ClickHouse SQL is compatible with plain SQL.
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this pull request Jul 11, 2024
…open-telemetry#33693)

Changes how the database is read from the config. The intent is to
simplify the behavior, and give a proper default value. In the current
version it's hard to distinguish in tests between empty string vs
default.
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this pull request Jul 11, 2024
…try#33694)

#### EXTRACTED FROM open-telemetry#33614 
#### DEPENDS ON open-telemetry#33693 

**Description:**

A follow-up to open-telemetry#32282 that changes `create_schema` from `*bool` to
`bool`, while also properly using the default config / factory.

**Testing:** 
- Updated tests

---------

Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this pull request Jul 11, 2024
…onfig option. (open-telemetry#33614)

### DEPENDS ON open-telemetry#33693, open-telemetry#33694

**Description:**
Sets `async_insert` to true by default to enable [asynchronous
inserts](https://clickhouse.com/docs/en/optimize/asynchronous-inserts).
Because this value is being given a default, I have added a config
option under the same name.
Keep in mind that if `async_insert` is provided in `endpoint` or
`connection_params` it will take precedence and ignore this new config
option.

This is similar to how the `database` config option behaves.
The goal is to provide better insert performance by default, since not
all users will know to set it in their DSN URL.

This also opens the discussion to ___**whether or not this is a breaking
change**___. Depending on the deployment's telemetry throughput, this
could be an unexpected change that leads to
[`TOO_MANY_PARTS`](https://clickhouse.com/docs/knowledgebase/exception-too-many-parts)
errors. I don't expect this to be the case however, but I welcome any
discussion about this concern.

This PR is being resubmitted with suggestions from @crobert-1 and
@dmitryax applied.
Here are the extra changes with these suggestions applied:
- Extracted unrelated changes into separate PRs
- Updated `async_insert` to avoid using a `bool` pointer
- Updated tests to be able to support these
non-pointer-yet-still-optional test cases

**Testing:**
Ran integration tests. Also added an abundance of tests to check the
behavior of `async_insert` when present in `endpoint`,
`connection_params`, and exporter config.

**Documentation:**
- Updated README for all related changes

Unrelated change, also updated README's SQL samples to use `sql` instead
of `clickhouse` for the code samples to enable proper syntax
highlighting. ClickHouse SQL is compatible with plain SQL.
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.

None yet

3 participants