Panoramix
An open-source client library for sending requests to Apache Druid from applications written in Elixir. The project uses HTTPoison as an HTTP client for sending queries.
Getting Started
Add Panoramix as a dependency to your project.
defp deps do
[
{:panoramix, ">= 0.12.0 and < 1.0.0"}
]
end
Configuration
Panoramix requires a Druid Broker profile to be defined in the configuration of your application.
config :panoramix,
request_timeout: 120_000,
query_priority: 0,
broker_profiles: [
default: [
base_url: "https://druid-broker-host:9088",
cacertfile: "path/to/druid-certificate.crt",
http_username: "username",
http_password: "password"
]
],
httpoison_module: HTTPoison
request_timeout
: Query timeout in millis to be used inContext
of all Druid queries.query_priority
: Priority to be used inContext
of all Druid queries.httpoison_module
: Module to call when making HTTP requests. Defaults toHTTPoison
if not specified, but you can provide a custom wrapper module if you wish. See HTTPoison.Base for examples.
The cacertfile
option in the broker profile names a file that contains the CA certificate for the Druid broker. Alternatively you can specify the certificate as a string in PEM format (starting with -----BEGIN CERTIFICATE-----
) in the cacert
option.
Troubleshooting
You can check correctness of your configuration by requesting status from Druid Broker. A successfull response will look like this.
iex(1)> Panoramix.status(:default)
{:ok,
%{
"memory" => %{...},
"modules" => [...],
"version" => "0.13.0"
}}
Contributions
We’d love to accept your contributions in a form of patches, bug reports and new features!
Before opening a pull request please make sure your changes pass all the tests.