Skip to content

Add docs for predefined_http#8161

Merged
blinkov merged 3 commits intoClickHouse:masterfrom
TCeason:en-docs/pr-7572
Apr 1, 2020
Merged

Add docs for predefined_http#8161
blinkov merged 3 commits intoClickHouse:masterfrom
TCeason:en-docs/pr-7572

Conversation

@TCeason
Copy link
Contributor

@TCeason TCeason commented Dec 12, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Documentation

Detailed description (optional):
#7572

@TCeason TCeason requested a review from a team as a code owner December 12, 2019 10:03
@akuzm akuzm added the comp-documentation Documentation. label Dec 13, 2019
ClickHouse provides two network interfaces (both can be optionally wrapped in TLS for additional security):

* [HTTP](http.md), which is documented and easy to use directly.
* [Predefined HTTP](predefined_http.md), which is more easy integration with third-party tools.
Copy link
Contributor

Choose a reason for hiding this comment

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

let's put all this into same http.md as additional sections

$ echo '(4),(5),(6)' | curl 'http://localhost:8123/?query=INSERT%20INTO%20t%20VALUES' --data-binary @-
```

Now ClickHouse supports Predefined HTTP Interface which can help you more easy integration with third party tools. For example, the following example describes how to by Prometheus with Predefined HTTP Interface integration.
Copy link
Contributor

Choose a reason for hiding this comment

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

we shouldn't use any reference to time in documentation (now, already, etc.), here and in other places


Now ClickHouse supports Predefined HTTP Interface which can help you more easy integration with third party tools. For example, the following example describes how to by Prometheus with Predefined HTTP Interface integration.

> Example:
Copy link
Contributor

Choose a reason for hiding this comment

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

some formatting issues, there should be no mass >


> Example:
>
> * First, add these configurations to the configuration file:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
> * First, add these configurations to the configuration file:
> * First of all, add this section to server configuration file:

> </http_handlers>
> ```
>
> * You can now request the url directly for data in the Prometheus format:
Copy link
Contributor

Choose a reason for hiding this comment

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

  • link to format description and/or to Prometheus itself
  • we should explain in the very beginning that this example is about exporting metrics in Prometheus format, not in the middle of it


You can configure `<method>`, `<headers>`, `<url>` and `<queries>` in `<predefined_query_handler>`.

`<method>` is responsible for matching the method part of the HTTP request. `<method>` fully conforms to the definition of method in the HTTP protocol. It is an optional configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

some link to proper definition of "method"


`<method>` is responsible for matching the method part of the HTTP request. `<method>` fully conforms to the definition of method in the HTTP protocol. It is an optional configuration.

`<url>` is responsible for matching the url part of the HTTP request. It is compatible with RE2's regular expressions. It is an optional configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • what happens if it's omitted?
  • link to re2 docs


`<predefined_query_handler>` supports setting Settings and query_params values.

To experiment with this functionality, the example defines the values of max_threads and max_alter_threads and queries whether the Settings were set successfully.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To experiment with this functionality, the example defines the values of max_threads and max_alter_threads and queries whether the Settings were set successfully.
The following example defines the values of `max_threads` and `max_alter_threads` settings, then queries the system table to check whether these settings were set successfully.

max_alter_threads 2
```

> Note:
Copy link
Contributor

Choose a reason for hiding this comment

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

Proper syntax for notes:

!!! note "Note"
   My note text

ClickHouse extracts and executes the value corresponding to the `<query_param_name>` value in the url of the HTTP request.
ClickHouse default setting `<query_param_name>` is `/query` . It is an optional configuration.

To experiment with this functionality, the example defines the values of max_threads and max_alter_threads and queries whether the Settings were set successfully.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • same issue as above
  • also it doesn't explain the specifics of this example comparing to previous one

@blinkov blinkov added the pr-documentation Documentation PRs for the specific code PR label Dec 13, 2019
@blinkov blinkov self-assigned this Apr 1, 2020
@blinkov blinkov merged commit 214c465 into ClickHouse:master Apr 1, 2020
@alexey-milovidov
Copy link
Member

But the feature is not merged yet. It is in the queue and I hope will be merged very soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-documentation Documentation. pr-documentation Documentation PRs for the specific code PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants