You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-30Lines changed: 48 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,7 +176,7 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO blazer;
176
176
COMMIT;
177
177
```
178
178
179
-
### MySQL
179
+
### MySQL and MariaDB
180
180
181
181
Create a user with read-only permissions:
182
182
@@ -284,6 +284,32 @@ smart_columns:
284
284
status: {0: "Active", 1: "Archived"}
285
285
```
286
286
287
+
### Annotations
288
+
289
+
Shows overlay lines or box ranges for line queries.
290
+
291
+
Suppose your sales data and your deployments data, given a query:
292
+
293
+
```sql
294
+
SELECT date_trunc('hour', created_at), sum(value) FROM sales GROUP BY 1
295
+
```
296
+
297
+
You might want to see the influence of a deployment for those sales.
298
+
299
+
```yml
300
+
annotations:
301
+
deployments: SELECT date, name FROM deployments WHERE date BETWEEN {min_date} AND {max_date}
302
+
```
303
+
304
+
You can also show periods:
305
+
306
+
```yml
307
+
annotations:
308
+
holidays: SELECT min_date, max_date, name FROM holidays WHERE (min_date, max_date) OVERLAPS ({min_date}, {max_date})
309
+
```
310
+
311
+
Conditions for those queries are optional, but they will help to only fetch the relevant annotations for a particular chart.
312
+
287
313
### Caching
288
314
289
315
Blazer can automatically cache results to improve speed. It can cache slow queries:
@@ -448,24 +474,22 @@ anomaly_checks: prophet
448
474
449
475
### Trend
450
476
451
-
[Trend](https://trendapi.org/) uses an external service by default, but you can run it on your own infrastructure as well.
452
-
453
477
Add [trend](https://github.com/ankane/trend) to your Gemfile:
454
478
455
479
```ruby
456
480
gem "trend"
457
481
```
458
482
459
-
And add to `config/blazer.yml`:
483
+
Set the URL to the [API](https://github.com/ankane/trend-api) in an initializer:
460
484
461
-
```yml
462
-
anomaly_checks: trend
485
+
```ruby
486
+
Trend.url = "http://localhost:8000"
463
487
```
464
488
465
-
For the [self-hosted API](https://github.com/ankane/trend-api), create an initializer with:
489
+
And add to `config/blazer.yml`:
466
490
467
-
```ruby
468
-
Trend.url = "http://localhost:8000"
491
+
```yml
492
+
anomaly_checks: trend
469
493
```
470
494
471
495
### AnomalyDetection.rb
@@ -504,24 +528,22 @@ forecasting: prophet
504
528
505
529
### Trend
506
530
507
-
[Trend](https://trendapi.org/) uses an external service by default, but you can run it on your own infrastructure as well.
508
-
509
531
Add [trend](https://github.com/ankane/trend) to your Gemfile:
510
532
511
533
```ruby
512
534
gem "trend"
513
535
```
514
536
515
-
And add to `config/blazer.yml`:
537
+
Set the URL to the [API](https://github.com/ankane/trend-api) in an initializer:
516
538
517
-
```yml
518
-
forecasting: trend
539
+
```ruby
540
+
Trend.url = "http://localhost:8000"
519
541
```
520
542
521
-
For the [self-hosted API](https://github.com/ankane/trend-api), create an initializer with:
543
+
And add to `config/blazer.yml`:
522
544
523
-
```ruby
524
-
Trend.url = "http://localhost:8000"
545
+
```yml
546
+
forecasting: trend
525
547
```
526
548
527
549
## Uploads
@@ -583,7 +605,7 @@ data_sources:
583
605
- [Google BigQuery](#google-bigquery)
584
606
- [IBM DB2 and Informix](#ibm-db2-and-informix)
585
607
- [InfluxDB](#influxdb)
586
-
- [MySQL](#mysql-1)
608
+
- [MySQL and MariaDB](#mysql-and-mariadb-1)
587
609
- [Neo4j](#neo4j)
588
610
- [OpenSearch](#opensearch)
589
611
- [Oracle](#oracle)
@@ -656,11 +678,11 @@ Here’s an example IAM policy:
656
678
}
657
679
```
658
680
659
-
You also need to configure [S3 permissions](https://aws.amazon.com/premiumsupport/knowledge-center/access-denied-athena/).
681
+
You also need to configure [S3 permissions](https://repost.aws/knowledge-center/access-denied-athena).
660
682
661
683
### Amazon Redshift
662
684
663
-
Add [activerecord6-redshift-adapter](https://github.com/kwent/activerecord6-redshift-adapter) or [activerecord5-redshift-adapter](https://github.com/ConsultingMD/activerecord5-redshift-adapter) to your Gemfile and set:
685
+
Add [activerecord7-redshift-adapter-pennylane](https://github.com/pennylane-hq/activerecord-adapter-redshift) to your Gemfile and set:
664
686
665
687
```yml
666
688
data_sources:
@@ -735,7 +757,7 @@ Use a [read-only role](https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/us
735
757
736
758
### Druid
737
759
738
-
Enable [SQL support](http://druid.io/docs/latest/querying/sql.html#configuration) on the broker and set:
760
+
Enable [SQL support](https://druid.apache.org/docs/latest/querying/sql) on the broker and set:
739
761
740
762
```yml
741
763
data_sources:
@@ -761,7 +783,7 @@ Use a [read-only role](https://www.elastic.co/guide/en/elasticsearch/reference/c
761
783
762
784
### Google BigQuery
763
785
764
-
Add [google-cloud-bigquery](https://github.com/GoogleCloudPlatform/google-cloud-ruby/tree/master/google-cloud-bigquery) to your Gemfile and set:
786
+
Add [google-cloud-bigquery](https://github.com/GoogleCloudPlatform/google-cloud-ruby/tree/main/google-cloud-bigquery) to your Gemfile and set:
765
787
766
788
```yml
767
789
data_sources:
@@ -796,7 +818,7 @@ data_sources:
796
818
797
819
Use a [read-only user](https://docs.influxdata.com/influxdb/v1.8/administration/authentication_and_authorization/). Supports [InfluxQL](https://docs.influxdata.com/influxdb/v1.8/query_language/explore-data/).
798
820
799
-
### MySQL
821
+
### MySQL and MariaDB
800
822
801
823
Add [mysql2](https://github.com/brianmario/mysql2) to your Gemfile (if it’s not there) and set:
> This installs the driver at `/app/.apt/usr/lib/snowflake/odbc/lib/libSnowflake.so`
932
954
933
-
Then, download the [Snowflake ODBC driver](https://docs.snowflake.net/manuals/user-guide/odbc-download.html). Add [odbc_adapter](https://github.com/localytics/odbc_adapter) to your Gemfile and set:
955
+
Then, download the [Snowflake ODBC driver](https://docs.snowflake.com/developer-guide/odbc/odbc-download). Add [odbc_adapter](https://github.com/localytics/odbc_adapter) to your Gemfile and set:
934
956
935
957
```yml
936
958
data_sources:
@@ -1011,10 +1033,6 @@ Have team members who want to learn SQL? Here are a few great, free resources.
1011
1033
1012
1034
For an easy way to group by day, week, month, and more with correct time zones, check out [Groupdate.sql](https://github.com/ankane/groupdate.sql).
1013
1035
1014
-
## Standalone Version
1015
-
1016
-
Looking for a standalone version? Check out [Ghost Blazer](https://github.com/buren/ghost_blazer).
1017
-
1018
1036
## Performance
1019
1037
1020
1038
By default, queries take up a request while they are running. To run queries asynchronously, add to your config:
0 commit comments