├── .docker.env ├── .dockerignore ├── .formatter.exs ├── .gcloudignore ├── .git-blame-ignore-revs ├── .github └── workflows │ ├── docker-ci-amd-and-arm.yml │ ├── docker-retag-versioned.yml │ ├── docker-test.yml │ ├── elixir-ci.yml │ ├── elixir-migration-check.yml │ ├── pages-build.yml │ ├── pages.yml │ ├── pr-management.yml │ └── trigger-cloudbuild.yml ├── .gitignore ├── .iex.exs ├── .mailmap ├── .template.env ├── .tool-versions ├── DEVELOPMENT.md ├── Dockerfile ├── LICENSE.md ├── Makefile ├── README.md ├── VERSION ├── architecture.md ├── assets ├── build.mjs ├── css │ ├── admin.scss │ ├── alerts.scss │ ├── app.scss │ ├── billing.scss │ ├── buttons.scss │ ├── contact.scss │ ├── dashboard.scss │ ├── errors.scss │ ├── forms.scss │ ├── guide_page.scss │ ├── guides.scss │ ├── header.scss │ ├── homepage.scss │ ├── json_formatter_logflare.scss │ ├── legal.scss │ ├── live_view.scss │ ├── log_event.scss │ ├── lql.scss │ ├── marketing.scss │ ├── marketing_pricing.scss │ ├── marketing_responsive.scss │ ├── media_queries.scss │ ├── mixins.scss │ ├── modal.scss │ ├── named_variables.scss │ ├── oauth.scss │ ├── pricing.scss │ ├── source_log_search.scss │ ├── tailwind.css │ └── ui.scss ├── js │ ├── LogEventsChart.jsx │ ├── admin_dashboard_charts.jsx │ ├── app.js │ ├── billing.js │ ├── dashboard.js │ ├── formatters.js │ ├── interfaces │ │ ├── EndpointEditor.jsx │ │ ├── EndpointsBrowserList.jsx │ │ ├── ShowEndpoint.jsx │ │ ├── endpoints │ │ │ ├── ApiCallExamples.jsx │ │ │ ├── JsonResults.jsx │ │ │ ├── QueryTester.jsx │ │ │ └── SettingsManager.jsx │ │ └── index.js │ ├── live_modal.js │ ├── loader.jsx │ ├── log_event_live_hooks.js │ ├── logs.js │ ├── socket.js │ ├── source.js │ ├── source_lv_hooks.js │ ├── user-config-storage.js │ ├── user.js │ ├── utils.js │ └── vendor │ │ ├── daterangepicker.css │ │ ├── daterangepicker.min.js │ │ └── idle.js ├── package-lock.json ├── package.json ├── static │ ├── browserconfig.xml │ ├── google8cf88cdd193a47a4.html │ ├── images │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-512x512.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── app │ │ │ └── chase.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── apple-icon-precomposed.png │ │ ├── apple-icon.png │ │ ├── cloudflare │ │ │ ├── cloudflare-featured-app-image.png │ │ │ ├── cloudflare-logflare-tile.png │ │ │ ├── full-screenshot.png │ │ │ ├── options-screenshot.png │ │ │ └── sources-screenshot.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── favicon.ico │ │ ├── logflare-example.gif │ │ ├── logos │ │ │ ├── cloudflare-white.svg │ │ │ ├── discord-logo-1.svg │ │ │ ├── elixir-dark.png │ │ │ ├── fluent-bit-logo.png │ │ │ ├── gigalixir_logo.svg │ │ │ ├── gmail-icon.svg │ │ │ ├── google-bigquery-logo.svg │ │ │ ├── google-data-studio.svg │ │ │ ├── heroku-logotype-horizontal-white.svg │ │ │ ├── javascript-logo.png │ │ │ ├── logflare-logo.png │ │ │ ├── slack-new-logo.svg │ │ │ ├── sms-solid.svg │ │ │ ├── stream-solid.svg │ │ │ ├── vercel-white.svg │ │ │ └── webhook-logo-white.svg │ │ ├── marketing │ │ │ ├── add-a-member.png │ │ │ ├── add-chart.png │ │ │ ├── add-data-source.png │ │ │ ├── add-service-account-with-permissions.png │ │ │ ├── add-to-slack.png │ │ │ ├── bq-job-user-permissions.png │ │ │ ├── connect.png │ │ │ ├── contact_us │ │ │ │ ├── contactBackground.png │ │ │ │ └── contactBg.png │ │ │ ├── create-report.png │ │ │ ├── edit-source.png │ │ │ ├── find-logflare-source.png │ │ │ ├── get-project-id.png │ │ │ ├── guides │ │ │ │ ├── bigquerylogo.png │ │ │ │ ├── dataStudioLogo.png │ │ │ │ ├── dataStudioLogo2.png │ │ │ │ ├── fr1bgimg.png │ │ │ │ ├── fr3bgimg.png │ │ │ │ ├── fr4bgimg.png │ │ │ │ ├── gettingStartedBg.png │ │ │ │ ├── guidepageherobg.png │ │ │ │ ├── guidesBackground.png │ │ │ │ ├── minilogo.png │ │ │ │ ├── slackLogo.png │ │ │ │ ├── vercel-logo.png │ │ │ │ └── vercel-setup │ │ │ │ │ ├── browser-log-web-vitals-vercel-pino-logflare.png │ │ │ │ │ ├── create-vercel-log-drain.png │ │ │ │ │ ├── custom-data-object.png │ │ │ │ │ ├── custom-object-search.png │ │ │ │ │ ├── example-vercel-search.gif │ │ │ │ │ ├── vercel-build-logs.gif │ │ │ │ │ └── vercel-build-rule.png │ │ │ ├── homepage │ │ │ │ ├── bgDesktopTop-4x.png │ │ │ │ ├── bgDesktopTop.png │ │ │ │ ├── bgbtn.png │ │ │ │ ├── bgoftable.png │ │ │ │ ├── bgtop.png │ │ │ │ ├── catchImgDesktop-4x.png │ │ │ │ ├── catchImgDesktop.png │ │ │ │ ├── footerbg.png │ │ │ │ ├── forphontest.png │ │ │ │ ├── heroimg11.png │ │ │ │ ├── heroimg12.png │ │ │ │ ├── imgphone1.png │ │ │ │ ├── imgphone2.png │ │ │ │ ├── installbtn.png │ │ │ │ ├── iphoneDesktop.png │ │ │ │ ├── logo.png │ │ │ │ ├── quote.png │ │ │ │ ├── sliderimg2.png │ │ │ │ ├── sliderimg3.png │ │ │ │ ├── statusc.png │ │ │ │ └── trackImgDesktop.png │ │ │ ├── navigate-to-iam.png │ │ │ ├── pricing │ │ │ │ └── pricingDesktopBackground.png │ │ │ ├── select-bigquery-connector.png │ │ │ ├── select-data-source-and-default-date-range.png │ │ │ ├── select-data-source.png │ │ │ ├── select-partition-option.png │ │ │ ├── select-report-settings.png │ │ │ ├── set-project-id.png │ │ │ ├── set-source-ttl.png │ │ │ ├── set-timestamp-to-date-hour.png │ │ │ └── slack-notifications-example.png │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ └── ms-icon-70x70.png │ ├── manifest.json │ ├── robots.txt │ └── worker.js └── tailwind.config.js ├── cloudbuild ├── .dev.env.enc ├── .prod.cacert.pem.enc ├── .prod.cert.key.enc ├── .prod.cert.pem.enc ├── .prod.db-client-cert.pem.enc ├── .prod.db-client-key.pem.enc ├── .prod.db-server-ca.pem.enc ├── .prod.env.enc ├── .prod.gcloud.json.enc ├── .staging.cacert.key.enc ├── .staging.cacert.pem.enc ├── .staging.cert.key.enc ├── .staging.cert.pem.enc ├── .staging.db-client-cert.pem.enc ├── .staging.db-client-key.pem.enc ├── .staging.db-server-ca.pem.enc ├── .staging.env.enc ├── .staging.gcloud.json.enc ├── prod │ ├── build-image.yaml │ ├── deploy.yaml │ └── pre-deploy.yaml ├── secret_setup.Dockerfile ├── shutdown.sh ├── staging │ ├── build-image.yaml │ └── deploy.yaml └── startup.sh ├── config ├── .credo.exs ├── config.exs ├── dev.exs ├── docker.exs ├── prod.exs ├── runtime.exs └── test.exs ├── coveralls.json ├── docker-compose.supabase.yml ├── docker-compose.yml ├── docs └── docs.logflare.com │ ├── .gitignore │ ├── .tool-versions │ ├── README.md │ ├── babel.config.js │ ├── docs │ ├── alerts │ │ ├── _category_.json │ │ ├── index.md │ │ └── slack │ │ │ ├── add-to-slack.png │ │ │ ├── edit-source.png │ │ │ ├── index.md │ │ │ └── slack-notifications-example.png │ ├── backends │ │ ├── _category_.json │ │ ├── bigquery │ │ │ ├── add-a-member.png │ │ │ ├── add-service-account-with-permissions.png │ │ │ ├── bigquery-connector.png │ │ │ ├── bq-job-user-permissions.png │ │ │ ├── connect-data-studio.png │ │ │ ├── data-studio-configure-date-range.png │ │ │ ├── data-studio-create-chart.png │ │ │ ├── data-studio-create-report.png │ │ │ ├── data-studio-report-settings.png │ │ │ ├── data-studio-timestamp-type.png │ │ │ ├── find-logflare-source.png │ │ │ ├── get-project-id.png │ │ │ ├── index.md │ │ │ ├── navigate-to-iam.png │ │ │ ├── open-data-studio.png │ │ │ ├── partitioned-table-time-dimension.png │ │ │ ├── set-project-id.png │ │ │ └── set-source-ttl.png │ │ ├── datadog.mdx │ │ ├── elastic.mdx │ │ ├── index.mdx │ │ ├── loki.mdx │ │ ├── postgres │ │ │ └── index.md │ │ └── webhook.mdx │ ├── case-studies │ │ ├── _category_.json │ │ └── supabase │ │ │ ├── index.md │ │ │ └── supabase-acquires-logflare.png │ ├── concepts │ │ ├── _category_.json │ │ ├── access-tokens │ │ │ ├── create-access-token-button.png │ │ │ ├── create-description.png │ │ │ ├── create-success.png │ │ │ ├── index.md │ │ │ └── revoke.png │ │ ├── endpoints.md │ │ ├── index.mdx │ │ ├── ingestion │ │ │ ├── backend-ttl.png │ │ │ ├── index.mdx │ │ │ ├── rules-navigate.png │ │ │ ├── schema-reference.png │ │ │ ├── search-ui.png │ │ │ └── source-rules.png │ │ ├── lql │ │ │ ├── index.md │ │ │ └── lql-reference.png │ │ ├── querying.md │ │ └── rules.md │ ├── integrations │ │ ├── _category_.json │ │ ├── open-telemetry │ │ │ └── index.mdx │ │ ├── postgres-fdw.md │ │ └── vercel │ │ │ ├── create-vercel-log-drain.png │ │ │ ├── example-log-event.png │ │ │ ├── example-logs-view.png │ │ │ ├── example-vercel-search.gif │ │ │ ├── index.md │ │ │ ├── vercel-build-logs.gif │ │ │ ├── vercel-lql-search-example.png │ │ │ └── vercel-routing-rules.png │ └── self-hosting │ │ ├── add-key.png │ │ ├── index.md │ │ └── service-account-mange-keys.png │ ├── docusaurus.config.js │ ├── package-lock.json │ ├── package.json │ ├── sidebars.js │ ├── src │ ├── components │ │ └── index.ts │ └── css │ │ └── custom.scss │ ├── static │ ├── .nojekyll │ └── img │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-512x512.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── apple-icon-precomposed.png │ │ ├── apple-icon.png │ │ ├── backends │ │ ├── add-a-member.png │ │ ├── add-service-account-with-permissions.png │ │ ├── bq-job-user-permissions.png │ │ ├── get-project-id.png │ │ ├── navigate-to-iam.png │ │ ├── set-project-id.png │ │ └── set-source-ttl.png │ │ ├── dashboard-dark.png │ │ ├── dashboard.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── favicon.ico │ │ ├── logflare-example.gif │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ └── ms-icon-70x70.png │ └── tsconfig.json ├── examples └── otel-collector │ └── config.yaml ├── lib ├── logflare.ex ├── logflare │ ├── account_email.ex │ ├── admin.ex │ ├── alerting.ex │ ├── alerting │ │ ├── alert_query.ex │ │ ├── alerts_scheduler.ex │ │ └── supervisor.ex │ ├── application.ex │ ├── auth.ex │ ├── auth │ │ ├── cache.ex │ │ └── email.ex │ ├── backends.ex │ ├── backends │ │ ├── adaptor.ex │ │ ├── adaptor │ │ │ ├── bigquery_adaptor.ex │ │ │ ├── clickhouse_adaptor.ex │ │ │ ├── clickhouse_adaptor │ │ │ │ ├── pipeline.ex │ │ │ │ ├── provisioner.ex │ │ │ │ └── query_templates.ex │ │ │ ├── datadog_adaptor.ex │ │ │ ├── elastic_adaptor.ex │ │ │ ├── loki_adaptor.ex │ │ │ ├── postgres_adaptor.ex │ │ │ ├── postgres_adaptor │ │ │ │ ├── pg_log_event.ex │ │ │ │ ├── pg_repo.ex │ │ │ │ ├── pipeline.ex │ │ │ │ ├── repo │ │ │ │ │ └── migrations.ex │ │ │ │ ├── shared_repo.ex │ │ │ │ └── supervisor.ex │ │ │ ├── slack_adaptor.ex │ │ │ ├── slack_adaptor │ │ │ │ └── client.ex │ │ │ ├── webhook_adaptor.ex │ │ │ └── webhook_adaptor │ │ │ │ └── egress_middleware.ex │ │ ├── adaptor_supervisor.ex │ │ ├── backend.ex │ │ ├── buffer_producer.ex │ │ ├── cache.ex │ │ ├── cache_warmer.ex │ │ ├── dynamic_pipeline.ex │ │ ├── ingest_event_queue.ex │ │ ├── ingest_event_queue │ │ │ ├── broadcast_worker.ex │ │ │ ├── mapper_janitor.ex │ │ │ └── queue_janitor.ex │ │ ├── recent_events_touch.ex │ │ ├── recent_inserts_broadcaster.ex │ │ ├── source_backend.ex │ │ ├── source_metrics_cache.ex │ │ ├── source_sup.ex │ │ ├── source_sup_worker.ex │ │ └── supervisor.ex │ ├── billing.ex │ ├── billing │ │ ├── billing_account.ex │ │ ├── billing_count.ex │ │ ├── billing_counts.ex │ │ ├── cache.ex │ │ ├── payment_method.ex │ │ ├── plan.ex │ │ └── stripe.ex │ ├── cluster │ │ ├── postgres_strategy.ex │ │ ├── strategy │ │ │ ├── auth_client.ex │ │ │ ├── compute_client.ex │ │ │ └── libcluster_gce_strategy.ex │ │ └── utils.ex │ ├── context_cache.ex │ ├── context_cache │ │ ├── cache_buster.ex │ │ ├── supervisor.ex │ │ └── transaction_broadcaster.ex │ ├── ecto │ │ ├── bigquery │ │ │ ├── bq_repo.ex │ │ │ ├── ecto_bq_query_api.ex │ │ │ └── ecto_bq_query_api_udf.ex │ │ ├── ecto_atom_t.ex │ │ ├── ecto_regex_t.ex │ │ ├── ecto_term_t.ex │ │ ├── ecto_uuid_atom_t.ex │ │ └── encrypted_map.ex │ ├── endpoints.ex │ ├── endpoints │ │ ├── cache.ex │ │ ├── query.ex │ │ ├── query_conn.ex │ │ └── resolver.ex │ ├── erl_sys_mon.ex │ ├── gen_singleton.ex │ ├── gen_singleton │ │ └── watcher.ex │ ├── generators.ex │ ├── google │ │ ├── bigquery │ │ │ ├── bigquery.ex │ │ │ ├── debug.ex │ │ │ ├── ecto_query_bq_sql.ex │ │ │ ├── event_utils │ │ │ │ └── event_utils.ex │ │ │ ├── gen_utils │ │ │ │ └── gen_utils.ex │ │ │ └── schema_utils │ │ │ │ ├── schema_types.ex │ │ │ │ └── schema_utils.ex │ │ ├── gcp_config.ex │ │ └── resource_manager.ex │ ├── logs │ │ ├── browser_report.ex │ │ ├── cleaner.ex │ │ ├── generic_json.ex │ │ ├── github.ex │ │ ├── ingest_transformers.ex │ │ ├── ingest_typecasting.ex │ │ ├── log_event.ex │ │ ├── log_events.ex │ │ ├── log_events_cache.ex │ │ ├── logflare_gen_decorators.ex │ │ ├── logs.ex │ │ ├── logs_search.ex │ │ ├── lql │ │ │ ├── bigquery │ │ │ │ └── lql_ecto_helpers.ex │ │ │ ├── lql.ex │ │ │ ├── lql_chart_rule.ex │ │ │ ├── lql_encoder.ex │ │ │ ├── lql_filter_rule.ex │ │ │ ├── lql_parser.ex │ │ │ ├── lql_parser_helpers.ex │ │ │ └── lql_utils.ex │ │ ├── netlify.ex │ │ ├── otel.ex │ │ ├── otel_metric.ex │ │ ├── otel_trace.ex │ │ ├── processor.ex │ │ ├── raw.ex │ │ ├── rejected_log_events.ex │ │ ├── search │ │ │ ├── logs_search_live_support.ex │ │ │ ├── logs_search_operation.ex │ │ │ ├── logs_search_operations.ex │ │ │ ├── logs_search_operations_helpers.ex │ │ │ ├── logs_search_queries.ex │ │ │ ├── logs_search_query_executor.ex │ │ │ └── lql_validator.ex │ │ ├── source_parsers │ │ │ ├── syslog_message.ex │ │ │ ├── syslog_parser.ex │ │ │ └── syslog_parser_helpers.ex │ │ ├── validators │ │ │ ├── bq_schema_change_validator.ex │ │ │ └── eq_deep_field_types_validator.ex │ │ ├── vector.ex │ │ ├── vercel.ex │ │ └── vercel │ │ │ ├── nimble_vercel_parser.ex │ │ │ └── vercel_parser.ex │ ├── mailer.ex │ ├── oauth_access_grants │ │ └── oauth_access_grant.ex │ ├── oauth_access_tokens │ │ ├── oauth_access_token.ex │ │ └── partner_oauth_access_token.ex │ ├── oauth_applications │ │ ├── oauth_application.ex │ │ └── partner_oauth_application.ex │ ├── partners.ex │ ├── partners │ │ ├── cache.ex │ │ └── partner.ex │ ├── pubsub_rates.ex │ ├── pubsub_rates │ │ ├── buffers.ex │ │ ├── cache.ex │ │ ├── inserts.ex │ │ └── rates.ex │ ├── release.ex │ ├── repo.ex │ ├── saved_searches │ │ ├── saved_search.ex │ │ └── saved_searches.ex │ ├── single_tenant.ex │ ├── source │ │ ├── bigquery │ │ │ ├── bigquery_udf.ex │ │ │ ├── pipeline.ex │ │ │ ├── schema.ex │ │ │ ├── schema_builder.ex │ │ │ └── udf │ │ │ │ └── search_fns.ex │ │ ├── billing_writer.ex │ │ ├── channel_topics.ex │ │ ├── data.ex │ │ ├── email_notification_server.ex │ │ ├── rate_counter_server.ex │ │ ├── slack_hook_server │ │ │ └── slack_hook_server.ex │ │ ├── supervisor.ex │ │ ├── text_notification_server.ex │ │ ├── v1_source_sup.ex │ │ └── webhook_notification_server │ │ │ ├── client.ex │ │ │ ├── discord_client.ex │ │ │ └── webhook_notification_server.ex │ ├── source_schemas.ex │ ├── source_schemas │ │ ├── cache.ex │ │ └── source_schema.ex │ ├── sources.ex │ ├── sources │ │ ├── cache.ex │ │ ├── counters.ex │ │ ├── rate_counters.ex │ │ ├── rule.ex │ │ ├── rules.ex │ │ ├── source.ex │ │ └── source_routing.ex │ ├── sql.ex │ ├── sql │ │ └── parser.ex │ ├── syn_event_handler.ex │ ├── system.ex │ ├── system_metric.ex │ ├── system_metrics │ │ ├── all_logs_logged │ │ │ ├── all_logs_logged.ex │ │ │ └── poller.ex │ │ ├── cachex │ │ │ └── poller.ex │ │ ├── cluster.ex │ │ ├── observer.ex │ │ ├── procs │ │ │ └── poller.ex │ │ ├── schedulers │ │ │ ├── poller.ex │ │ │ └── schedulers.ex │ │ ├── system_metrics_sup.ex │ │ └── wobserver │ │ │ ├── helper.ex │ │ │ └── processes.ex │ ├── team_users.ex │ ├── team_users │ │ ├── cache.ex │ │ └── team_user.ex │ ├── teams.ex │ ├── teams │ │ └── team.ex │ ├── telemetry │ │ └── telemetry_ingest.ex │ ├── user.ex │ ├── users │ │ ├── api.ex │ │ ├── cache.ex │ │ ├── cache_warmer.ex │ │ ├── user_preferences.ex │ │ └── users.ex │ ├── utils.ex │ ├── utils │ │ ├── datetime_utils.ex │ │ ├── debugging.ex │ │ ├── deep_update.ex │ │ ├── guards.ex │ │ ├── json.ex │ │ ├── list.ex │ │ ├── map.ex │ │ ├── maybe.ex │ │ └── tasks.ex │ ├── vault.ex │ ├── vercel.ex │ └── vercel │ │ ├── auth.ex │ │ └── client.ex ├── logflare_grpc │ ├── endpoint.ex │ ├── google │ │ └── rpc │ │ │ ├── code.pb.ex │ │ │ ├── context │ │ │ ├── attribute_context.pb.ex │ │ │ └── audit_context.pb.ex │ │ │ ├── error_details.pb.ex │ │ │ ├── http.pb.ex │ │ │ └── status.pb.ex │ ├── identity_compressor.ex │ ├── opentelemetry │ │ └── proto │ │ │ ├── collector │ │ │ ├── logs │ │ │ │ └── v1 │ │ │ │ │ └── logs_service.pb.ex │ │ │ ├── metrics │ │ │ │ └── v1 │ │ │ │ │ └── metrics_service.pb.ex │ │ │ ├── profiles │ │ │ │ └── v1development │ │ │ │ │ └── profiles_service.pb.ex │ │ │ └── trace │ │ │ │ └── v1 │ │ │ │ └── trace_service.pb.ex │ │ │ ├── common │ │ │ └── v1 │ │ │ │ └── common.pb.ex │ │ │ ├── logs │ │ │ └── v1 │ │ │ │ └── logs.pb.ex │ │ │ ├── metrics │ │ │ └── v1 │ │ │ │ └── metrics.pb.ex │ │ │ ├── profiles │ │ │ └── v1development │ │ │ │ └── profiles.pb.ex │ │ │ ├── resource │ │ │ └── v1 │ │ │ │ └── resource.pb.ex │ │ │ └── trace │ │ │ └── v1 │ │ │ └── trace.pb.ex │ └── trace │ │ └── server.ex ├── logflare_web.ex ├── logflare_web │ ├── api_spec.ex │ ├── channels │ │ ├── dashboard_channel.ex │ │ ├── everyone_channel.ex │ │ ├── log_channel.ex │ │ ├── log_socket.ex │ │ ├── lv_socket.ex │ │ ├── source_channel.ex │ │ └── user_socket.ex │ ├── controllers │ │ ├── admin_controller.ex │ │ ├── admin_plan_controller.ex │ │ ├── api │ │ │ ├── access_token_controller.ex │ │ │ ├── backend_controller.ex │ │ │ ├── endpoint_controller.ex │ │ │ ├── fallback_controller.ex │ │ │ ├── partner │ │ │ │ └── user_controller.ex │ │ │ ├── query_controller.ex │ │ │ ├── rule_controller.ex │ │ │ ├── source_controller.ex │ │ │ └── team_controller.ex │ │ ├── auth │ │ │ ├── auth_controller.ex │ │ │ ├── email_controller.ex │ │ │ ├── oauth_controller.ex │ │ │ ├── oauth_provider_controller.ex │ │ │ ├── unsubscribe_controller.ex │ │ │ └── vercel_auth.ex │ │ ├── billing_controller.ex │ │ ├── cloudflare_controller.ex │ │ ├── cloudflare_controller_v1.ex │ │ ├── endpoints_controller.ex │ │ ├── health_check_controller.ex │ │ ├── log_controller.ex │ │ ├── marketing_controller.ex │ │ ├── plugs │ │ │ ├── auth_must_be_owner.ex │ │ │ ├── auth_switch.ex │ │ │ ├── bert_parser.ex │ │ │ ├── buffer_limiter.ex │ │ │ ├── check_admin.ex │ │ │ ├── check_team_user.ex │ │ │ ├── ensure_source_started.ex │ │ │ ├── fetch_resource.ex │ │ │ ├── json_parser.ex │ │ │ ├── maybe_content_type_to_json.ex │ │ │ ├── ndjson_parser.ex │ │ │ ├── protobuf_parser.ex │ │ │ ├── rate_limiter.ex │ │ │ ├── require_auth.ex │ │ │ ├── set_headers.ex │ │ │ ├── set_plan.ex │ │ │ ├── set_plan_from_cache.ex │ │ │ ├── set_team.ex │ │ │ ├── set_team_if_nil.ex │ │ │ ├── set_team_user.ex │ │ │ ├── set_verify_source.ex │ │ │ ├── set_verify_user.ex │ │ │ ├── syslog_parser.ex │ │ │ ├── verify_api_access.ex │ │ │ └── verify_resource_access.ex │ │ ├── saved_searches.ex │ │ ├── source_controller.ex │ │ ├── stripe_controller.ex │ │ ├── team_user_controller.ex │ │ └── user_controller.ex │ ├── core_components.ex │ ├── endpoint.ex │ ├── gettext.ex │ ├── live │ │ ├── access_tokens_live.ex │ │ ├── admin │ │ │ ├── cluster_live.ex │ │ │ ├── cluster_live.html.heex │ │ │ ├── partner_live.ex │ │ │ └── partner_live.html.heex │ │ ├── alert_component.ex │ │ ├── alerts │ │ │ ├── actions │ │ │ │ ├── edit.html.heex │ │ │ │ ├── index.html.heex │ │ │ │ ├── new.html.heex │ │ │ │ ├── not_found.html.heex │ │ │ │ └── show.html.heex │ │ │ ├── alerts_live.ex │ │ │ └── components │ │ │ │ ├── alert_form.html.heex │ │ │ │ └── run_query_result.html.heex │ │ ├── backends │ │ │ ├── actions │ │ │ │ ├── edit.html.heex │ │ │ │ ├── index.html.heex │ │ │ │ ├── new.html.heex │ │ │ │ └── show.html.heex │ │ │ ├── backends_live.ex │ │ │ └── components │ │ │ │ └── backend_form.heex │ │ ├── billing_helpers.ex │ │ ├── billingaccount_live │ │ │ ├── chart_component.ex │ │ │ ├── custom_field_component.ex │ │ │ ├── edit.ex │ │ │ ├── estimate_usage_component.ex │ │ │ ├── payment_method_component.ex │ │ │ └── templates │ │ │ │ └── edit.html.heex │ │ ├── display_helpers.ex │ │ ├── endpoints │ │ │ ├── actions │ │ │ │ ├── closed_beta.html.heex │ │ │ │ ├── edit.html.heex │ │ │ │ ├── index.html.heex │ │ │ │ ├── new.html.heex │ │ │ │ ├── not_found.html.heex │ │ │ │ └── show.html.heex │ │ │ ├── components │ │ │ │ ├── endpoint_form.html.heex │ │ │ │ ├── run_query_form.heex │ │ │ │ └── run_query_result.heex │ │ │ └── endpoints_live.ex │ │ ├── global_log_metrics_lv.ex │ │ ├── live_commons.ex │ │ ├── log_event_live │ │ │ ├── search_log_event_viewer_component.ex │ │ │ └── show.ex │ │ ├── logflare_live_component_utils.ex │ │ ├── lql │ │ │ └── lql_form_lvc.ex │ │ ├── lql_helpers.ex │ │ ├── modal_component.ex │ │ ├── modal_live_helpers.ex │ │ ├── plans_live.ex │ │ ├── query_live.ex │ │ ├── search_live │ │ │ ├── logs_search_debug_lvc.ex │ │ │ ├── logs_search_lv.ex │ │ │ ├── logs_search_lv_utils.ex │ │ │ ├── logs_search_utils.ex │ │ │ ├── query_debug_component.ex │ │ │ ├── templates │ │ │ │ ├── debug.html.heex │ │ │ │ ├── logs_list.html.heex │ │ │ │ ├── logs_search.html.heex │ │ │ │ └── user_prefs_component.html.heex │ │ │ └── user_prefs_component.ex │ │ ├── source_backends_live.ex │ │ ├── sources │ │ │ ├── bq_schema_component.ex │ │ │ └── source_rules_live.ex │ │ ├── utc_time.ex │ │ └── vercellogdrains_live │ │ │ ├── index.ex │ │ │ └── templates │ │ │ └── index.html.heex │ ├── open_api.ex │ ├── open_api_schemas.ex │ ├── open_telemetry_sampler.ex │ ├── phoenix_oauth2_provider_web.ex │ ├── router.ex │ ├── templates │ │ ├── admin │ │ │ ├── accounts.html.eex │ │ │ ├── dashboard.html.eex │ │ │ └── sources.html.eex │ │ ├── admin_plan │ │ │ ├── edit.html.eex │ │ │ ├── form.html.eex │ │ │ ├── index.html.eex │ │ │ └── new.html.eex │ │ ├── admin_shared │ │ │ ├── nav_links.html.eex │ │ │ └── nav_links_live.html.heex │ │ ├── application │ │ │ ├── edit.html.eex │ │ │ ├── form.html.eex │ │ │ ├── index.html.eex │ │ │ ├── new.html.eex │ │ │ └── show.html.eex │ │ ├── auth │ │ │ ├── email │ │ │ │ ├── email_login.html.eex │ │ │ │ └── verify_token.html.eex │ │ │ └── login.html.eex │ │ ├── billing │ │ │ └── confirm.html.eex │ │ ├── error │ │ │ ├── 401_page.html.eex │ │ │ ├── 403_page.html.heex │ │ │ ├── 404_page.html.eex │ │ │ ├── 500_page.html.eex │ │ │ └── error_container.html.eex │ │ ├── layout │ │ │ ├── app.html.eex │ │ │ ├── banner.html.eex │ │ │ ├── flash.html.eex │ │ │ ├── inline_live.html.heex │ │ │ ├── live.html.heex │ │ │ ├── navbar.html.eex │ │ │ ├── root.html.heex │ │ │ └── ui.html.eex │ │ ├── log │ │ │ ├── log_event.html.heex │ │ │ └── log_event_body.html.heex │ │ ├── lql │ │ │ └── lql_form.html.heex │ │ ├── marketing │ │ │ ├── contact.html.eex │ │ │ ├── cookie_policy.html.eex │ │ │ ├── homepage_cta.html.eex │ │ │ ├── index.html.eex │ │ │ ├── pricing.html.eex │ │ │ ├── privacy_policy.html.eex │ │ │ └── terms_of_service.html.eex │ │ ├── phoenix_oauth2_provider │ │ │ ├── application │ │ │ │ ├── edit.html.eex │ │ │ │ ├── form.html.eex │ │ │ │ ├── index.html.eex │ │ │ │ ├── new.html.eex │ │ │ │ └── show.html.eex │ │ │ ├── authorization │ │ │ │ ├── error.html.eex │ │ │ │ ├── new.html.eex │ │ │ │ └── show.html.eex │ │ │ └── authorized_application │ │ │ │ └── index.html.eex │ │ ├── rule │ │ │ └── source_rules.html.heex │ │ ├── shared │ │ │ ├── bq_schema.html.heex │ │ │ ├── dashboard_source_metadata.html.eex │ │ │ ├── footer.html.eex │ │ │ ├── live_widget.html.heex │ │ │ ├── loader.html.heex │ │ │ ├── logflare_services_list.html.eex │ │ │ ├── logo.html.eex │ │ │ ├── lql_help.html.heex │ │ │ ├── modal.html.heex │ │ │ └── team_members.html.eex │ │ ├── source │ │ │ ├── dashboard.html.heex │ │ │ ├── edit.html.eex │ │ │ ├── new.html.eex │ │ │ ├── no_logs_modal.html.eex │ │ │ ├── show.html.eex │ │ │ └── show_rejected.html.eex │ │ ├── team_user │ │ │ └── edit.html.eex │ │ └── user │ │ │ ├── edit.html.eex │ │ │ └── edit_bq_form.html.eex │ ├── utils.ex │ └── views │ │ ├── admin_cluster_view.ex │ │ ├── admin_plan_view.ex │ │ ├── admin_shared_view.ex │ │ ├── admin_view.ex │ │ ├── auth │ │ ├── auth_view.ex │ │ └── email_view.ex │ │ ├── billing_account_view.ex │ │ ├── billing_view.ex │ │ ├── contact_view.ex │ │ ├── docs_view.ex │ │ ├── elixir_logger_view.ex │ │ ├── endpoints_view.ex │ │ ├── error_helpers.ex │ │ ├── error_view.ex │ │ ├── helpers │ │ ├── bq_schema_helpers.ex │ │ ├── form_helpers.ex │ │ └── page_title.ex │ │ ├── layout_view.ex │ │ ├── log_view.ex │ │ ├── lql_view.ex │ │ ├── marketing_view.ex │ │ ├── phoenix_oauth2_provider │ │ ├── application_view.ex │ │ ├── authorization_view.ex │ │ └── authorized_application_view.ex │ │ ├── rule_view.ex │ │ ├── search_view.ex │ │ ├── shared_view.ex │ │ ├── source_view.ex │ │ ├── team_user_view.ex │ │ ├── user_view.ex │ │ └── vercel_log_drains_view.ex ├── mix │ └── tasks │ │ └── docs.ex ├── sig_term_handler.ex └── telemetry.ex ├── mix.exs ├── mix.lock ├── native └── sqlparser_ex │ ├── .cargo │ └── config │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ └── lib.rs ├── priv ├── .gitignore ├── generators │ ├── objects.txt │ ├── predicates.txt │ └── teams.txt ├── gettext │ ├── en │ │ └── LC_MESSAGES │ │ │ └── errors.po │ └── errors.pot ├── keys │ ├── localhost.cert │ └── localhost.key ├── repo │ ├── .formatter.exs │ ├── migrations │ │ ├── 20181212161742_add_users_table.exs │ │ ├── 20181212220417_create_sources.exs │ │ ├── 20181212220843_sources_to_users.exs │ │ ├── 20181219123536_add_api_key_to_users.exs │ │ ├── 20181220234951_unique_name_and_token_source.exs │ │ ├── 20190111193432_add_old_api_key.exs │ │ ├── 20190111222747_index_on_api_key.exs │ │ ├── 20190111223908_change_source_name_index.exs │ │ ├── 20190128145905_create_rules.exs │ │ ├── 20190211145604_add_public_token_to_sources.exs │ │ ├── 20190211215002_create_oauth_tables.exs │ │ ├── 20190212190412_add_default_to_secret.exs │ │ ├── 20190218171231_unique_on_source_public_key.exs │ │ ├── 20190220020658_add_info_to_user.exs │ │ ├── 20190220150309_delete_sources_on_account_delete.exs │ │ ├── 20190226224323_add_another_references_rules.exs │ │ ├── 20190226225345_redo_this_one.exs │ │ ├── 20190313222100_add_admin_to_user.exs │ │ ├── 20190314210542_add_overflow_source.exs │ │ ├── 20190314234158_nilify_overflow_source.exs │ │ ├── 20190321135403_favorite_source.exs │ │ ├── 20190322184724_email_notifications_on_source.exs │ │ ├── 20190322194928_fuck_embeds.exs │ │ ├── 20190326182605_add_phone_to_account_and_tex_alert_to_source.exs │ │ ├── 20190507163835_add_bq_table_settings.exs │ │ ├── 20190509154645_add_api_quotas_to_sources_users.exs │ │ ├── 20190522200854_remove_overflow_source_from_sources.exs │ │ ├── 20190528132518_update_user_constraints.exs │ │ ├── 20190603134249_alter_rules_set_sink_source_id_not_null.exs │ │ ├── 20190604130811_alter_sources_modify_constraints.exs │ │ ├── 20190814185734_add_bigquery_dataset_location.exs │ │ ├── 20190815222912_add_bq_dataset_id.exs │ │ ├── 20190820170701_add_regex_compiled_to_rules.exs │ │ ├── 20190823211533_add_field_user_iam_update.exs │ │ ├── 20190912214717_add_system_metrics_table.exs │ │ ├── 20191007163747_add_provider_uid.exs │ │ ├── 20191014233159_change_system_metrics_to_bigint.exs │ │ ├── 20191108163345_webhook_notification_url.exs │ │ ├── 20191111221000_add_slack_hook_url_to_source.exs │ │ ├── 20191114120409_add_saved_searches_table.exs │ │ ├── 20191226181646_add_lql_filters_to_rules.exs │ │ ├── 20191230164304_create_team_users.exs │ │ ├── 20200106161131_add_lql_string_to_rules.exs │ │ ├── 20200109165508_add_unique_index_user_email.exs │ │ ├── 20200113132611_add_team_user_ids_to_source.exs │ │ ├── 20200114231904_drop_source_columns.exs │ │ ├── 20200116122225_alter_rules_lql_filters_default_value.exs │ │ ├── 20200116143027_alter_rules_modify_lql_filters_bytea.exs │ │ ├── 20200130185455_create_billing_accounts.exs │ │ ├── 20200205180641_alter_users_add_bigquery_udfs_hash.exs │ │ ├── 20200311175358_add_custom_event_message.exs │ │ ├── 20200317130710_delete_saved_searches_on_source_delete.exs │ │ ├── 20200319164038_add_custom_bigquery_bytes_limit.exs │ │ ├── 20200320161900_make_bytes_processed_not_nullable.exs │ │ ├── 20200401102642_alter_saved_searches_add_counts_operators.exs │ │ ├── 20200401132720_create_saved_search_counters.exs │ │ ├── 20200401182732_create_plans.exs │ │ ├── 20200402180315_add_billing_account_subscriptions.exs │ │ ├── 20200403130311_make_billing_accounts_unique.exs │ │ ├── 20200409120508_add_tailing_to_saved_searches.exs │ │ ├── 20200409150827_add_stripe_invoices.exs │ │ ├── 20200413161605_alter_saved_searches_and_counter_on_delete.exs │ │ ├── 20200422211654_redirect_uri_to_text.exs │ │ ├── 20200507184618_add_more_plan_fields.exs │ │ ├── 20200512205718_add_limits_to_plans.exs │ │ ├── 20200513154911_user_billing_enabled.exs │ │ ├── 20200519181117_add_source_rate_limit_to_plans.exs │ │ ├── 20200603150413_add_latest_event_timestamp_to_source.exs │ │ ├── 20200605164057_add_bigquery_schema.exs │ │ ├── 20200605185446_create_source_schemas.exs │ │ ├── 20200606140153_unique_source_schema_index.exs │ │ ├── 20200803211251_add_saved_search_limit_to_plans.exs │ │ ├── 20200806201742_add_notifications_every_to_source.exs │ │ ├── 20200824155733_add_lifetime_plan_billing_account.exs │ │ ├── 20200826141015_add_source_ttl_limit.exs │ │ ├── 20201130170051_alter_sources_add_bq_table_partition_type.exs │ │ ├── 20201211125013_alter_tables_users_team_users_add_preferences.exs │ │ ├── 20201229174131_create_billing_counts.exs │ │ ├── 20210104192144_saved_search_string_to_text.exs │ │ ├── 20210106205729_drop_source_contstraint_billing_counts.exs │ │ ├── 20210118220058_create_payment_methods.exs │ │ ├── 20210121220159_add_plan_type.exs │ │ ├── 20210204203050_add_custom_invoice_fields.exs │ │ ├── 20210215163446_make_invoice_fields_not_nullable.exs │ │ ├── 20210215165548_make_invoice_fields_not_nullable_undo.exs │ │ ├── 20210322193905_rename_columns_for_mnesia_compatibility.exs │ │ ├── 20210521142331_create_vercel_auths.exs │ │ ├── 20210526120333_delete_vercel_auths_on_account_delete.exs │ │ ├── 20210707201854_create_endpoint_queries.exs │ │ ├── 20210712201152_rename_endpoint_title_to_name.exs │ │ ├── 20210715022534_add_source_mapping_to_endpoint_queries.exs │ │ ├── 20210728172720_indexes_on_billing_counts.exs │ │ ├── 20210729161959_subscribe_to_postgres.exs │ │ ├── 20210802194723_drop_source_id_billing_count_index.exs │ │ ├── 20210803020354_add_user_id_index_for_sources.exs │ │ ├── 20210804210634_add_bigquery_flatmap.exs │ │ ├── 20210810182003_set_rules_to_replica_identity_full.exs │ │ ├── 20210830181842_add_node_name_index_to_system_metrics.exs │ │ ├── 20211027175016_add_endpoints_beta_to_user.exs │ │ ├── 20211122181200_add_schema_lock_to_source.exs │ │ ├── 20211123192744_sandboxable_endpoint_queries.exs │ │ ├── 20211130190948_add_drop_rule_to_source.exs │ │ ├── 20211130201505_configurable_endpoint_caching.exs │ │ ├── 20220310172806_add_max_limit_endpoint_query.exs │ │ ├── 20220523135557_add_description_column_to_oauth_access_tokens_table.exs │ │ ├── 20220524125216_add_enable_auth_column_to_endpoint_queries_table.exs │ │ ├── 20220707030041_create_source_backends_table.exs │ │ ├── 20220714033012_add_v2_pipeline_column_to_source_table.exs │ │ ├── 20220803211705_source_replica_identity_full.exs │ │ ├── 20221210010955_add_token_to_team.exs │ │ ├── 20221210011115_set_token_default_values.exs │ │ ├── 20230110121321_add_sandbox_query_id_column_to_endpoint_queries_t_able.exs │ │ ├── 20230206155428_add_team_token_index.exs │ │ ├── 20230223162441_add_partners.exs │ │ ├── 20230227183828_partner_user_table.exs │ │ ├── 20230622160150_add_suggested_fields_to_sources.exs │ │ ├── 20230622160250_set_suggested_fields_default.exs │ │ ├── 20230714041101_add_language_column_to_endpoint_query.exs │ │ ├── 20230727111150_update_endpoint_query_language_default_value.exs │ │ ├── 20230807162746_add_endpoint_query_description_column.exs │ │ ├── 20230911181436_create_alert_queries.exs │ │ ├── 20231023174255_remove_sandbox_query_id_column_from_endpoint_queries_table.exs │ │ ├── 20231027221103_revert_sandbox_query_id_column_removal.exs │ │ ├── 20231207113137_add_user_metadata_column.exs │ │ ├── 20231213013433_add_upgraded_column_to_partner_users_table.exs │ │ ├── 20240214170611_create_backends_table.exs │ │ ├── 20240219101411_alter_alert_queries_table_text_field.exs │ │ ├── 20240223104413_add_token_field_to_backends_table.exs │ │ ├── 20240327073534_add_cascade_delete_for_partner_users.exs │ │ ├── 20240429194758_add_backend_id_to_rules.exs │ │ ├── 20240708025030_recreate_publication_for_tables.exs │ │ ├── 20240725033149_add_token_to_rules.exs │ │ ├── 20240725083359_add_metadata_column_to_backends_table.exs │ │ ├── 20240802110527_add_encrypted_config_field_for_backends_table.exs │ │ ├── 20240806105357_add_service_group_column_to_source_table.exs │ │ ├── 20240808172408_nilify_config_column_for_backends_table.exs │ │ ├── 20241121183147_add_transform_copy_fields_column_to_sources_table.exs │ │ ├── 20241204120824_recreate_tables_publication.exs │ │ ├── 20250203131456_create_index_for_users_partners_upgraded.exs │ │ ├── 20250221154207_create_user_partner_details_column.exs │ │ ├── 20250224140820_migrate_partner_user_upgraded_column_to_user_partner_details.exs │ │ ├── 20250422145132_add_disable_tailing_to_sources_table.exs │ │ └── 20250507072233_users_table_has_many_delete_all.exs │ └── seeds.exs ├── setup.sql ├── supabase │ ├── endpoints │ │ ├── functions.invocation-stats.sql │ │ ├── logs.all.sql │ │ └── usage.api-counts.sql │ └── ingest_samples │ │ ├── cloudflare.logs.prod.json │ │ ├── deno-relay-logs.json │ │ ├── deno-subhosting-events.json │ │ ├── gotrue.logs.prod.json │ │ ├── pgbouncer.logs.prod.json │ │ ├── postgREST.logs.prod.json │ │ ├── postgres.logs.json │ │ ├── realtime.logs.prod.json │ │ └── storage.logs.prod.2.json └── tasks │ └── release_tasks.ex ├── rel ├── env.sh.eex └── vm.args.eex ├── run.sh └── test ├── .formatter.exs ├── bq_logs_search_seed.exs ├── filebeat.yml ├── logflare ├── alerting_test.exs ├── auth │ └── cache_test.exs ├── auth_test.exs ├── backends │ ├── adaptor │ │ ├── clickhouse_adaptor │ │ │ └── query_templates_test.exs │ │ ├── clickhouse_adaptor_test.exs │ │ └── datadog_adaptor_test.exs │ ├── backends_cache_test.exs │ ├── bigquery_adaptor_test.exs │ ├── buffer_producer_test.exs │ ├── dynamic_pipeline_test.exs │ ├── elastic_adaptor_test.exs │ ├── ingest_events_queue_test.exs │ ├── loki_adaptor_test.exs │ ├── postgres_adaptor_test.exs │ ├── slack_adaptor_test.exs │ └── webhook_adaptor_test.exs ├── backends_test.exs ├── bigquery │ ├── bq_repo_test.exs │ ├── ecto_query_bq_test.exs │ └── pipeline_test.exs ├── bigquery_event_utils_test.exs ├── billing │ └── billing_counts_test.exs ├── billing_test.exs ├── cluster_pubsub_test.exs ├── cluster_test.exs ├── context_cache_test.exs ├── endpoints_cache.test.ex ├── endpoints_test.exs ├── gen_singleton_test.exs ├── google │ ├── bigquery │ │ └── schema_builder_test.exs │ └── resource_manager_test.exs ├── log_event_test.exs ├── logs │ ├── ingest │ │ ├── ingest_transformer_test.exs │ │ ├── ingest_typecasting_test.exs │ │ └── metadata_cleaner_test.exs │ ├── logs_test.exs │ ├── otel_trace_test.exs │ ├── rejected_logs_test.exs │ └── vercel │ │ └── vercel_lambda_parser_test.exs ├── lql │ └── lql_parser_test.exs ├── partners_test.exs ├── rules_test.exs ├── saved_searches_test.exs ├── single_tenant_test.exs ├── slack_hook_server_test.exs ├── source │ ├── bigquery │ │ └── schema_test.exs │ ├── billing_writer_test.exs │ ├── email_notification_server_test.exs │ ├── rate_counter_server_test.exs │ ├── source_test.exs │ └── text_notification_server_test.exs ├── source_parsers │ └── syslog_parser_test.exs ├── sources │ ├── source_routing_test.exs │ └── sources_cache_test.exs ├── sources_schemas_test.exs ├── sources_test.exs ├── sql_test.exs ├── system_test.exs ├── team_users_test.exs ├── teams_test.exs ├── users │ ├── users_cache_test.exs │ └── users_test.exs ├── users_api_integration_test.exs ├── utils │ ├── enum_deep_update_test.exs │ ├── guards_test.exs │ └── list_test.exs ├── utils_test.exs ├── validator │ ├── bq_schema_change_validator_test.exs │ └── eq_deep_field_types_validator_test.exs ├── vault_test.exs └── vercel_test.exs ├── logflare_grpc └── trace │ └── server_test.exs ├── logflare_web ├── admin │ └── cluster_live_test.exs ├── controllers │ ├── admin_controller_test.exs │ ├── api │ │ ├── access_tokens_controller_test.exs │ │ ├── backend_controller_test.exs │ │ ├── endpoint_controller_test.exs │ │ ├── partner │ │ │ └── user_controller_test.exs │ │ ├── query_controller_test.exs │ │ ├── rule_controller_test.exs │ │ ├── source_controller_test.exs │ │ └── team_controller_test.exs │ ├── email_controller_tests.exs │ ├── endpoints_controller_test.exs │ ├── health_check_controller_test.exs │ ├── log_controller_test.exs │ ├── marketing_controller_test.exs │ ├── oauth_controller_tests.exs │ ├── source_controller_test.exs │ └── user_controller_test.exs ├── live │ ├── access_tokens_live_test.exs │ ├── admin │ │ └── partner_live_test.exs │ ├── alert_component_test.exs │ ├── backends_live_test.exs │ ├── billingaccount_live │ │ └── estimate_usage_component_test.exs │ ├── search_live │ │ └── logs_search_lv_test.exs │ └── source_backends_live_test.exs ├── live_views │ ├── alerts_live_test.exs │ ├── billing_account_live_test.exs │ ├── endpoints_live_test.exs │ ├── log_event │ │ └── show_test.exs │ └── query_live_test.exs ├── open_telemetry_sampler_test.exs ├── plugs │ ├── bert_parser_test.exs │ ├── buffer_limiter_test.exs │ ├── fetch_resource_test.exs │ ├── ndjson_parser_test.exs │ ├── rate_limiter_plug_test.exs │ ├── verify_api_access_test.exs │ └── verify_resource_access_test.exs ├── utils_test.exs └── views │ ├── docs_view_test.exs │ └── error_view_test.exs ├── loki.yml ├── profiling ├── buffer_limiter.exs ├── buffer_producer.exs ├── context_cache.exs ├── context_cache_bust_keys_bench.exs ├── context_cache_cold_start.exs ├── ingest_event_queue_counts.exs ├── ingest_event_queue_trunc.exs ├── ingest_http.exs ├── ingest_http_api_plugs.exs ├── ingest_http_plugs.exs ├── ingest_logs.exs └── queue_janitor.exs ├── support ├── bq_schemas_factory.ex ├── channel_case.ex ├── conn_case.ex ├── data_case.ex ├── factory.ex ├── payloads.ex ├── predefined_users_sources.ex ├── test_pipelines.ex ├── test_utils.ex └── test_utils_grpc.ex └── test_helper.exs /.docker.env: -------------------------------------------------------------------------------- 1 | PHX_HTTP_PORT=4000 2 | DB_DATABASE=logflare_docker 3 | DB_HOSTNAME=db 4 | DB_PORT=5432 5 | DB_PASSWORD=postgres 6 | DB_USERNAME=postgres 7 | DB_SCHEMA=public 8 | 9 | LOGFLARE_SINGLE_TENANT=true 10 | LOGFLARE_PRIVATE_ACCESS_TOKEN=my-cool-api-key-123 11 | LOGFLARE_PUBLIC_ACCESS_TOKEN=my-other-cool-api-key-123 12 | GOOGLE_PROJECT_ID=logflare-dev-238720 13 | GOOGLE_PROJECT_NUMBER=1023172132421 14 | LOGFLARE_GRPC_PORT=50051 15 | 16 | #POSTGRES_BACKEND_URL=postgresql://postgres:postgres@db:5432/logflare_docker 17 | LOGFLARE_NODE_HOST=127.0.0.1 18 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # App artifacts 2 | /_build 3 | /db 4 | /deps 5 | /*.ez 6 | .DS_Store 7 | 8 | # Generated on crash by the VM 9 | erl_crash.dump 10 | 11 | # Generated on crash by NPM 12 | npm-debug.log 13 | 14 | # Static artifacts 15 | /assets/node_modules 16 | 17 | .deliver/releases 18 | 19 | /tables 20 | /system-table 21 | 22 | /config/secrets 23 | 24 | # IDEs 25 | 26 | /.elixir_ls/ 27 | /.idea/ 28 | 29 | # Docker 30 | /docker 31 | docker* 32 | 33 | /priv/static/ 34 | -------------------------------------------------------------------------------- /.formatter.exs: -------------------------------------------------------------------------------- 1 | # Used by "mix format" 2 | [ 3 | inputs: ["{mix,.formatter}.exs", "{config,lib}/**/*.{heex,ex,exs}"], 4 | subdirectories: ["test", "priv/repo"], 5 | import_deps: [ 6 | :ecto_sql, 7 | :ecto, 8 | :phoenix, 9 | :phoenix_live_view, 10 | :plug, 11 | :typed_struct, 12 | :nimble_parsec, 13 | :typed_ecto_schema, 14 | :open_api_spex 15 | ], 16 | plugins: [Phoenix.LiveView.HTMLFormatter], 17 | heex_line_length: 300 18 | ] 19 | -------------------------------------------------------------------------------- /.gcloudignore: -------------------------------------------------------------------------------- 1 | .github 2 | .vscode 3 | assets 4 | config 5 | deps 6 | docs 7 | lib 8 | native 9 | priv 10 | rel/ 11 | test/ 12 | _build/ 13 | .elixir_ls/ 14 | tmp/ 15 | deps/ 16 | 17 | 18 | .*.key 19 | .*.pem 20 | .*.env 21 | !cloudbuild/* 22 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | 6a1a310a8545c20661501b24b34746e40478b690 2 | -------------------------------------------------------------------------------- /.github/workflows/pr-management.yml: -------------------------------------------------------------------------------- 1 | name: PR Management 2 | 3 | on: 4 | pull_request_target: 5 | types: [ opened, reopened ] 6 | 7 | permissions: 8 | pull-requests: write 9 | 10 | jobs: 11 | assign-author: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: toshimaru/auto-author-assign@v2.0.1 15 | -------------------------------------------------------------------------------- /.iex.exs: -------------------------------------------------------------------------------- 1 | import Logflare.Utils.Debugging 2 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Chase Granberry 2 | Chase Granberry 3 | Chase Granberry 4 | 5 | TzeYiing 6 | 7 | Łukasz Niemier 8 | 9 | Filipe Cabaço 10 | 11 | ontofractal 12 | ontofractal 13 | 14 | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> <27856297+dependabot-preview[bot]@users.noreply.github.com> 15 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | elixir 1.17.3-otp-27 2 | nodejs 18.13.0 3 | rust 1.84.1 4 | erlang 27.1.2 5 | protoc 28.0 -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.14.2 -------------------------------------------------------------------------------- /architecture.md: -------------------------------------------------------------------------------- 1 | # Architecture 2 | 3 | ![Architecture](architecture.drawio.svg) 4 | 5 | ## Log Ingestion 6 | 7 | Log ingestion is on a per-source basis. Each source may have multiple backends, and each backend implements its own pipeline for ingesting the events. 8 | 9 | ## The `SourceSup` 10 | 11 | The `SourceSup` is started on a per-source basis, one per node. It provides all functionality required to interact with a specific source. 12 | 13 | Log events are added to the MemoryBuffer. From there, events are pulled from the MemoryBuffer and into the Broadway pipeline. These log events are then processed and then dispatched in batches to all backend. -------------------------------------------------------------------------------- /assets/css/errors.scss: -------------------------------------------------------------------------------- 1 | .errors.hero { 2 | min-height: 50vh; 3 | background: url("/images/marketing/homepage/bgDesktopTop-4x.png") no-repeat center; 4 | background-size: cover; 5 | padding-bottom: 20px; 6 | position: relative; 7 | overflow: hidden; 8 | } -------------------------------------------------------------------------------- /assets/css/legal.scss: -------------------------------------------------------------------------------- 1 | .grayscale { 2 | filter: grayscale(1); 3 | } -------------------------------------------------------------------------------- /assets/css/live_view.scss: -------------------------------------------------------------------------------- 1 | .phx-click-loading { 2 | cursor: wait !important; 3 | pointer-events: none !important; 4 | } -------------------------------------------------------------------------------- /assets/css/lql.scss: -------------------------------------------------------------------------------- 1 | #lql-rules-container a.modal-link { 2 | color: $brand-brighter-green; 3 | } 4 | -------------------------------------------------------------------------------- /assets/css/media_queries.scss: -------------------------------------------------------------------------------- 1 | @import "mixins"; 2 | 3 | @include tablet { 4 | .value { 5 | margin-right: 15%; 6 | margin-left: 15%; 7 | } 8 | 9 | .live-pause { 10 | width: 100px; 11 | } 12 | } 13 | 14 | @include tablet(max) { 15 | .hide-on-mobile { 16 | display: none !important; 17 | } 18 | 19 | .container { 20 | max-width: 100% !important; 21 | } 22 | 23 | .live-pause { 24 | width: 45px; 25 | } 26 | 27 | .btn { 28 | margin-right: 0; 29 | } 30 | 31 | .parent { 32 | flex-direction: column; 33 | } 34 | 35 | #saved-searches { 36 | float: none; 37 | width: 100%; 38 | margin-bottom: 2em; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /assets/css/modal.scss: -------------------------------------------------------------------------------- 1 | body.modal-open { 2 | overflow: visible; 3 | } 4 | -------------------------------------------------------------------------------- /assets/css/named_variables.scss: -------------------------------------------------------------------------------- 1 | $whitecolor: #ffffff; 2 | $silvercolor: #b7b7b7; 3 | $bluecolor: #ffffff; 4 | $orangecolor: #f1ba58; 5 | $redcolor: #dc3545; 6 | $brand-green: #5eeb8f; 7 | $brand-brighter-green: #63ff99; 8 | $brand-blue: #2155a3; 9 | $brand-light-blue: #6286db; 10 | $brand-fuscia: #e35b8d; 11 | $brand-gray: #9a9a9a; 12 | $brand-black: #161616; 13 | $brand-light-black: #1d1d1d; 14 | $brand-light-gray: #e5e5e5; 15 | $brand-yellow: #fff86c; 16 | $brand-purple: #8e6ddf; 17 | $brand-light-purple: #c7a1ff; -------------------------------------------------------------------------------- /assets/css/oauth.scss: -------------------------------------------------------------------------------- 1 | #authorize-container { 2 | max-width: 400px; 3 | } -------------------------------------------------------------------------------- /assets/css/tailwind.css: -------------------------------------------------------------------------------- 1 | 2 | @tailwind base; 3 | @tailwind components; 4 | @tailwind utilities; 5 | -------------------------------------------------------------------------------- /assets/css/ui.scss: -------------------------------------------------------------------------------- 1 | body.experimental-ui { 2 | & nav.navbar { 3 | max-height: 7vh; 4 | align-items: baseline; 5 | min-height: 55px; 6 | 7 | & .source-name { 8 | margin-top: 0; 9 | color: $brand-black; 10 | } 11 | 12 | & .live-tail-search { 13 | padding-left: 1vw; 14 | font-weight: 400; 15 | color: $brand-black; 16 | } 17 | } 18 | 19 | & main { 20 | margin-top: 110px; 21 | } 22 | } 23 | 24 | .navbar-collapse { 25 | background: #5eeb8f; 26 | padding: 10px; 27 | } -------------------------------------------------------------------------------- /assets/js/interfaces/endpoints/JsonResults.jsx: -------------------------------------------------------------------------------- 1 | const JsonResults = ({data, className = ""}) => ( 2 |
6 |
{JSON.stringify(data, false, 2)}
7 |
8 | ) 9 | 10 | export default JsonResults 11 | -------------------------------------------------------------------------------- /assets/js/interfaces/index.js: -------------------------------------------------------------------------------- 1 | export {default as EndpointEditor} from "./EndpointEditor.jsx" 2 | export {default as EndpointsBrowserList} from "./EndpointsBrowserList.jsx" 3 | export {default as ShowEndpoint} from "./ShowEndpoint.jsx" 4 | -------------------------------------------------------------------------------- /assets/js/live_modal.js: -------------------------------------------------------------------------------- 1 | import $ from "jquery" 2 | export default { 3 | LiveModal: { 4 | updated() {}, 5 | mounted() { 6 | const $modal = $(this.el) 7 | 8 | $modal.modal({backdrop: "static"}) 9 | }, 10 | destroyed() { 11 | $("body").removeClass("modal-open").removeAttr("style") 12 | $(".modal-backdrop").remove() 13 | }, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /assets/js/loader.jsx: -------------------------------------------------------------------------------- 1 | import {DotLoader} from "react-spinners" 2 | 3 | const brandGreen = "#5eeb8f" 4 | 5 | const Loader = () => { 6 | return ( 7 |
15 | 16 |
17 | ) 18 | } 19 | 20 | export default Loader 21 | -------------------------------------------------------------------------------- /assets/js/log_event_live_hooks.js: -------------------------------------------------------------------------------- 1 | import JSONFormatter from "json-formatter-js" 2 | import $ from "jquery" 3 | 4 | let hooks = {} 5 | 6 | hooks.MetadataJsonViewer = { 7 | mounted() { 8 | $(".logflare-tooltip").tooltip({delay: {show: 100, hide: 200}}) 9 | const json = JSON.parse( 10 | this.el.innerText.replace(/\\r/g, "\\\\r").replace(/\\n/g, "\\\\n") 11 | ) 12 | 13 | const formatter = new JSONFormatter(json, Infinity, {theme: "logflare"}) 14 | $("#metadata-viewer").html(formatter.render()) 15 | }, 16 | } 17 | 18 | export default hooks 19 | -------------------------------------------------------------------------------- /assets/js/logs.js: -------------------------------------------------------------------------------- 1 | import $ from "jquery" 2 | 3 | export async function applyToAllLogTimestamps(formatter) { 4 | const timestamps = $(".log-datestamp") 5 | for (let time of timestamps) { 6 | const timestampMs = $(time).data("timestamp") 7 | const datetime = formatter(timestampMs) 8 | $(time).text(datetime) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /assets/js/socket.js: -------------------------------------------------------------------------------- 1 | import "phoenix" 2 | import "phoenix_html" 3 | import {Socket} from "phoenix" 4 | 5 | let socket = new Socket("/socket", { 6 | params: {token: window.userToken, public_token: window.publicToken}, 7 | }) 8 | 9 | socket.connect() 10 | 11 | export default socket 12 | -------------------------------------------------------------------------------- /assets/js/user-config-storage.js: -------------------------------------------------------------------------------- 1 | import * as localforage from "localforage" 2 | 3 | const store = localforage.createInstance({ 4 | name: "userConfig", 5 | }) 6 | 7 | const USE_LOCAL_TIME_KEY = "useLocalTime" 8 | 9 | const init = async () => { 10 | await store.setItem(USE_LOCAL_TIME_KEY, true) 11 | } 12 | 13 | init() 14 | 15 | const flipUseLocalTime = async () => { 16 | const current = await store.getItem(USE_LOCAL_TIME_KEY) 17 | await store.setItem(USE_LOCAL_TIME_KEY, !current) 18 | } 19 | 20 | const useLocalTime = () => store.getItem(USE_LOCAL_TIME_KEY) 21 | 22 | export {flipUseLocalTime, useLocalTime} 23 | -------------------------------------------------------------------------------- /assets/js/user.js: -------------------------------------------------------------------------------- 1 | import $ from "jquery" 2 | import {activateClipboardForSelector} from "./utils" 3 | 4 | export const initEditPage = () => { 5 | activateClipboardForSelector(`#copy-path`) 6 | $("#copy-path").tooltip() 7 | } 8 | 9 | 10 | -------------------------------------------------------------------------------- /assets/js/utils.js: -------------------------------------------------------------------------------- 1 | import ClipboardJS from "clipboard" 2 | 3 | export function activateClipboardForSelector(selector, options) { 4 | const clipboard = new ClipboardJS(selector, options) 5 | 6 | clipboard.on("success", (e) => { 7 | document.getElementById("copy-tooltip").innerHTML = "Copied!" 8 | e.clearSelection() 9 | }) 10 | clipboard.on("error", (e) => { 11 | console.log("Clipboard error!") 12 | e.clearSelection() 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /assets/static/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #5eeb8f 3 | -------------------------------------------------------------------------------- /assets/static/google8cf88cdd193a47a4.html: -------------------------------------------------------------------------------- 1 | google-site-verification: google8cf88cdd193a47a4.html -------------------------------------------------------------------------------- /assets/static/images/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/android-icon-144x144.png -------------------------------------------------------------------------------- /assets/static/images/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/android-icon-192x192.png -------------------------------------------------------------------------------- /assets/static/images/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/android-icon-36x36.png -------------------------------------------------------------------------------- /assets/static/images/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/android-icon-48x48.png -------------------------------------------------------------------------------- /assets/static/images/android-icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/android-icon-512x512.png -------------------------------------------------------------------------------- /assets/static/images/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/android-icon-72x72.png -------------------------------------------------------------------------------- /assets/static/images/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/android-icon-96x96.png -------------------------------------------------------------------------------- /assets/static/images/app/chase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/app/chase.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon-114x114.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon-120x120.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon-144x144.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon-152x152.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon-180x180.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon-57x57.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon-60x60.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon-72x72.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon-76x76.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon-precomposed.png -------------------------------------------------------------------------------- /assets/static/images/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/apple-icon.png -------------------------------------------------------------------------------- /assets/static/images/cloudflare/cloudflare-featured-app-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/cloudflare/cloudflare-featured-app-image.png -------------------------------------------------------------------------------- /assets/static/images/cloudflare/cloudflare-logflare-tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/cloudflare/cloudflare-logflare-tile.png -------------------------------------------------------------------------------- /assets/static/images/cloudflare/full-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/cloudflare/full-screenshot.png -------------------------------------------------------------------------------- /assets/static/images/cloudflare/options-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/cloudflare/options-screenshot.png -------------------------------------------------------------------------------- /assets/static/images/cloudflare/sources-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/cloudflare/sources-screenshot.png -------------------------------------------------------------------------------- /assets/static/images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/favicon-16x16.png -------------------------------------------------------------------------------- /assets/static/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/favicon-32x32.png -------------------------------------------------------------------------------- /assets/static/images/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/favicon-96x96.png -------------------------------------------------------------------------------- /assets/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/favicon.ico -------------------------------------------------------------------------------- /assets/static/images/logflare-example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/logflare-example.gif -------------------------------------------------------------------------------- /assets/static/images/logos/elixir-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/logos/elixir-dark.png -------------------------------------------------------------------------------- /assets/static/images/logos/fluent-bit-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/logos/fluent-bit-logo.png -------------------------------------------------------------------------------- /assets/static/images/logos/javascript-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/logos/javascript-logo.png -------------------------------------------------------------------------------- /assets/static/images/logos/logflare-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/logos/logflare-logo.png -------------------------------------------------------------------------------- /assets/static/images/logos/stream-solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/static/images/marketing/add-a-member.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/add-a-member.png -------------------------------------------------------------------------------- /assets/static/images/marketing/add-chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/add-chart.png -------------------------------------------------------------------------------- /assets/static/images/marketing/add-data-source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/add-data-source.png -------------------------------------------------------------------------------- /assets/static/images/marketing/add-service-account-with-permissions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/add-service-account-with-permissions.png -------------------------------------------------------------------------------- /assets/static/images/marketing/add-to-slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/add-to-slack.png -------------------------------------------------------------------------------- /assets/static/images/marketing/bq-job-user-permissions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/bq-job-user-permissions.png -------------------------------------------------------------------------------- /assets/static/images/marketing/connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/connect.png -------------------------------------------------------------------------------- /assets/static/images/marketing/contact_us/contactBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/contact_us/contactBackground.png -------------------------------------------------------------------------------- /assets/static/images/marketing/contact_us/contactBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/contact_us/contactBg.png -------------------------------------------------------------------------------- /assets/static/images/marketing/create-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/create-report.png -------------------------------------------------------------------------------- /assets/static/images/marketing/edit-source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/edit-source.png -------------------------------------------------------------------------------- /assets/static/images/marketing/find-logflare-source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/find-logflare-source.png -------------------------------------------------------------------------------- /assets/static/images/marketing/get-project-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/get-project-id.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/bigquerylogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/bigquerylogo.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/dataStudioLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/dataStudioLogo.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/dataStudioLogo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/dataStudioLogo2.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/fr1bgimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/fr1bgimg.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/fr3bgimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/fr3bgimg.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/fr4bgimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/fr4bgimg.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/gettingStartedBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/gettingStartedBg.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/guidepageherobg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/guidepageherobg.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/guidesBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/guidesBackground.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/minilogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/minilogo.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/slackLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/slackLogo.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/vercel-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/vercel-logo.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/vercel-setup/browser-log-web-vitals-vercel-pino-logflare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/vercel-setup/browser-log-web-vitals-vercel-pino-logflare.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/vercel-setup/create-vercel-log-drain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/vercel-setup/create-vercel-log-drain.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/vercel-setup/custom-data-object.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/vercel-setup/custom-data-object.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/vercel-setup/custom-object-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/vercel-setup/custom-object-search.png -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/vercel-setup/example-vercel-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/vercel-setup/example-vercel-search.gif -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/vercel-setup/vercel-build-logs.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/vercel-setup/vercel-build-logs.gif -------------------------------------------------------------------------------- /assets/static/images/marketing/guides/vercel-setup/vercel-build-rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/guides/vercel-setup/vercel-build-rule.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/bgDesktopTop-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/bgDesktopTop-4x.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/bgDesktopTop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/bgDesktopTop.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/bgbtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/bgbtn.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/bgoftable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/bgoftable.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/bgtop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/bgtop.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/catchImgDesktop-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/catchImgDesktop-4x.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/catchImgDesktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/catchImgDesktop.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/footerbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/footerbg.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/forphontest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/forphontest.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/heroimg11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/heroimg11.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/heroimg12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/heroimg12.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/imgphone1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/imgphone1.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/imgphone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/imgphone2.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/installbtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/installbtn.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/iphoneDesktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/iphoneDesktop.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/logo.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/quote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/quote.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/sliderimg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/sliderimg2.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/sliderimg3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/sliderimg3.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/statusc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/statusc.png -------------------------------------------------------------------------------- /assets/static/images/marketing/homepage/trackImgDesktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/homepage/trackImgDesktop.png -------------------------------------------------------------------------------- /assets/static/images/marketing/navigate-to-iam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/navigate-to-iam.png -------------------------------------------------------------------------------- /assets/static/images/marketing/pricing/pricingDesktopBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/pricing/pricingDesktopBackground.png -------------------------------------------------------------------------------- /assets/static/images/marketing/select-bigquery-connector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/select-bigquery-connector.png -------------------------------------------------------------------------------- /assets/static/images/marketing/select-data-source-and-default-date-range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/select-data-source-and-default-date-range.png -------------------------------------------------------------------------------- /assets/static/images/marketing/select-data-source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/select-data-source.png -------------------------------------------------------------------------------- /assets/static/images/marketing/select-partition-option.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/select-partition-option.png -------------------------------------------------------------------------------- /assets/static/images/marketing/select-report-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/select-report-settings.png -------------------------------------------------------------------------------- /assets/static/images/marketing/set-project-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/set-project-id.png -------------------------------------------------------------------------------- /assets/static/images/marketing/set-source-ttl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/set-source-ttl.png -------------------------------------------------------------------------------- /assets/static/images/marketing/set-timestamp-to-date-hour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/set-timestamp-to-date-hour.png -------------------------------------------------------------------------------- /assets/static/images/marketing/slack-notifications-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/marketing/slack-notifications-example.png -------------------------------------------------------------------------------- /assets/static/images/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/ms-icon-144x144.png -------------------------------------------------------------------------------- /assets/static/images/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/ms-icon-150x150.png -------------------------------------------------------------------------------- /assets/static/images/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/ms-icon-310x310.png -------------------------------------------------------------------------------- /assets/static/images/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/assets/static/images/ms-icon-70x70.png -------------------------------------------------------------------------------- /assets/static/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /assets/static/worker.js: -------------------------------------------------------------------------------- 1 | self.addEventListener('install', event => { 2 | event.waitUntil( 3 | caches 4 | .open('my-site-name') 5 | .then(cache => 6 | cache.addAll([ 7 | 8 | ]) 9 | ) 10 | ) 11 | }) 12 | 13 | self.addEventListener('fetch', event => { 14 | event.respondWith( 15 | caches.match(event.request).then(response => { 16 | if (response) { 17 | //we found an entry in the cache! 18 | return response 19 | } 20 | return fetch(event.request) 21 | }) 22 | ) 23 | }) 24 | -------------------------------------------------------------------------------- /assets/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | "./**/*.{js,jsx,ts,tsx}", 5 | "../lib/logflare_web/*.{eex,leex,heex,ex}", 6 | "../lib/logflare_web/**/*.{eex,leex,heex,ex}", 7 | ], 8 | theme: { 9 | extend: {}, 10 | }, 11 | plugins: [], 12 | prefix: "tw-", 13 | // TODO: remove when sass is reduced. 14 | important: true, 15 | // TODO: remove once bootstrap removed (?) 16 | corePlugins: { 17 | preflight: false, 18 | }, 19 | }; 20 | -------------------------------------------------------------------------------- /cloudbuild/.dev.env.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.dev.env.enc -------------------------------------------------------------------------------- /cloudbuild/.prod.cacert.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.prod.cacert.pem.enc -------------------------------------------------------------------------------- /cloudbuild/.prod.cert.key.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.prod.cert.key.enc -------------------------------------------------------------------------------- /cloudbuild/.prod.cert.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.prod.cert.pem.enc -------------------------------------------------------------------------------- /cloudbuild/.prod.db-client-cert.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.prod.db-client-cert.pem.enc -------------------------------------------------------------------------------- /cloudbuild/.prod.db-client-key.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.prod.db-client-key.pem.enc -------------------------------------------------------------------------------- /cloudbuild/.prod.db-server-ca.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.prod.db-server-ca.pem.enc -------------------------------------------------------------------------------- /cloudbuild/.prod.env.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.prod.env.enc -------------------------------------------------------------------------------- /cloudbuild/.prod.gcloud.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.prod.gcloud.json.enc -------------------------------------------------------------------------------- /cloudbuild/.staging.cacert.key.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.staging.cacert.key.enc -------------------------------------------------------------------------------- /cloudbuild/.staging.cacert.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.staging.cacert.pem.enc -------------------------------------------------------------------------------- /cloudbuild/.staging.cert.key.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.staging.cert.key.enc -------------------------------------------------------------------------------- /cloudbuild/.staging.cert.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.staging.cert.pem.enc -------------------------------------------------------------------------------- /cloudbuild/.staging.db-client-cert.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.staging.db-client-cert.pem.enc -------------------------------------------------------------------------------- /cloudbuild/.staging.db-client-key.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.staging.db-client-key.pem.enc -------------------------------------------------------------------------------- /cloudbuild/.staging.db-server-ca.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.staging.db-server-ca.pem.enc -------------------------------------------------------------------------------- /cloudbuild/.staging.env.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.staging.env.enc -------------------------------------------------------------------------------- /cloudbuild/.staging.gcloud.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/cloudbuild/.staging.gcloud.json.enc -------------------------------------------------------------------------------- /cloudbuild/secret_setup.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG TAG_VERSION 2 | FROM supabase/logflare:${TAG_VERSION} 3 | 4 | RUN apt-get update && apt-get -y install tini 5 | COPY .secrets.env /tmp/.secrets.env 6 | COPY gcloud.json gcloud.json 7 | COPY cert.pem cert.pem 8 | COPY cert.key cert.key 9 | COPY db-client-cert.pem db-client-cert.pem 10 | COPY db-client-key.pem db-client-key.pem 11 | COPY db-server-ca.pem db-server-ca.pem 12 | 13 | COPY ./cloudbuild/startup.sh /opt/app/rel/logflare/bin/startup.sh 14 | 15 | ENTRYPOINT ["tini", "--"] 16 | 17 | CMD ["sh", "run.sh"] 18 | -------------------------------------------------------------------------------- /cloudbuild/shutdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # echo $PWD 4 | 5 | NODE_IP=$(curl \ 6 | -s "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip" \ 7 | -H "Metadata-Flavor: Google") 8 | 9 | NODE=logflare@$NODE_IP 10 | 11 | echo "Stopping node $NODE" 12 | 13 | curl -X "POST" "https://api.logflarestaging.com/api/logs?source=$LOGFLARE_LOGGER_BACKEND_SOURCE_ID" \ 14 | -H 'Content-Type: application/json' \ 15 | -H "X-API-KEY: $LOGFLARE_LOGGER_BACKEND_API_KEY" \ 16 | -d $"{ 17 | \"message\": \"Stopping node $NODE\" 18 | }" 19 | 20 | curl -X "PUT" "http://localhost:4000/admin/shutdown?code=$LOGFLARE_NODE_SHUTDOWN_CODE" 21 | 22 | sleep 20 23 | 24 | echo "Stopped node $NODE" -------------------------------------------------------------------------------- /coveralls.json: -------------------------------------------------------------------------------- 1 | { 2 | "coverage_options": { 3 | "minimum_coverage": 20 4 | }, 5 | "skip_files": [ 6 | "test", 7 | "lib/mix" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /docker-compose.supabase.yml: -------------------------------------------------------------------------------- 1 | services: 2 | logflare: 3 | environment: 4 | POSTGRES_BACKEND_URL: postgresql://postgres:postgres@db:5432/logflare_docker 5 | volumes: !override 6 | - type: bind 7 | source: ${PWD}/.docker.env 8 | target: /tmp/.secrets.env 9 | read_only: true 10 | -------------------------------------------------------------------------------- /docs/docs.logflare.com/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /docs/docs.logflare.com/.tool-versions: -------------------------------------------------------------------------------- 1 | nodejs 22.9.0 -------------------------------------------------------------------------------- /docs/docs.logflare.com/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/alerts/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Alerts", 3 | "collapsible": true, 4 | "collapsed": true, 5 | "position": 6, 6 | "link": { 7 | "type": "generated-index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/alerts/slack/add-to-slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/alerts/slack/add-to-slack.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/alerts/slack/edit-source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/alerts/slack/edit-source.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/alerts/slack/slack-notifications-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/alerts/slack/slack-notifications-example.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Backends", 3 | "collapsible": true, 4 | "collapsed": true, 5 | "position": 5, 6 | "link": { 7 | "type": "doc", 8 | "id": "backends/index" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/add-a-member.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/add-a-member.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/add-service-account-with-permissions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/add-service-account-with-permissions.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/bigquery-connector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/bigquery-connector.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/bq-job-user-permissions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/bq-job-user-permissions.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/connect-data-studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/connect-data-studio.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/data-studio-configure-date-range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/data-studio-configure-date-range.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/data-studio-create-chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/data-studio-create-chart.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/data-studio-create-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/data-studio-create-report.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/data-studio-report-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/data-studio-report-settings.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/data-studio-timestamp-type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/data-studio-timestamp-type.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/find-logflare-source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/find-logflare-source.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/get-project-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/get-project-id.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/navigate-to-iam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/navigate-to-iam.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/open-data-studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/open-data-studio.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/partitioned-table-time-dimension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/partitioned-table-time-dimension.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/set-project-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/set-project-id.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/bigquery/set-source-ttl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/backends/bigquery/set-source-ttl.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/backends/webhook.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | # Webhook 5 | 6 | The Webhook backend will send batched events to a desired HTTP(S) destination. 7 | 8 | ## Behaviour and configurations 9 | ### Configuration 10 | 11 | The following values are required when creating a webhook backend: 12 | 13 | - `url`: (`string`, required) a valid HTTP(S) endpoint. 14 | 15 | ### Request 16 | The request made will be a `POST`. 17 | 18 | ### Batching 19 | 20 | Events will be sent in batches of up to 250, with intervals of up to 1 second. -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/case-studies/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Case Studies", 3 | "collapsible": false, 4 | "collapsed": false, 5 | "position": 7, 6 | "link": { 7 | "type": "generated-index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/case-studies/supabase/supabase-acquires-logflare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/case-studies/supabase/supabase-acquires-logflare.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Introduction", 3 | "collapsible": false, 4 | "collapsed": false, 5 | "position": 1, 6 | "link": { 7 | "type": "doc", 8 | "id": "concepts/index" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/access-tokens/create-access-token-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/concepts/access-tokens/create-access-token-button.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/access-tokens/create-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/concepts/access-tokens/create-description.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/access-tokens/create-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/concepts/access-tokens/create-success.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/access-tokens/revoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/concepts/access-tokens/revoke.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/ingestion/backend-ttl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/concepts/ingestion/backend-ttl.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/ingestion/rules-navigate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/concepts/ingestion/rules-navigate.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/ingestion/schema-reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/concepts/ingestion/schema-reference.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/ingestion/search-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/concepts/ingestion/search-ui.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/ingestion/source-rules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/concepts/ingestion/source-rules.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/concepts/lql/lql-reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/concepts/lql/lql-reference.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/integrations/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Integrations", 3 | "collapsible": true, 4 | "collapsed": true, 5 | "position": 6, 6 | "link": { 7 | "type": "generated-index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/integrations/vercel/create-vercel-log-drain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/integrations/vercel/create-vercel-log-drain.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/integrations/vercel/example-log-event.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/integrations/vercel/example-log-event.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/integrations/vercel/example-logs-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/integrations/vercel/example-logs-view.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/integrations/vercel/example-vercel-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/integrations/vercel/example-vercel-search.gif -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/integrations/vercel/vercel-build-logs.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/integrations/vercel/vercel-build-logs.gif -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/integrations/vercel/vercel-lql-search-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/integrations/vercel/vercel-lql-search-example.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/integrations/vercel/vercel-routing-rules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/integrations/vercel/vercel-routing-rules.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/self-hosting/add-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/self-hosting/add-key.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/docs/self-hosting/service-account-mange-keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/docs/self-hosting/service-account-mange-keys.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/src/components/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/src/components/index.ts -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/.nojekyll -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/android-icon-144x144.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/android-icon-192x192.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/android-icon-36x36.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/android-icon-48x48.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/android-icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/android-icon-512x512.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/android-icon-72x72.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/android-icon-96x96.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon-114x114.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon-120x120.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon-144x144.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon-152x152.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon-180x180.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon-57x57.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon-60x60.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon-72x72.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon-76x76.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon-precomposed.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/apple-icon.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/backends/add-a-member.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/backends/add-a-member.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/backends/add-service-account-with-permissions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/backends/add-service-account-with-permissions.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/backends/bq-job-user-permissions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/backends/bq-job-user-permissions.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/backends/get-project-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/backends/get-project-id.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/backends/navigate-to-iam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/backends/navigate-to-iam.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/backends/set-project-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/backends/set-project-id.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/backends/set-source-ttl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/backends/set-source-ttl.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/dashboard-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/dashboard-dark.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/dashboard.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/favicon-16x16.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/favicon-32x32.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/favicon-96x96.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/favicon.ico -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/logflare-example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/logflare-example.gif -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/ms-icon-144x144.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/ms-icon-150x150.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/ms-icon-310x310.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/static/img/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Logflare/logflare/d1a37db53170a1be8ea015007b3606651689ce23/docs/docs.logflare.com/static/img/ms-icon-70x70.png -------------------------------------------------------------------------------- /docs/docs.logflare.com/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // This file is not used in compilation. It is here just for a nice editor experience. 3 | "extends": "@tsconfig/docusaurus/tsconfig.json", 4 | "compilerOptions": { 5 | "baseUrl": "." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/logflare.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare do 2 | @moduledoc """ 3 | Logflare keeps the contexts that define your domain 4 | and business logic. 5 | 6 | Contexts are also responsible for managing your data, regardless 7 | if it comes from the database, an external API or others. 8 | """ 9 | end 10 | -------------------------------------------------------------------------------- /lib/logflare/admin.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Admin do 2 | @moduledoc false 3 | require Logger 4 | 5 | @doc """ 6 | Shuts down a given node asyncronously in a separate process. 7 | 8 | A delay (default is 5s) occurs just before systen stop is triggered. 9 | """ 10 | @spec shutdown(node(), integer()) :: {:ok, Task.t()} 11 | def shutdown(node \\ Node.self(), delay \\ 5000) when is_atom(node) do 12 | task = 13 | Task.async(fn -> 14 | Logger.warning("Node shutdown initialized, shutting down in #{delay}ms. node=#{node}") 15 | Process.sleep(delay) 16 | 17 | :rpc.eval_everywhere([node], System, :stop, []) 18 | end) 19 | 20 | {:ok, task} 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/logflare/alerting/alerts_scheduler.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Alerting.AlertsScheduler do 2 | use Quantum, otp_app: :logflare, restart: :transient 3 | alias Logflare.Alerting 4 | require Logger 5 | @impl Quantum 6 | def init(config) do 7 | jobs = Alerting.init_alert_jobs() 8 | Keyword.put(config, :jobs, jobs) 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/logflare/backends/adaptor/postgres_adaptor/pg_log_event.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Backends.Adaptor.PostgresAdaptor.PgLogEvent do 2 | @moduledoc """ 3 | Logflare Log Event schema to be used by the Postgres Adaptor 4 | """ 5 | use TypedEctoSchema 6 | import Ecto.Changeset 7 | 8 | @primary_key {:id, :string, []} 9 | typed_schema "log_event" do 10 | field(:body, :map) 11 | field(:event_message, :string) 12 | field(:timestamp, :utc_datetime_usec) 13 | end 14 | 15 | def changeset(log_event, attrs) do 16 | log_event 17 | |> cast(attrs, [:id, :body, :timestamp, :event_message]) 18 | |> validate_required([:id, :timestamp, :event_message]) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/logflare/backends/adaptor/slack_adaptor/client.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Backends.Adaptor.SlackAdaptor.Client do 2 | @moduledoc false 3 | 4 | use Tesla 5 | require Logger 6 | 7 | plug Tesla.Middleware.Retry, 8 | delay: 500, 9 | max_retries: 3, 10 | max_delay: 4_000, 11 | should_retry: fn 12 | {:ok, %{status: status}} when status in 400..599 -> true 13 | {:ok, _} -> false 14 | {:error, _} -> true 15 | end 16 | 17 | plug Tesla.Middleware.JSON 18 | 19 | def send(url, %{blocks: _} = body) when is_binary(url) do 20 | post(url, body) 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/logflare/backends/cache_warmer.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Backends.CacheWarmer do 2 | alias Logflare.Backends 3 | 4 | use Cachex.Warmer 5 | @impl true 6 | def execute(_state) do 7 | backends = Backends.list_backends(ingesting: true, limit: 1_000) 8 | 9 | get_kv = 10 | for b <- backends do 11 | {{:get_backend, [b.id]}, {:cached, b}} 12 | end 13 | 14 | {:ok, get_kv} 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/logflare/backends/source_backend.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Backends.SourcesBackend do 2 | @moduledoc false 3 | use TypedEctoSchema 4 | 5 | alias Logflare.Backends.Backend 6 | alias Logflare.Source 7 | 8 | typed_schema "sources_backends" do 9 | belongs_to(:source, Source) 10 | belongs_to(:backend, Backend) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/logflare/billing/billing_count.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Billing.BillingCount do 2 | @moduledoc false 3 | use Ecto.Schema 4 | import Ecto.Changeset 5 | 6 | schema "billing_counts" do 7 | field :count, :integer 8 | field :node, :string 9 | belongs_to :user, Logflare.User 10 | belongs_to :source, Logflare.Source 11 | timestamps() 12 | end 13 | 14 | @doc false 15 | def changeset(billing_counts, attrs) do 16 | billing_counts 17 | |> cast(attrs, [:node, :count]) 18 | |> validate_required([:node, :count]) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/logflare/ecto/ecto_atom_t.ex: -------------------------------------------------------------------------------- 1 | defmodule Ecto.Atom do 2 | @moduledoc false 3 | @behaviour Ecto.Type 4 | 5 | def type, do: :string 6 | 7 | def cast(value) when is_atom(value), do: {:ok, value} 8 | def cast(_), do: :error 9 | 10 | def load(value), do: {:ok, String.to_existing_atom(value)} 11 | 12 | def dump(value) when is_atom(value), do: {:ok, Atom.to_string(value)} 13 | def dump(_), do: :error 14 | 15 | def embed_as(_) do 16 | :self 17 | end 18 | 19 | def equal?(term1, term2) do 20 | term1 === term2 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /lib/logflare/ecto/ecto_term_t.ex: -------------------------------------------------------------------------------- 1 | defmodule Ecto.Term do 2 | @moduledoc """ 3 | Generitc Erlang term type 4 | """ 5 | 6 | @behaviour Ecto.Type 7 | 8 | @spec type :: :binary 9 | def type, do: :binary 10 | 11 | def cast(value) do 12 | {:ok, value} 13 | end 14 | 15 | @spec load(any) :: :error | {:ok, any} 16 | def load(value) do 17 | try do 18 | {:ok, :erlang.binary_to_term(value)} 19 | rescue 20 | e in ArgumentError -> {:error, e} 21 | end 22 | end 23 | 24 | def dump(value) do 25 | {:ok, :erlang.term_to_binary(value)} 26 | end 27 | 28 | def embed_as(_) do 29 | :self 30 | end 31 | 32 | def equal?(term1, term2) do 33 | term1 === term2 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /lib/logflare/ecto/encrypted_map.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Ecto.EncryptedMap do 2 | use Cloak.Ecto.Map, vault: Logflare.Vault 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare/google/bigquery/debug.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Google.BigQuery.Debug do 2 | @moduledoc false 3 | def gen_bq_ui_url(user, source_token) when is_binary(source_token) do 4 | base = "https://console.cloud.google.com/bigquery" 5 | 6 | token = String.replace(source_token, "-", "_") 7 | 8 | project = 9 | user.bigquery_project_id || Application.get_env(:logflare, Logflare.Google)[:project_id] 10 | 11 | dataset = user.bigquery_dataset_id || "#{user.id}_prod" 12 | 13 | base <> 14 | "?project=#{project}&p=#{project}&d=#{dataset}&t=#{token}&page=table&authuser=#{user.email}" 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/logflare/google/gcp_config.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Google.BigQuery.GCPConfig do 2 | @moduledoc """ 3 | Utility functions for Google Cloud configuration 4 | """ 5 | @default_dataset_location "US" 6 | 7 | def default_project_id() do 8 | Application.get_env(:logflare, Logflare.Google)[:project_id] 9 | end 10 | 11 | def dataset_id_append() do 12 | Application.get_env(:logflare, Logflare.Google)[:dataset_id_append] 13 | end 14 | 15 | def default_dataset_location() do 16 | @default_dataset_location 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/logflare/logs/browser_report.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Logs.BrowserReport do 2 | @moduledoc false 3 | require Logger 4 | 5 | @behaviour Logflare.Logs.Processor 6 | 7 | def handle_batch(batch, _source) when is_list(batch) do 8 | Enum.map(batch, &handle_event/1) 9 | end 10 | 11 | def handle_event(params) when is_map(params) do 12 | %{ 13 | "message" => message(params), 14 | "metadata" => params 15 | } 16 | end 17 | 18 | def message(params) do 19 | Jason.encode_to_iodata!(params) 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/logflare/logs/generic_json.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Logs.GenericJson do 2 | @moduledoc false 3 | require Logger 4 | 5 | @behaviour Logflare.Logs.Processor 6 | 7 | def handle_batch(batch, _source) when is_list(batch) do 8 | Enum.map(batch, &handle_event/1) 9 | end 10 | 11 | def handle_event(params) when is_map(params) do 12 | %{ 13 | "message" => message(params), 14 | "metadata" => params 15 | } 16 | end 17 | 18 | def message(params) do 19 | Jason.encode!(params) 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/logflare/logs/logflare_gen_decorators.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.GenDecorators do 2 | @moduledoc """ 3 | A collection of generic decorator functions for Decorators 4 | """ 5 | use Decorator.Define, pass_through_on_error_field: 0 6 | 7 | def pass_through_on_error_field(body, %{args: [map]}) do 8 | quote do 9 | if is_nil(unquote(map).error) do 10 | unquote(body) 11 | else 12 | unquote(map) 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/logflare/logs/lql/lql_chart_rule.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Lql.ChartRule do 2 | @moduledoc false 3 | use TypedEctoSchema 4 | import Ecto.Changeset 5 | @derive {Jason.Encoder, []} 6 | 7 | @primary_key false 8 | typed_embedded_schema do 9 | field :path, :string, virtual: true, default: "timestamp" 10 | field :value_type, Ecto.Atom, virtual: true 11 | field :period, Ecto.Atom, virtual: true, default: :minute 12 | field :aggregate, Ecto.Atom, virtual: true, default: :count 13 | end 14 | 15 | def build_from_path(path) do 16 | %__MODULE__{} 17 | |> cast(%{path: path}, __MODULE__.__schema__(:fields)) 18 | |> Map.get(:changes) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/logflare/logs/raw.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Logs.Raw do 2 | @behaviour Logflare.Logs.Processor 3 | 4 | def handle_batch(data, _source), do: data 5 | end 6 | -------------------------------------------------------------------------------- /lib/logflare/logs/search/logs_search_live_support.ex: -------------------------------------------------------------------------------- 1 | defmodule Logsflare.Source.SearchLV.Support do 2 | @moduledoc false 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare/logs/source_parsers/syslog_message.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Logs.SyslogMessage do 2 | @moduledoc """ 3 | Parsed syslog message format. 4 | """ 5 | use TypedStruct 6 | 7 | typedstruct do 8 | field :sd, list(map) 9 | field :logfmt, map() 10 | 11 | field :priority, integer() 12 | field :facility, integer() 13 | field :severity, integer() 14 | field :hostname, binary() 15 | field :appname, binary() 16 | field :process_id, binary() 17 | 18 | field :message, binary() 19 | field :message_id, binary() 20 | field :message_raw, binary() 21 | field :message_text, binary() 22 | 23 | field :timestamp, NaiveDateTime.t() 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/logflare/mailer.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Mailer do 2 | @moduledoc false 3 | use Swoosh.Mailer, otp_app: :logflare 4 | end 5 | -------------------------------------------------------------------------------- /lib/logflare/oauth_access_grants/oauth_access_grant.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.OauthAccessGrants.OauthAccessGrant do 2 | @moduledoc false 3 | use TypedEctoSchema 4 | use ExOauth2Provider.AccessGrants.AccessGrant, otp_app: :logflare 5 | 6 | typed_schema "oauth_access_grants" do 7 | access_grant_fields() 8 | 9 | timestamps(updated_at: false) 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/logflare/oauth_access_tokens/oauth_access_token.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.OauthAccessTokens.OauthAccessToken do 2 | @moduledoc false 3 | use TypedEctoSchema 4 | use ExOauth2Provider.AccessTokens.AccessToken, otp_app: :logflare 5 | 6 | @derive {Jason.Encoder, 7 | only: [ 8 | :id, 9 | :token, 10 | :scopes, 11 | :inserted_at, 12 | :description 13 | ]} 14 | 15 | typed_schema "oauth_access_tokens" do 16 | access_token_fields() 17 | field(:description, :string) 18 | timestamps() 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/logflare/oauth_access_tokens/partner_oauth_access_token.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.OauthAccessTokens.PartnerOauthAccessToken do 2 | @moduledoc false 3 | use TypedEctoSchema 4 | use ExOauth2Provider.AccessTokens.AccessToken, otp_app: :logflare 5 | 6 | typed_schema "oauth_access_tokens" do 7 | belongs_to(:resource_owner, Logflare.Partners.Partner) 8 | 9 | access_token_fields() 10 | field(:description, :string) 11 | timestamps() 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/logflare/oauth_applications/oauth_application.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.OauthApplications.OauthApplication do 2 | @moduledoc false 3 | use TypedEctoSchema 4 | use ExOauth2Provider.Applications.Application, otp_app: :logflare 5 | 6 | typed_schema "oauth_applications" do 7 | application_fields() 8 | 9 | timestamps() 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/logflare/oauth_applications/partner_oauth_application.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.OauthApplications.PartnerOauthApplication do 2 | @moduledoc false 3 | use TypedEctoSchema 4 | use ExOauth2Provider.Applications.Application, otp_app: :logflare 5 | 6 | typed_schema "oauth_applications" do 7 | belongs_to :owner, Logflare.Partners.Partner 8 | 9 | application_fields() 10 | 11 | timestamps() 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /lib/logflare/partners/partner.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Partners.Partner do 2 | use Ecto.Schema 3 | import Ecto.Changeset 4 | alias Logflare.User 5 | 6 | schema "partners" do 7 | field :name, :string 8 | field :token, Ecto.UUID, autogenerate: {Ecto.UUID, :generate, []} 9 | 10 | many_to_many :users, User, join_through: "partner_users" 11 | end 12 | 13 | def changeset(partner, params) do 14 | partner 15 | |> cast(params, [:name]) 16 | |> validate_required([:name]) 17 | |> unique_constraint([:name]) 18 | |> unique_constraint([:token]) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/logflare/release.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Release do 2 | require Logger 3 | @app :logflare 4 | 5 | def migrate do 6 | Logger.info("Starting migration") 7 | Application.ensure_all_started(:ssl) 8 | 9 | for repo <- repos() do 10 | {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true)) 11 | end 12 | 13 | Logger.info("Migration finished") 14 | end 15 | 16 | def rollback(repo, version) do 17 | {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version)) 18 | end 19 | 20 | defp repos do 21 | Application.fetch_env!(@app, :ecto_repos) 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/logflare/sources/rate_counters.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Sources.RateCounters do 2 | @moduledoc false 3 | 4 | use GenServer 5 | 6 | require Logger 7 | 8 | @ets_table_name :rate_counters 9 | 10 | def start_link(args \\ []) do 11 | GenServer.start_link(__MODULE__, args, name: __MODULE__) 12 | end 13 | 14 | def init(state) do 15 | Logger.info("Rate counter table started!") 16 | :ets.new(@ets_table_name, [:public, :named_table]) 17 | {:ok, state} 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/logflare/system_metric.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.SystemMetric do 2 | @moduledoc false 3 | use TypedEctoSchema 4 | import Ecto.Changeset 5 | 6 | typed_schema "system_metrics" do 7 | field :all_logs_logged, :integer 8 | field :node, :string 9 | 10 | timestamps() 11 | end 12 | 13 | def changeset(system_metric, attrs) do 14 | system_metric 15 | |> cast(attrs, [:all_logs_logged, :node]) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/logflare/teams/team.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Teams.Team do 2 | @moduledoc false 3 | import Ecto.Changeset 4 | use TypedEctoSchema 5 | 6 | @derive {Jason.Encoder, only: [:name, :user, :team_users, :token]} 7 | typed_schema "teams" do 8 | field :name, :string 9 | field :token, :string, autogenerate: {Ecto.UUID, :generate, []} 10 | belongs_to :user, Logflare.User 11 | has_many :team_users, Logflare.TeamUsers.TeamUser 12 | 13 | timestamps() 14 | end 15 | 16 | @doc false 17 | def changeset(team, attrs) do 18 | team 19 | |> cast(attrs, [:name]) 20 | |> validate_required([:name]) 21 | |> unique_constraint(:token) 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/logflare/users/user_preferences.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Users.UserPreferences do 2 | @moduledoc false 3 | use TypedEctoSchema 4 | import Ecto.Changeset 5 | 6 | typed_embedded_schema do 7 | field :timezone, :string 8 | end 9 | 10 | def changeset(user_prefs, attrs \\ %{}) do 11 | user_prefs 12 | |> cast(attrs, [:timezone]) 13 | |> validate_required([:timezone]) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/logflare/utils/json.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.JSON do 2 | @moduledoc false 3 | 4 | def decode(iodata, options \\ []) do 5 | Jason.decode(iodata, options) 6 | end 7 | 8 | def decode!(iodata, options \\ []) do 9 | Jason.decode!(iodata, options) 10 | end 11 | 12 | def encode(iodata, options \\ []) do 13 | Jason.encode(iodata, options) 14 | end 15 | 16 | def encode!(iodata, options \\ []) do 17 | Jason.encode!(iodata, options) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/logflare/utils/map.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Utils.Map do 2 | @doc """ 3 | Retrieves a key, regardless of whether it is a string map or an atom map 4 | 5 | iex> #{__MODULE__}.get(%{test: 123}, :test) 6 | 123 7 | iex> #{__MODULE__}.get(%{"test"=> 123}, :test) 8 | 123 9 | """ 10 | @spec get(map :: map(), key :: atom()) :: term() | nil 11 | def get(map, key) when is_atom(key) do 12 | Map.get(map, key) || Map.get(map, Atom.to_string(key)) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/logflare/utils/maybe.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.TypeCasts do 2 | @moduledoc false 3 | def maybe_string_to_integer_or_zero(nil), do: 0 4 | def maybe_string_to_integer_or_zero(s) when is_integer(s), do: s 5 | def maybe_string_to_integer_or_zero(s) when is_binary(s), do: String.to_integer(s) 6 | end 7 | -------------------------------------------------------------------------------- /lib/logflare_grpc/endpoint.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareGrpc.Endpoint do 2 | use GRPC.Endpoint 3 | 4 | intercept(GRPC.Server.Interceptors.Logger, level: :info) 5 | run(LogflareGrpc.Trace.Server) 6 | end 7 | -------------------------------------------------------------------------------- /lib/logflare_grpc/google/rpc/code.pb.ex: -------------------------------------------------------------------------------- 1 | defmodule Google.Rpc.Code do 2 | @moduledoc false 3 | 4 | use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" 5 | 6 | field :OK, 0 7 | field :CANCELLED, 1 8 | field :UNKNOWN, 2 9 | field :INVALID_ARGUMENT, 3 10 | field :DEADLINE_EXCEEDED, 4 11 | field :NOT_FOUND, 5 12 | field :ALREADY_EXISTS, 6 13 | field :PERMISSION_DENIED, 7 14 | field :UNAUTHENTICATED, 16 15 | field :RESOURCE_EXHAUSTED, 8 16 | field :FAILED_PRECONDITION, 9 17 | field :ABORTED, 10 18 | field :OUT_OF_RANGE, 11 19 | field :UNIMPLEMENTED, 12 20 | field :INTERNAL, 13 21 | field :UNAVAILABLE, 14 22 | field :DATA_LOSS, 15 23 | end 24 | -------------------------------------------------------------------------------- /lib/logflare_grpc/google/rpc/context/audit_context.pb.ex: -------------------------------------------------------------------------------- 1 | defmodule Google.Rpc.Context.AuditContext do 2 | @moduledoc false 3 | 4 | use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" 5 | 6 | field :audit_log, 1, type: :bytes, json_name: "auditLog" 7 | field :scrubbed_request, 2, type: Google.Protobuf.Struct, json_name: "scrubbedRequest" 8 | field :scrubbed_response, 3, type: Google.Protobuf.Struct, json_name: "scrubbedResponse" 9 | field :scrubbed_response_item_count, 4, type: :int32, json_name: "scrubbedResponseItemCount" 10 | field :target_resource, 5, type: :string, json_name: "targetResource" 11 | end 12 | -------------------------------------------------------------------------------- /lib/logflare_grpc/google/rpc/status.pb.ex: -------------------------------------------------------------------------------- 1 | defmodule Google.Rpc.Status do 2 | @moduledoc false 3 | 4 | use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" 5 | 6 | field :code, 1, type: :int32 7 | field :message, 2, type: :string 8 | field :details, 3, repeated: true, type: Google.Protobuf.Any 9 | end 10 | -------------------------------------------------------------------------------- /lib/logflare_grpc/identity_compressor.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareGrpc.IdentityCompressor do 2 | @behaviour GRPC.Compressor 3 | 4 | def name do 5 | "identity" 6 | end 7 | 8 | def compress(data) do 9 | data 10 | end 11 | 12 | def decompress(data) do 13 | data 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/logflare_grpc/opentelemetry/proto/resource/v1/resource.pb.ex: -------------------------------------------------------------------------------- 1 | defmodule Opentelemetry.Proto.Resource.V1.Resource do 2 | @moduledoc false 3 | 4 | use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0" 5 | 6 | field :attributes, 1, repeated: true, type: Opentelemetry.Proto.Common.V1.KeyValue 7 | field :dropped_attributes_count, 2, type: :uint32, json_name: "droppedAttributesCount" 8 | end 9 | -------------------------------------------------------------------------------- /lib/logflare_web/channels/everyone_channel.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.EveryoneChannel do 2 | @moduledoc false 3 | use LogflareWeb, :channel 4 | 5 | def join("everyone", _payload, socket) do 6 | {:ok, socket} 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/logflare_web/controllers/plugs/buffer_limiter.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Plugs.BufferLimiter do 2 | @moduledoc """ 3 | A plug that allows or denies API action based on the API request rate rules for user/source 4 | """ 5 | import Plug.Conn 6 | alias Logflare.Backends 7 | 8 | def init(_opts), do: nil 9 | 10 | def call(%{assigns: %{source: source}} = conn, _opts \\ []) do 11 | if Backends.cached_local_pending_buffer_full?(source) do 12 | conn 13 | |> send_resp(429, "Buffer full: Too many requests") 14 | |> halt() 15 | else 16 | conn 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/logflare_web/controllers/plugs/check_admin.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Plugs.CheckAdmin do 2 | @moduledoc """ 3 | Verifies that user is admin 4 | """ 5 | use Plug.Builder 6 | 7 | import Plug.Conn 8 | import Phoenix.Controller 9 | 10 | alias LogflareWeb.ErrorView 11 | 12 | def call(%{assigns: %{user: %{admin: true}}} = c, _params), do: c 13 | 14 | def call(conn, _params) do 15 | conn 16 | |> put_status(403) 17 | |> put_view(ErrorView) 18 | |> render("403_page.html") 19 | |> halt() 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/logflare_web/controllers/plugs/ensure_source_started.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Plugs.EnsureSourceStarted do 2 | @moduledoc """ 3 | Verifies that user is admin 4 | """ 5 | use Plug.Builder 6 | 7 | require Logger 8 | 9 | alias Logflare.Source.Supervisor 10 | 11 | def call(%{assigns: %{source: source}} = conn, _params) do 12 | :ok = Supervisor.ensure_started(source) 13 | 14 | conn 15 | end 16 | 17 | def call(conn, _params), do: conn 18 | end 19 | -------------------------------------------------------------------------------- /lib/logflare_web/controllers/plugs/maybe_content_type_to_json.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Plugs.MaybeContentTypeToJson do 2 | @moduledoc """ 3 | Turns the Content-Type request header to `application/json` 4 | """ 5 | use Plug.Builder 6 | 7 | import Plug.Conn 8 | 9 | def call(conn, _params) do 10 | content_type = conn |> get_req_header("content-type") 11 | 12 | case content_type do 13 | ["application/csp-report"] -> 14 | conn 15 | |> put_req_header("content-type", "application/json") 16 | 17 | _else -> 18 | conn 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/logflare_web/controllers/plugs/set_plan.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Plugs.SetPlan do 2 | @moduledoc """ 3 | Assigns team user if browser session is present in conn 4 | """ 5 | import Plug.Conn 6 | 7 | alias Logflare.User 8 | alias Logflare.Billing 9 | 10 | def init(_), do: nil 11 | 12 | def call(conn, opts \\ []) 13 | 14 | def call(%{assigns: %{user: %User{} = user}} = conn, _opts) do 15 | assign(conn, :plan, Billing.get_plan_by_user(user)) 16 | end 17 | 18 | def call(conn, _opts), do: conn 19 | end 20 | -------------------------------------------------------------------------------- /lib/logflare_web/controllers/plugs/set_plan_from_cache.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Plugs.SetPlanFromCache do 2 | @moduledoc """ 3 | Assigns team user if browser session is present in conn 4 | """ 5 | import Plug.Conn 6 | 7 | alias Logflare.User 8 | alias Logflare.Billing 9 | 10 | def init(_), do: nil 11 | 12 | def call(%{assigns: %{user: %User{} = user}} = conn, _opts) do 13 | assign(conn, :plan, Billing.Cache.get_plan_by_user(user)) 14 | end 15 | 16 | def call(conn, _opts), do: conn 17 | end 18 | -------------------------------------------------------------------------------- /lib/logflare_web/live/alerts/actions/edit.html.heex: -------------------------------------------------------------------------------- 1 | <.subheader {assigns}> 2 | <:path> 3 | ~/<.subheader_path_link live_patch to={~p"/alerts"}>alerts/<.subheader_path_link live_patch to={~p"/alerts/#{@alert.id}"}> 4 | <%= @alert.name %> 5 | /edit 6 | 7 | <.render_docs_link {assigns} /> 8 | 9 | 10 |
11 | <.alert_form {assigns} /> 12 |
13 | -------------------------------------------------------------------------------- /lib/logflare_web/live/alerts/actions/new.html.heex: -------------------------------------------------------------------------------- 1 | <.subheader> 2 | <:path> 3 | ~/<.link patch={~p"/alerts"} data-confirm="Confirm navigate away? All unsaved changes will be lost">alerts/new 4 | 5 | 6 | 7 |
8 | <.alert_form {assigns} /> 9 |
10 | -------------------------------------------------------------------------------- /lib/logflare_web/live/alerts/actions/not_found.html.heex: -------------------------------------------------------------------------------- 1 | <.subheader> 2 | <:path>~/alerts/not found 3 | 4 | 5 |
6 |

Alert Not Found

7 |

8 | This alert does not exist. Select an alert from the list instead 9 | instead. 10 |

11 |
12 | -------------------------------------------------------------------------------- /lib/logflare_web/live/alerts/components/run_query_result.html.heex: -------------------------------------------------------------------------------- 1 |
2 |
Results
3 | 4 |
5 |
6 | <%= Jason.encode!(@query_result_rows) |> Jason.Formatter.pretty_print() %> 7 |
8 | 9 |
10 |
Results
11 | No rows returned from query 12 |
13 | -------------------------------------------------------------------------------- /lib/logflare_web/live/backends/actions/edit.html.heex: -------------------------------------------------------------------------------- 1 | <.subheader {assigns}> 2 | <:path> 3 | ~/<.subheader_path_link live_patch to={~p"/backends"}>backends/<.subheader_path_link live_patch to={~p"/backends/#{@backend.id}"}> 4 | <%= @backend.name %> 5 | /edit 6 | 7 | <.subheader_link to="https://docs.logflare.app/backends" external={true} text="docs" fa_icon="book" /> 8 | 9 | 10 |
11 | <.backend_form {assigns} /> 12 |
13 | -------------------------------------------------------------------------------- /lib/logflare_web/live/backends/actions/new.html.heex: -------------------------------------------------------------------------------- 1 | <.subheader> 2 | <:path> 3 | ~/<.link patch={~p"/backends"} data-confirm="Confirm navigate away? All unsaved changes will be lost">backends/new 4 | 5 | 6 | 7 |
8 | <.backend_form {assigns} /> 9 |
10 | -------------------------------------------------------------------------------- /lib/logflare_web/live/display_helpers.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Live.DisplayHelpers do 2 | @moduledoc false 3 | 4 | def sanitize_backend_config(%{} = config) do 5 | allowed_keys = ~w(database hostname pool_size port project_id region schema table url)a 6 | 7 | config 8 | |> Enum.map(fn {key, value} -> 9 | if key in allowed_keys do 10 | {key, value} 11 | else 12 | {key, "**********"} 13 | end 14 | end) 15 | |> Map.new() 16 | end 17 | 18 | def sanitize_backend_config(_config), do: %{} 19 | end 20 | -------------------------------------------------------------------------------- /lib/logflare_web/live/endpoints/actions/edit.html.heex: -------------------------------------------------------------------------------- 1 | <.subheader {assigns}> 2 | <:path> 3 | ~/<.subheader_path_link live_patch to={~p"/endpoints"}>endpoints/<.subheader_path_link live_patch to={~p"/endpoints/#{@show_endpoint.id}"}> 4 | <%= @show_endpoint.name %> 5 | /edit 6 | 7 | <.subheader_link to="https://docs.logflare.app/concepts/endpoints#crafting-a-query" external={true} text="docs" fa_icon="book" /> 8 | 9 | 10 |
11 | <.endpoint_form {assigns} /> 12 |
13 | -------------------------------------------------------------------------------- /lib/logflare_web/live/endpoints/actions/new.html.heex: -------------------------------------------------------------------------------- 1 | <.subheader> 2 | <:path> 3 | ~/<.link patch={~p"/endpoints"} data-confirm="Confirm navigate away? All unsaved changes will be lost">endpoints/new 4 | 5 | 6 | 7 |
8 | <.endpoint_form {assigns} /> 9 |
10 | -------------------------------------------------------------------------------- /lib/logflare_web/live/endpoints/actions/not_found.html.heex: -------------------------------------------------------------------------------- 1 | <.subheader> 2 | <:path>~/endpoints/not found 3 | 4 | 5 |
6 |

Endpoint Not Found

7 |

8 | This endpoint does not exist. Select an endpoint from the endpoint list 9 | instead. 10 |

11 |
12 | -------------------------------------------------------------------------------- /lib/logflare_web/live/endpoints/components/run_query_form.heex: -------------------------------------------------------------------------------- 1 | <.form :let={f} for={@params_form} phx-submit="run-query" class="tw-min-h-[80px]"> 2 | <%= hidden_input(f, :query) %> 3 | 4 | <.inputs_for :let={params_f} field={f[:params]}> 5 |
6 | <%= label(params_f, key, key) %> 7 | <%= text_input(params_f, key, value: Map.get(@prev_params, key, "")) %> 8 |
9 | 10 | <%= submit("Test query", class: "btn btn-secondary") %> 11 | 12 | -------------------------------------------------------------------------------- /lib/logflare_web/live/endpoints/components/run_query_result.heex: -------------------------------------------------------------------------------- 1 |
2 |
Results
3 | 4 | 5 | <%= Jason.encode!(@query_result_rows) |> Jason.Formatter.pretty_print() %> 6 | 7 |
8 | -------------------------------------------------------------------------------- /lib/logflare_web/live/live_commons.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.LiveCommons do 2 | @moduledoc false 3 | import Phoenix.LiveView 4 | 5 | defmacro __using__(_context) do 6 | quote do 7 | def handle_info({:clear_flash, key}, socket) when is_atom(key) do 8 | {:noreply, clear_flash(socket, key)} 9 | end 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/logflare_web/live/logflare_live_component_utils.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.LiveComponentUtils do 2 | @moduledoc false 3 | def send_assigns_to_self(key, value) do 4 | send(self(), {:lvc_assigns, key, value}) 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/logflare_web/live/lql/lql_form_lvc.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Lql.LqlFormLVC do 2 | @moduledoc """ 3 | LiveView component for LQL form 4 | """ 5 | use Phoenix.LiveComponent 6 | alias LogflareWeb.LqlView 7 | 8 | def render(assigns) do 9 | LqlView.render("lql_form.html", assigns) 10 | end 11 | 12 | def update(assigns, socket) do 13 | socket = assign(socket, assigns) 14 | 15 | {:ok, socket} 16 | end 17 | 18 | def mount(socket) do 19 | socket = 20 | socket 21 | |> assign(:loading, false) 22 | 23 | {:ok, socket} 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /lib/logflare_web/live/search_live/logs_search_debug_lvc.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Source.SearchLV.DebugLVC do 2 | @moduledoc false 3 | use Phoenix.LiveComponent 4 | alias LogflareWeb.SearchView 5 | 6 | def render(assigns) do 7 | SearchView.render("debug.html", assigns) 8 | end 9 | 10 | def update(assigns, socket) do 11 | socket = assign(socket, assigns) 12 | 13 | {:ok, socket} 14 | end 15 | 16 | def mount(socket) do 17 | {:ok, socket} 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/logflare_web/live/sources/bq_schema_component.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.SourceBqSchemaComponent do 2 | @moduledoc false 3 | use LogflareWeb, :live_component 4 | alias LogflareWeb.Helpers.BqSchema 5 | alias Logflare.SourceSchemas 6 | 7 | @impl true 8 | def render(%{source: source}) do 9 | bq_schema = 10 | SourceSchemas.get_source_schema_by(source_id: source.id) 11 | |> Map.get(:bigquery_schema) 12 | 13 | BqSchema.format_bq_schema(bq_schema) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/admin/dashboard.html.eex: -------------------------------------------------------------------------------- 1 |
2 |
3 |
~/admin/dashboard
4 |
5 | <%= render LogflareWeb.AdminSharedView, "nav_links.html", conn: @conn %> 6 |
7 |
8 |
9 |
10 |

Nothing here yet

11 |
12 | 17 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/admin_plan/edit.html.eex: -------------------------------------------------------------------------------- 1 |
2 |
3 |
~/admin/plan/<%= @plan.id %>/edit
4 |
5 | <%= render LogflareWeb.AdminSharedView, "nav_links.html", conn: @conn %> 6 |
7 |
8 |
9 |
10 |

Edit Plan

11 | <%= render "form.html", Map.put(assigns, :action, Routes.admin_plan_path(@conn, :edit, @plan)) %> 12 |
13 | 14 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/admin_plan/new.html.eex: -------------------------------------------------------------------------------- 1 |
2 |
3 |
~/admin/plans/new
4 |
5 | <%= render LogflareWeb.AdminSharedView, "nav_links.html", conn: @conn %> 6 |
7 |
8 |
9 |
10 |

New Plan

11 | <%= render "form.html", Map.put(assigns, :action, Routes.admin_plan_path(@conn, :new)) %> 12 |
13 | 14 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/application/edit.html.eex: -------------------------------------------------------------------------------- 1 |
2 |
3 |
~/applications/<%= @application.name %>/edit
4 |
5 |
    6 |
  • 7 |
  • 8 |
9 |
10 |
11 |
12 |
13 | <%= render "form.html", changeset: @changeset, 14 | action: Routes.oauth_application_path(@conn, :update, @application) %> 15 | <%= link "Back", to: Routes.oauth_application_path(@conn, :index) %> 16 |
17 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/application/new.html.eex: -------------------------------------------------------------------------------- 1 |
2 |
3 |
~/applications/new
4 |
5 |
    6 |
  • 7 |
  • 8 |
9 |
10 |
11 |
12 |
13 | <%= render "form.html", changeset: @changeset, 14 | action: Routes.oauth_application_path(@conn, :create) %> 15 | <%= link "Back", to: Routes.oauth_application_path(@conn, :index) %> 16 |
17 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/error/401_page.html.eex: -------------------------------------------------------------------------------- 1 | <%= render_in "error_container.html", assigns do %> 2 |
3 |

401

4 |

Unauthorized

5 |

Get back to homepage

6 |
7 | <% end %> 8 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/error/404_page.html.eex: -------------------------------------------------------------------------------- 1 | <%= render_in "error_container.html", assigns do %> 2 |
3 |

404

4 |

Page not found

5 |

Get back to homepage

6 |
7 | <% end %> 8 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/error/500_page.html.eex: -------------------------------------------------------------------------------- 1 | <%= render_in "error_container.html", assigns do %> 2 |
3 |

500 Server error!

4 |

Oops, something went wrong. We've been notified. It's likely temporary. Please try again in a minute.

5 |

If this error persists please contact us at support@logflare.app

6 |
7 |
8 |

Looking for something else?

9 | <%= render(LogflareWeb.SharedView, "logflare_services_list.html") %> 10 |
11 | <% end %> 12 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/error/error_container.html.eex: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | <%= @inner_content %> 7 |
8 |

Looking for something else?

9 | <%= render(LogflareWeb.SharedView, "logflare_services_list.html") %> 10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/layout/app.html.eex: -------------------------------------------------------------------------------- 1 | <%= render("flash.html", flash: %{info: Phoenix.Flash.get(@flash, :info), error: Phoenix.Flash.get(@flash, :error)}) %> 2 |
3 | <%= @inner_content %> 4 |
5 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/layout/banner.html.eex: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/layout/inline_live.html.heex: -------------------------------------------------------------------------------- 1 | <%= for {key, alert_class} <- [success: "success", info: "info", error: "danger", warning: "warning"] do %> 2 | <%= if inner_block = live_flash(@flash, key) do %> 3 | <.live_component module={LogflareWeb.AlertComponent} key={key} alert_class={alert_class} id={"#{key}_flash_alert"}> 4 | <%= inner_block %> 5 | 6 | <% end %> 7 | <% end %> 8 | <%= @inner_content %> 9 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/layout/live.html.heex: -------------------------------------------------------------------------------- 1 | <%= for {key, alert_class} <- [success: "success", info: "info", error: "danger", warning: "warning"] do %> 2 | <%= if inner_block = live_flash(@flash, key) do %> 3 | <.live_component module={LogflareWeb.AlertComponent} key={key} alert_class={alert_class} id={"#{key}_flash_alert"}> 4 | <%= inner_block %> 5 | 6 | <% end %> 7 | <% end %> 8 |
9 | <%= @inner_content %> 10 |
11 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/log/log_event.html.heex: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | ~/logs/<.link navigate={~p"/sources/#{@source}"} class="text-primary"><%= @source.name %>/event 5 |
6 |
7 |
    8 |
  • 9 |
10 |
11 |
12 |
13 |
14 | <.live_component module={LogflareWeb.Search.LogEventViewerComponent} id={:log_event_viewer} {assigns} /> 15 |
16 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/lql/lql_form.html.heex: -------------------------------------------------------------------------------- 1 |
2 | <%= label @f, :lql_string do %> 3 |
4 | Use <%= LqlHelpers.lql_help_modal_link() %> and source <%= LqlHelpers.bq_source_schema_modal_link() %> to configure log event routing to sinks. 5 |
6 | <% end %> 7 | <%= text_input(@f, :lql_string, value: @lql_string, class: "form-control", disabled: @loading) %> 8 | <%= error_tag(@f, :lql_string) %> 9 |
10 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/phoenix_oauth2_provider/application/edit.html.eex: -------------------------------------------------------------------------------- 1 |

Edit Application

2 | 3 | <%= render "form.html", Map.put(assigns, :action, Routes.oauth_application_path(@conn, :update, @changeset.data)) %> 4 | 5 | <%= link "Back", to: Routes.oauth_application_path(@conn, :index) %> 6 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/phoenix_oauth2_provider/application/new.html.eex: -------------------------------------------------------------------------------- 1 |

New Application

2 | 3 | <%= render "form.html", Map.put(assigns, :action, Routes.oauth_application_path(@conn, :create)) %> 4 | 5 | <%= link "Back", to: Routes.oauth_application_path(@conn, :index) %> 6 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/phoenix_oauth2_provider/authorization/error.html.eex: -------------------------------------------------------------------------------- 1 |

An error has occurred

2 | 3 |

<%= @error[:error_description] %>

4 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/phoenix_oauth2_provider/authorization/show.html.eex: -------------------------------------------------------------------------------- 1 |

Authorization code

2 | 3 | <%= @code %> 4 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/shared/live_widget.html.heex: -------------------------------------------------------------------------------- 1 |
2 | <%= @inner_content %> 3 |
4 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/shared/loader.html.heex: -------------------------------------------------------------------------------- 1 |
2 | <%= live_react_component("Components.Loader", %{}, id: "shared-loader") %> 3 |
4 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/shared/logflare_services_list.html.eex: -------------------------------------------------------------------------------- 1 |

Install the Cloudflare app

2 |

Setup our Elixir Logger backend

3 |

Check out the Logflare Vercel app

4 |

Javascript? Use our Pino transport

5 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/shared/logo.html.eex: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Logflare v<%= List.to_string(Application.spec(:logflare, :vsn)) %> 5 |
6 |
7 | -------------------------------------------------------------------------------- /lib/logflare_web/templates/shared/lql_help.html.heex: -------------------------------------------------------------------------------- 1 | <%= LogflareWeb.DocsView.render_docs("concepts/lql", hide_header: true) |> raw() %> 2 | -------------------------------------------------------------------------------- /lib/logflare_web/views/admin_cluster_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.AdminClusterView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/admin_plan_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.AdminPlanView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/admin_shared_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.AdminSharedView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/admin_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.AdminView do 2 | @moduledoc false 3 | use LogflareWeb, :view 4 | import Scrivener.HTML 5 | end 6 | -------------------------------------------------------------------------------- /lib/logflare_web/views/auth/auth_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.AuthView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/auth/email_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Auth.EmailView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/billing_account_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.BillingAccountView do 2 | import LogflareWeb.Helpers.Forms 3 | import Logflare.Sources, only: [count_for_billing: 1] 4 | use LogflareWeb, :live_view_with_templates 5 | end 6 | -------------------------------------------------------------------------------- /lib/logflare_web/views/billing_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.BillingView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/contact_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.ContactView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/elixir_logger_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.ElixirLoggerView do 2 | use LogflareWeb, :view 3 | 4 | # alias LogflareWeb.ElixirLoggerView 5 | 6 | def render("index.json", %{message: message}) do 7 | %{message: message} 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/logflare_web/views/endpoints_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.EndpointsView do 2 | use LogflareWeb, :view 3 | 4 | def render("query.json", %{result: data}) do 5 | %{result: data} 6 | end 7 | 8 | def render("query.json", %{error: error}) do 9 | %{error: error} 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/logflare_web/views/helpers/form_helpers.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Helpers.Forms do 2 | @moduledoc false 3 | use LogflareWeb, :html 4 | 5 | def section_header(text) do 6 | anchor = text |> String.downcase() |> String.replace(" ", "-") 7 | 8 | assigns = %{ 9 | anchor: anchor, 10 | text: text 11 | } 12 | 13 | ~H""" 14 |
<%= @text %> <%= link("#", to: "#" <> @anchor) %>
15 | """ 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/logflare_web/views/helpers/page_title.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.Helpers.PageTitle do 2 | @moduledoc """ 3 | Sets page titles. 4 | """ 5 | 6 | # alias LogflareWeb.{SourceView, MarketingView} 7 | 8 | @suffix "Logflare | Cloudflare, Vercel & Elixir Logging" 9 | 10 | def page_title(conn), do: conn |> get |> put_suffix 11 | 12 | defp put_suffix(nil), do: @suffix 13 | defp put_suffix(title), do: title <> " | " <> @suffix 14 | 15 | # defp get(%{view_module: MarketingView}), do: "Works" 16 | 17 | defp get(%{source: source}) do 18 | source.name 19 | end 20 | 21 | defp get(_conn), do: nil 22 | end 23 | -------------------------------------------------------------------------------- /lib/logflare_web/views/layout_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.LayoutView do 2 | use LogflareWeb, :view 3 | import LogflareWeb.Helpers.PageTitle 4 | end 5 | -------------------------------------------------------------------------------- /lib/logflare_web/views/log_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.LogView do 2 | use LogflareWeb, :view 3 | 4 | def render("index.json", %{message: message}) do 5 | %{message: message} 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /lib/logflare_web/views/lql_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.LqlView do 2 | @moduledoc false 3 | use LogflareWeb, :view 4 | alias LogflareWeb.LqlHelpers 5 | end 6 | -------------------------------------------------------------------------------- /lib/logflare_web/views/marketing_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.MarketingView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/phoenix_oauth2_provider/application_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.PhoenixOauth2Provider.ApplicationView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/phoenix_oauth2_provider/authorization_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.PhoenixOauth2Provider.AuthorizationView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/phoenix_oauth2_provider/authorized_application_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.PhoenixOauth2Provider.AuthorizedApplicationView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/rule_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.RuleView do 2 | use LogflareWeb, :view 3 | alias LogflareWeb.Lql 4 | alias LogflareWeb.LqlHelpers 5 | import LogflareWeb.ModalLiveHelpers 6 | end 7 | -------------------------------------------------------------------------------- /lib/logflare_web/views/search_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.SearchView do 2 | use LogflareWeb, :live_view_with_templates 3 | 4 | import LogflareWeb.Helpers.BqSchema 5 | import LogflareWeb.ModalLiveHelpers 6 | import Logflare.Lql.Utils 7 | alias Logflare.DateTimeUtils 8 | alias LogflareWeb.Search 9 | end 10 | -------------------------------------------------------------------------------- /lib/logflare_web/views/shared_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.SharedView do 2 | @moduledoc false 3 | use LogflareWeb, :view 4 | end 5 | -------------------------------------------------------------------------------- /lib/logflare_web/views/source_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.SourceView do 2 | import LogflareWeb.Helpers.Forms 3 | alias LogflareWeb.Router.Helpers, as: Routes 4 | use LogflareWeb, :view 5 | 6 | def log_url(route) do 7 | url = Routes.log_url(LogflareWeb.Endpoint, route) |> URI.parse() 8 | 9 | case url do 10 | %URI{authority: "logflare.app"} -> 11 | url 12 | |> Map.put(:authority, "api.logflare.app") 13 | |> Map.put(:host, "api.logflare.app") 14 | 15 | _ -> 16 | url 17 | end 18 | |> URI.to_string() 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lib/logflare_web/views/team_user_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.TeamUserView do 2 | use LogflareWeb, :view 3 | end 4 | -------------------------------------------------------------------------------- /lib/logflare_web/views/user_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.UserView do 2 | import LogflareWeb.Helpers.Forms 3 | use LogflareWeb, :view 4 | end 5 | -------------------------------------------------------------------------------- /lib/logflare_web/views/vercel_log_drains_view.ex: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.VercelLogDrainsView do 2 | import LogflareWeb.Helpers.Forms 3 | use LogflareWeb, :live_view_with_templates 4 | end 5 | -------------------------------------------------------------------------------- /lib/mix/tasks/docs.ex: -------------------------------------------------------------------------------- 1 | defmodule Logflare.MixTasks.Docs do 2 | @moduledoc "Copies Logflare docs to /priv, used for in-app documentation" 3 | @shortdoc "Copies docs to /priv" 4 | 5 | use Mix.Task 6 | 7 | @impl Mix.Task 8 | def run(_) do 9 | # TODO: convert commands to platform agonostic 10 | IO.puts("Cleaning /priv/docs...") 11 | Mix.shell().cmd("rm -rf docs", cd: "priv") 12 | IO.puts("Copying logflare docs...") 13 | Mix.shell().cmd("cp -r docs ../../priv", cd: "docs/docs.logflare.com") 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /native/sqlparser_ex/.cargo/config: -------------------------------------------------------------------------------- 1 | [target.'cfg(target_os = "macos")'] 2 | rustflags = [ 3 | "-C", "link-arg=-undefined", 4 | "-C", "link-arg=dynamic_lookup", 5 | ] 6 | -------------------------------------------------------------------------------- /native/sqlparser_ex/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sqlparser_ex" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [lib] 9 | name = "sqlparser_ex" 10 | path = "src/lib.rs" 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | rustler = "0.29.0" 15 | sqlparser = { version = "0.33.0", features = ["serde"]} 16 | # sqlparser = {git = "https://github.com/Logflare/sqlparser-rs", branch = "main", features = ["serde"]} 17 | # sqlparser = {version = "0.27.0", features = ["serde"]} 18 | serde = { version = "1", features = ["derive"] } 19 | serde_json = "1" 20 | -------------------------------------------------------------------------------- /priv/.gitignore: -------------------------------------------------------------------------------- 1 | sql 2 | -------------------------------------------------------------------------------- /priv/repo/.formatter.exs: -------------------------------------------------------------------------------- 1 | [ 2 | inputs: ["priv/repo/**/*.exs"], 3 | import_deps: [ 4 | :ecto, 5 | :ecto_sql 6 | ] 7 | ] 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20181212161742_add_users_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddUsersTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:users) do 6 | add :email, :string 7 | add :provider, :string 8 | add :token, :string 9 | 10 | timestamps() 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20181212220417_create_sources.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateSources do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:sources) do 6 | add :name, :string 7 | add :token, :uuid 8 | 9 | timestamps() 10 | end 11 | 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20181212220843_sources_to_users.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.SourcesToUsers do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add :user_id, references (:users) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20181219123536_add_api_key_to_users.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddApiKeyToUsers do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add :api_key, :string 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20181220234951_unique_name_and_token_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.UniqueNameAndTokenSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create unique_index(:sources, [:name]) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190111193432_add_old_api_key.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddOldApiKey do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add :old_api_key, :string 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190111222747_index_on_api_key.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.IndexOnApiKey do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create index(:users, [:api_key]) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190111223908_change_source_name_index.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.ChangeSourceNameIndex do 2 | use Ecto.Migration 3 | 4 | def change do 5 | drop index(:sources, [:name]) 6 | create unique_index(:sources, [:name]) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190128145905_create_rules.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateRules do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:rules) do 6 | add :regex, :string 7 | add :sink, :uuid 8 | add :source_id, references(:sources, on_delete: :delete_all) 9 | 10 | timestamps() 11 | end 12 | 13 | create index(:rules, [:source_id]) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190211145604_add_public_token_to_sources.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddPublicTokenToSources do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add(:public_token, :string) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190212190412_add_default_to_secret.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddDefaultToSecret do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:oauth_applications) do 6 | modify(:secret, :string, null: false, default: "") 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190218171231_unique_on_source_public_key.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.UniqueOnSourcePublicKey do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create(unique_index(:sources, [:public_token])) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190220020658_add_info_to_user.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddInfoToUser do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add(:email_preferred, :string) 7 | add(:name, :string) 8 | add(:image, :string) 9 | add(:email_me_product, :boolean, default: true, null: false) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190220150309_delete_sources_on_account_delete.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.DeleteSourcesOnAccountDelete do 2 | use Ecto.Migration 3 | 4 | def down do 5 | execute("ALTER TABLE sources DROP CONSTRAINT sources_user_id_fkey") 6 | 7 | alter table(:sources) do 8 | modify(:user_id, references(:users, on_delete: :nothing)) 9 | end 10 | end 11 | 12 | def up do 13 | execute("ALTER TABLE sources DROP CONSTRAINT sources_user_id_fkey") 14 | 15 | alter table(:sources) do 16 | modify(:user_id, references(:users, on_delete: :delete_all)) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190226224323_add_another_references_rules.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddAnotherReferencesRules do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create(unique_index(:sources, [:token])) 6 | 7 | alter table(:rules) do 8 | modify(:sink, references(:sources, column: :token, type: :uuid, on_delete: :nothing)) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190226225345_redo_this_one.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.RedoThisOne do 2 | use Ecto.Migration 3 | 4 | def down do 5 | execute("ALTER TABLE rules DROP CONSTRAINT rules_sink_fkey") 6 | 7 | alter table(:rules) do 8 | modify(:sink, references(:sources, column: :token, type: :uuid, on_delete: :nothing)) 9 | end 10 | end 11 | 12 | def up do 13 | execute("ALTER TABLE rules DROP CONSTRAINT rules_sink_fkey") 14 | 15 | alter table(:rules) do 16 | modify(:sink, references(:sources, column: :token, type: :uuid, on_delete: :delete_all)) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190313222100_add_admin_to_user.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddAdminToUser do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add(:admin, :boolean, default: false, null: false) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190314210542_add_overflow_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddOverflowSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add(:overflow_source, references(:sources, column: :token, type: :uuid)) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190314234158_nilify_overflow_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.NilifyOverflowSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | remove(:overflow_source) 7 | end 8 | 9 | alter table(:sources) do 10 | add( 11 | :overflow_source, 12 | references(:sources, column: :token, type: :uuid, on_delete: :nilify_all) 13 | ) 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190321135403_favorite_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.FavoriteSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add(:favorite, :boolean, default: false, null: false) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190322184724_email_notifications_on_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.EmailNotificationsOnSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add(:user_email_notifications, :boolean, default: false, null: false) 7 | add(:other_email_notifications, :jsonb, default: "[]") 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190322194928_fuck_embeds.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.FuckEmbeds do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | remove(:other_email_notifications) 7 | end 8 | 9 | alter table(:sources) do 10 | add(:other_email_notifications, :string) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190326182605_add_phone_to_account_and_tex_alert_to_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddPhoneToAccountAndTexAlertToSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add(:user_text_notifications, :boolean, default: false, null: false) 7 | end 8 | 9 | alter table(:users) do 10 | add(:phone, :string) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190507163835_add_bq_table_settings.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddBqTableSettings do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add(:bigquery_table_ttl, :integer) 7 | end 8 | 9 | alter table(:users) do 10 | add(:bigquery_project_id, :string) 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190509154645_add_api_quotas_to_sources_users.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddApiQuotasToSourcesUsers do 2 | use Ecto.Migration 3 | 4 | def up do 5 | alter table(:sources) do 6 | add :api_quota, :integer, default: 5, null: false 7 | end 8 | 9 | alter table(:users) do 10 | add :api_quota, :integer, default: 125, null: false 11 | end 12 | 13 | execute "UPDATE sources SET api_quota = 100" 14 | execute "UPDATE users SET api_quota = 125" 15 | end 16 | 17 | def down do 18 | alter table(:sources) do 19 | remove :api_quota 20 | end 21 | 22 | alter table(:users) do 23 | remove :api_quota 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190522200854_remove_overflow_source_from_sources.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.RemoveOverflowSourceFromSources do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | remove :overflow_source, references(:sources, column: :token, type: :uuid) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190528132518_update_user_constraints.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.UpdateUserConstraints do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | modify :provider, :string, null: false 7 | modify :email, :string, null: false 8 | modify :token, :string, null: false 9 | modify :api_key, :string, null: false 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190603134249_alter_rules_set_sink_source_id_not_null.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AlterRulesSetSinkSourceIdNotNull do 2 | use Ecto.Migration 3 | 4 | def up do 5 | execute "alter table rules alter column sink set not null" 6 | execute "alter table rules alter column source_id set not null" 7 | end 8 | 9 | def down do 10 | execute "alter table rules alter column sink drop not null" 11 | execute "alter table rules alter column source_id drop not null" 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190814185734_add_bigquery_dataset_location.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddBigqueryDatasetLocation do 2 | @moduledoc false 3 | use Ecto.Migration 4 | 5 | def change do 6 | alter table(:users) do 7 | add(:bigquery_dataset_location, :string) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190815222912_add_bq_dataset_id.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddBqDatasetId do 2 | @moduledoc false 3 | use Ecto.Migration 4 | 5 | def change do 6 | alter table(:users) do 7 | add(:bigquery_dataset_id, :string) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190820170701_add_regex_compiled_to_rules.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddRegexCompiledToRules do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:rules) do 6 | add_if_not_exists :regex_struct, :bytea 7 | end 8 | 9 | end 10 | end 11 | 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190823211533_add_field_user_iam_update.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddFieldUserIamUpdate do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add(:valid_google_account, :boolean) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20190912214717_add_system_metrics_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddSystemMetricsTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table("system_metrics") do 6 | add :all_logs_logged, :integer 7 | add :node, :string 8 | 9 | timestamps() 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191007163747_add_provider_uid.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddProviderUid do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add(:provider_uid, :string) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191014233159_change_system_metrics_to_bigint.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.ChangeSystemMetricsToBigint do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:system_metrics) do 6 | modify :all_logs_logged, :bigint 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191108163345_webhook_notification_url.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.WebhookNotificationUrl do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add(:webhook_notification_url, :string) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191111221000_add_slack_hook_url_to_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddSlackHookUrlToSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add(:slack_hook_url, :string) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191114120409_add_saved_searches_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddSavedSearchesTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:saved_searches) do 6 | add :querystring, :string 7 | add :source_id, references(:sources) 8 | 9 | timestamps() 10 | end 11 | 12 | create unique_index(:saved_searches, [:querystring, :source_id]) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20191226181646_add_lql_filters_to_rules.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddLqlFiltersToRules do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:rules) do 6 | add :lql_filters, :map, default: %{}, null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200106161131_add_lql_string_to_rules.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddLqlStringToRules do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:rules) do 6 | add :lql_string, :text, default: "", null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200109165508_add_unique_index_user_email.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddUniqueIndexUserEmail do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create unique_index(:users, ["lower(email)"]) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200113132611_add_team_user_ids_to_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddTeamUserIdsToSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add :notifications, :map, default: %Logflare.Source.Notifications{}, null: false 7 | end 8 | end 9 | 10 | def default() do 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200114231904_drop_source_columns.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.DropSourceColumns do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | remove(:user_email_notifications) 7 | remove(:user_text_notifications) 8 | remove(:other_email_notifications) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200116122225_alter_rules_lql_filters_default_value.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.UpdateRulesLqlFiltersDefaultValue do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:rules) do 6 | modify :lql_filters, :map, default: fragment("'[]'::JSONB"), null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200116143027_alter_rules_modify_lql_filters_bytea.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AlterRulesModifyLqlFiltersBytea do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:rules) do 6 | remove :lql_filters 7 | add :lql_filters, :bytea, null: false, default: "\\x836a" 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200130185455_create_billing_accounts.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateBillingAccounts do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:billing_accounts) do 6 | add :latest_successful_stripe_session, :map 7 | add :stripe_customer, :string 8 | add :user_id, references(:users, on_delete: :delete_all) 9 | 10 | timestamps() 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200205180641_alter_users_add_bigquery_udfs_hash.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AlterUsersAddBigqueryUdfsHash do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add :bigquery_udfs_hash, :string, default: "", null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200311175358_add_custom_event_message.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddCustomEventMessage do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add :custom_event_message_keys, :string 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200317130710_delete_saved_searches_on_source_delete.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.DeleteSavedSearchesOnSourceDelete do 2 | use Ecto.Migration 3 | 4 | def up do 5 | drop(constraint(:saved_searches, "saved_searches_source_id_fkey")) 6 | 7 | alter table(:saved_searches) do 8 | modify(:source_id, references(:sources, on_delete: :delete_all)) 9 | end 10 | end 11 | 12 | def down do 13 | drop(constraint(:saved_searches, "saved_searches_source_id_fkey")) 14 | 15 | alter table(:saved_searches) do 16 | modify(:source_id, references(:sources)) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200319164038_add_custom_bigquery_bytes_limit.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddCustomBigqueryBytesLimit do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add :bigquery_processed_bytes_limit, :bigint, default: 10_000_000_000, nullable: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200320161900_make_bytes_processed_not_nullable.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.MakeBytesProcessedNotNullable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | modify(:bigquery_processed_bytes_limit, :bigint, null: false) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200401102642_alter_saved_searches_add_counts_operators.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AlterSavedSearchesAddCountsOperators do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:saved_searches) do 6 | add :saved_by_user, :boolean 7 | add :lql_filters, :jsonb 8 | add :lql_charts, :jsonb 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200401132720_create_saved_search_counters.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateSavedSearchCounters do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:saved_search_counters) do 6 | add :timestamp, :timestamp, null: false 7 | add :saved_search_id, references(:saved_searches) 8 | add :granularity, :text, default: "day", null: false 9 | add :non_tailing_count, :integer 10 | add :tailing_count, :integer 11 | end 12 | 13 | create unique_index(:saved_search_counters, [:timestamp, :saved_search_id, :granularity]) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200401182732_create_plans.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreatePlans do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:plans) do 6 | add :name, :string 7 | add :stripe_id, :string 8 | 9 | timestamps() 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200402180315_add_billing_account_subscriptions.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddBillingAccountSubscriptions do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:billing_accounts) do 6 | add :stripe_subscriptions, :map 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200403130311_make_billing_accounts_unique.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.MakeBillingAccountsUnique do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create unique_index(:billing_accounts, [:user_id]) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200409120508_add_tailing_to_saved_searches.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddTailingToSavedSearches do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:saved_searches) do 6 | add :tailing?, :boolean, null: false, default: true 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200409150827_add_stripe_invoices.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddStripeInvoices do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:billing_accounts) do 6 | add :stripe_invoices, :map 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200422211654_redirect_uri_to_text.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.RedirectUriToText do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:oauth_access_grants) do 6 | modify :redirect_uri, :text 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200507184618_add_more_plan_fields.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddMorePlanFields do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:plans) do 6 | add :period, :string 7 | add :price, :integer 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200512205718_add_limits_to_plans.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddLimitsToPlans do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:plans) do 6 | add :limit_sources, :integer 7 | add :limit_rate_limit, :integer 8 | add :limit_alert_freq, :integer 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200513154911_user_billing_enabled.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.UserBillingEnabled do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add :billing_enabled?, :boolean, null: false, default: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200519181117_add_source_rate_limit_to_plans.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddSourceRateLimitToPlans do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:plans) do 6 | add :limit_source_rate_limit, :integer 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200603150413_add_latest_event_timestamp_to_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddLatestEventTimestampToSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add :log_events_updated_at, :naive_datetime 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200605164057_add_bigquery_schema.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddBigquerySchema do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add :bigquery_schema, :binary 7 | remove_if_exists(:schema, :binary) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200605185446_create_source_schemas.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateSourceSchemas do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:source_schemas) do 6 | add :bigquery_schema, :binary 7 | add :source_id, references(:sources, on_delete: :delete_all) 8 | 9 | timestamps() 10 | end 11 | 12 | create index(:source_schemas, [:source_id]) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200606140153_unique_source_schema_index.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.UniqueSourceSchemaIndex do 2 | use Ecto.Migration 3 | 4 | def change do 5 | drop index(:source_schemas, [:source_id]) 6 | create unique_index(:source_schemas, [:source_id]) 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200803211251_add_saved_search_limit_to_plans.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddSavedSearchLimitToPlans do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:plans) do 6 | add :limit_saved_search_limit, :integer 7 | add :limit_team_users_limit, :integer 8 | add :limit_source_fields_limit, :integer 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200806201742_add_notifications_every_to_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddNotificationsEveryToSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add :notifications_every, :integer, default: :timer.hours(4), nullable: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200824155733_add_lifetime_plan_billing_account.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddLifetimePlanBillingAccount do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:billing_accounts) do 6 | add :lifetime_plan?, :boolean, default: false, nullable: false 7 | add :lifetime_plan_invoice, :string 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20200826141015_add_source_ttl_limit.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddSourceTtlLimit do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:plans) do 6 | add :limit_source_ttl, :bigint, default: :timer.hours(72), nullable: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20201130170051_alter_sources_add_bq_table_partition_type.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AlterSourcesAddBqTablePartitionType do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add :bq_table_partition_type, :text 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20201211125013_alter_tables_users_team_users_add_preferences.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AlterTablesUsersTeamUsersAddPreferences do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:team_users) do 6 | add :preferences, :map 7 | end 8 | 9 | alter table(:users) do 10 | add :preferences, :map 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /priv/repo/migrations/20201229174131_create_billing_counts.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateBillingCounts do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:billing_counts) do 6 | add :node, :string 7 | add :count, :integer 8 | add :user_id, references(:users, on_delete: :delete_all) 9 | add :source_id, references(:sources, on_delete: :nothing) 10 | 11 | timestamps() 12 | end 13 | 14 | create index(:billing_counts, [:user_id]) 15 | create index(:billing_counts, [:source_id]) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210104192144_saved_search_string_to_text.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.SavedSearchStringToText do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:saved_searches) do 6 | modify :querystring, :text 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210106205729_drop_source_contstraint_billing_counts.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.DropSourceContstraintBillingCounts do 2 | use Ecto.Migration 3 | 4 | def change do 5 | drop constraint("billing_counts", "billing_counts_source_id_fkey") 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210121220159_add_plan_type.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddPlanType do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:plans) do 6 | add :type, :string, default: "standard", nullable: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210204203050_add_custom_invoice_fields.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddCustomInvoiceFields do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:billing_accounts) do 6 | add :custom_invoice_fields, {:array, :map}, default: [], nullable: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210215163446_make_invoice_fields_not_nullable.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.MakeInvoiceFieldsNotNullable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:billing_accounts) do 6 | modify :custom_invoice_fields, {:array, :map}, default: [], null: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210215165548_make_invoice_fields_not_nullable_undo.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.MakeInvoiceFieldsNotNullableUndo do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:billing_accounts) do 6 | modify :custom_invoice_fields, {:array, :map}, default: [], null: true 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210521142331_create_vercel_auths.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateVercelAuths do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:vercel_auths) do 6 | add :access_token, :string 7 | add :installation_id, :string 8 | add :team_id, :string 9 | add :token_type, :string 10 | add :vercel_user_id, :string 11 | add :user_id, references(:users) 12 | 13 | timestamps() 14 | end 15 | 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210526120333_delete_vercel_auths_on_account_delete.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.DeleteVercelAuthsOnAccountDelete do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:vercel_auths) do 6 | modify :user_id, references(:users, on_delete: :delete_all), 7 | from: references(:users) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210707201854_create_endpoint_queries.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateEndpointQueries do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table(:endpoint_queries) do 6 | add :title, :string 7 | add :token, :uuid 8 | add :query, :text 9 | add :user_id, references(:users, on_delete: :nothing) 10 | 11 | timestamps() 12 | end 13 | 14 | create index(:endpoint_queries, [:user_id]) 15 | create unique_index(:endpoint_queries, [:token]) 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210712201152_rename_endpoint_title_to_name.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.RenameEndpointTitleToName do 2 | use Ecto.Migration 3 | 4 | def change do 5 | rename table(:endpoint_queries), :title, to: :name 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210715022534_add_source_mapping_to_endpoint_queries.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddSourceMappingToEndpointQueries do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:endpoint_queries) do 6 | add :source_mapping, :map, null: false, default: %{} 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210728172720_indexes_on_billing_counts.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.IndexesOnBillingCounts do 2 | use Ecto.Migration 3 | 4 | def change do 5 | drop table(:billing_counts) 6 | create table(:billing_counts) do 7 | add :node, :string 8 | add :count, :integer 9 | add :user_id, references(:users, on_delete: :delete_all) 10 | add :source_id, references(:sources, on_delete: :nothing) 11 | 12 | timestamps() 13 | end 14 | 15 | create index(:billing_counts, [:user_id]) 16 | create index(:billing_counts, [:source_id]) 17 | create index(:billing_counts, [:inserted_at]) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210802194723_drop_source_id_billing_count_index.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.DropSourceIdBillingCountIndex do 2 | use Ecto.Migration 3 | 4 | def change do 5 | drop(constraint(:billing_counts, "billing_counts_source_id_fkey")) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210803020354_add_user_id_index_for_sources.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddUserIdIndexForSources do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create index(:sources, [:user_id]) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210804210634_add_bigquery_flatmap.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddBigqueryFlatmap do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:source_schemas) do 6 | add(:schema_flat_map, :binary) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210810182003_set_rules_to_replica_identity_full.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.SetRulesToReplicaIdentityFull do 2 | use Ecto.Migration 3 | 4 | def up do 5 | execute("alter table rules replica identity full") 6 | end 7 | 8 | def down do 9 | execute("alter table rules replica identity default") 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /priv/repo/migrations/20210830181842_add_node_name_index_to_system_metrics.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddNodeNameIndexToSystemMetrics do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create index(:system_metrics, [:node]) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20211027175016_add_endpoints_beta_to_user.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddEndpointsBetaToUser do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add :endpoints_beta, :boolean, default: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20211122181200_add_schema_lock_to_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddSchemaLockToSource do 2 | use Ecto.Migration 3 | def change do 4 | alter table(:sources) do 5 | add :lock_schema, :boolean, default: false, nullable: false 6 | add :validate_schema, :boolean, default: true, nullable: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20211123192744_sandboxable_endpoint_queries.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.SandboxableEndpointQueries do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:endpoint_queries) do 6 | add :sandboxable, :boolean, default: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20211130190948_add_drop_rule_to_source.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddDropRuleToSource do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add :drop_lql_filters, :bytea, null: false, default: "\\x836a" 7 | add :drop_lql_string, :string 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20211130201505_configurable_endpoint_caching.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.ConfigurableEndpointCaching do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:endpoint_queries) do 6 | add :cache_duration_seconds, :integer, default: 3_600 7 | add :proactive_requerying_seconds, :integer, default: 1_800 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220310172806_add_max_limit_endpoint_query.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddMaxLimitEndpointQuery do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:endpoint_queries) do 6 | add :max_limit, :integer, default: 1_000, nullable: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220523135557_add_description_column_to_oauth_access_tokens_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddDescriptionColumnToOauthAccessTokensTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table("oauth_access_tokens") do 6 | add :description, :text 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220524125216_add_enable_auth_column_to_endpoint_queries_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddEnableAuthColumnToEndpointQueriesTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table("endpoint_queries") do 6 | add :enable_auth, :boolean, default: false 7 | end 8 | 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220707030041_create_source_backends_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateSourceBackendsTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table("source_backends") do 6 | add :source_id, references("sources") 7 | add :type, :string 8 | add :config, :map 9 | timestamps() 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220714033012_add_v2_pipeline_column_to_source_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddV2PipelineColumnToSourceTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table "sources" do 6 | add :v2_pipeline, :boolean, default: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20220803211705_source_replica_identity_full.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.SourceReplicaIdentityFull do 2 | use Ecto.Migration 3 | def up do 4 | execute("alter table sources replica identity full") 5 | end 6 | 7 | def down do 8 | execute("alter table sources replica identity default") 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20221210010955_add_token_to_team.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddTokenToTeam do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:teams) do 6 | add :token, :string 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20221210011115_set_token_default_values.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.SetTokenDefaultValues do 2 | use Ecto.Migration 3 | 4 | @disable_ddl_transaction true 5 | @disable_migration_lock true 6 | 7 | def change do 8 | alter table(:teams) do 9 | modify :token, :string, default: fragment("gen_random_uuid()") 10 | end 11 | 12 | execute "UPDATE teams SET token=gen_random_uuid() WHERE token is null" 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230110121321_add_sandbox_query_id_column_to_endpoint_queries_t_able.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddSandboxQueryIdColumnToEndpointQueriesTAble do 2 | use Ecto.Migration 3 | 4 | def change do 5 | 6 | alter table(:endpoint_queries) do 7 | add :sandbox_query_id, references(:endpoint_queries, on_delete: :nothing) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230206155428_add_team_token_index.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddTeamTokenIndex do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create unique_index(:teams, [:token]) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230223162441_add_partners.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddPartners do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table :partners do 6 | add :name, :binary 7 | add :token, :binary 8 | end 9 | 10 | unique_index(:partners, [:token]) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230227183828_partner_user_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.PartnerUserTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create table :partner_users do 6 | add :partner_id, references(:partners) 7 | add :user_id, references(:users) 8 | end 9 | 10 | create unique_index(:partner_users, [:partner_id, :user_id]) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230622160150_add_suggested_fields_to_sources.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddSuggestedFieldsToSources do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add(:suggested_keys, :string) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230622160250_set_suggested_fields_default.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.SetSuggestedFieldsDefault do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | modify(:suggested_keys, :string, default: "") 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230714041101_add_language_column_to_endpoint_query.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddLanguageColumnToEndpointQuery do 2 | use Ecto.Migration 3 | 4 | def change do 5 | 6 | alter table(:endpoint_queries) do 7 | add(:language, :string) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230727111150_update_endpoint_query_language_default_value.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.UpdateEndpointQueryLanguageDefaultValue do 2 | use Ecto.Migration 3 | 4 | def change do 5 | execute(fn -> 6 | # set all current existing endpoints 7 | Logflare.Repo.update_all("endpoint_queries", set: [language: "bq_sql"]) 8 | end, fn -> 9 | nil 10 | end) 11 | 12 | alter table("endpoint_queries") do 13 | modify :language, :string, null: false, from: {:string, null: true} 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /priv/repo/migrations/20230807162746_add_endpoint_query_description_column.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddEndpointQueryDescriptionColumn do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:endpoint_queries) do 6 | add(:description, :string) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20231023174255_remove_sandbox_query_id_column_from_endpoint_queries_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.RemoveSandboxQueryIdColumnFromEndpointQueriesTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:endpoint_queries) do 6 | remove :sandbox_query_id, references(:endpoint_queries, on_delete: :nothing) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20231027221103_revert_sandbox_query_id_column_removal.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.RevertSandboxQueryIdColumnRemoval do 2 | use Ecto.Migration 3 | 4 | def up do 5 | alter table(:endpoint_queries) do 6 | add_if_not_exists :sandbox_query_id, references(:endpoint_queries, on_delete: :nothing) 7 | end 8 | end 9 | def down do 10 | 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /priv/repo/migrations/20231207113137_add_user_metadata_column.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddUserMetadataColumn do 2 | use Ecto.Migration 3 | 4 | def up do 5 | 6 | alter table(:users) do 7 | add :metadata, :map 8 | modify(:email, :string, null: true) 9 | end 10 | end 11 | 12 | def down do 13 | 14 | alter table(:users) do 15 | remove :metadata 16 | modify(:email, :string, null: false) 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20231213013433_add_upgraded_column_to_partner_users_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddUpgradedColumnToPartnerUsersTable do 2 | use Ecto.Migration 3 | 4 | def up do 5 | 6 | alter table(:partner_users) do 7 | add :upgraded, :boolean, default: false, null: false 8 | end 9 | end 10 | 11 | def down do 12 | 13 | alter table(:partner_users) do 14 | remove :upgraded 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /priv/repo/migrations/20240214170611_create_backends_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateBackendsTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | 6 | create table("backends") do 7 | add :name, :string 8 | add :description, :text 9 | add :user_id, references("users") 10 | add :type, :string 11 | add :config, :map 12 | timestamps() 13 | end 14 | 15 | create table("sources_backends") do 16 | add :backend_id, references("backends") 17 | add :source_id, references("sources") 18 | end 19 | 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /priv/repo/migrations/20240219101411_alter_alert_queries_table_text_field.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AlterAlertQueriesTableTextField do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:alert_queries) do 6 | modify :query, :text, from: :string 7 | modify :description, :text, from: :string 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20240223104413_add_token_field_to_backends_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddTokenFieldToBackendsTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | 6 | alter table(:backends) do 7 | add :token, :uuid, null: false 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20240327073534_add_cascade_delete_for_partner_users.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddCascadeDeleteForPartnerUsers do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:partner_users) do 6 | modify :user_id, references(:users, on_delete: :delete_all), from: references(:users) 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/repo/migrations/20240429194758_add_backend_id_to_rules.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddBackendIdToRules do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table("rules") do 6 | add :backend_id, references(:backends, on_delete: :delete_all) 7 | modify(:sink, references(:sources, column: :token, type: :uuid, on_delete: :delete_all), null: true, from: {references(:sources, column: :token, type: :uuid, on_delete: :delete_all), null: false}) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20240725033149_add_token_to_rules.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddTokenToRules do 2 | use Ecto.Migration 3 | 4 | def up do 5 | alter table(:rules) do 6 | add :token, :uuid, default: fragment("gen_random_uuid()") 7 | end 8 | execute "UPDATE rules SET token=gen_random_uuid() WHERE token is null" 9 | create unique_index(:rules, [:token]) 10 | end 11 | 12 | def down do 13 | drop index(:rules, [:token]) 14 | alter table(:rules) do 15 | remove(:token, :uuid) 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /priv/repo/migrations/20240725083359_add_metadata_column_to_backends_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddMetadataColumnToBackendsTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | 6 | alter table(:backends) do 7 | add :metadata, :map 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20240806105357_add_service_group_column_to_source_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddServiceGroupColumnToSourceTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | 6 | alter table(:sources) do 7 | add :service_name, :string 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20241121183147_add_transform_copy_fields_column_to_sources_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddTransformCopyFieldsColumnToSourcesTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | 6 | alter table(:sources) do 7 | add :transform_copy_fields, :string 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20241204120824_recreate_tables_publication.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.RecreateTablesPublication do 2 | use Ecto.Migration 3 | use Ecto.Migration 4 | 5 | @publications Application.get_env(:logflare, Logflare.ContextCache.CacheBuster)[:publications] 6 | @table "oauth_access_tokens" 7 | 8 | def up do 9 | for p <- @publications do 10 | execute("ALTER PUBLICATION #{p} ADD TABLE #{@table};") 11 | end 12 | end 13 | 14 | def down do 15 | for p <- @publications do 16 | execute("ALTER PUBLICATION #{p} DROP TABLE #{@table};") 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /priv/repo/migrations/20250203131456_create_index_for_users_partners_upgraded.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateIndexForUsersPartnersUpgraded do 2 | use Ecto.Migration 3 | 4 | def change do 5 | create index(:partner_users,[:partner_id, :user_id, :upgraded]) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /priv/repo/migrations/20250221154207_create_user_partner_details_column.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.CreateUserPartnerDetailsColumn do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:users) do 6 | add :partner_upgraded, :boolean, default: false 7 | add :partner_id, references(:partners), null: true, on_delete: :delete_all 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /priv/repo/migrations/20250422145132_add_disable_tailing_to_sources_table.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Repo.Migrations.AddDisableTailingToSourcesTable do 2 | use Ecto.Migration 3 | 4 | def change do 5 | alter table(:sources) do 6 | add :disable_tailing, :boolean, default: false 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /priv/setup.sql: -------------------------------------------------------------------------------- 1 | -- for wal 2 | ALTER SYSTEM SET wal_level = 'logical'; 3 | 4 | -- allow user access to replication 5 | -- originally from priv/repo/migrations/20210729161959_subscribe_to_postgres.exs 6 | ALTER USER postgres WITH REPLICATION; 7 | 8 | -- create a custom db schema, mainly for testing cli integration 9 | create schema if not exists analytics; -------------------------------------------------------------------------------- /priv/supabase/ingest_samples/deno-subhosting-events.json: -------------------------------------------------------------------------------- 1 | { 2 | "event_message": "2d37e398c3 some textn", 3 | "metadata": { 4 | "deployment_id": "default-4f98-4706-b7a7-10e3af844ace_773", 5 | "event_type": "log", 6 | "execution_id": "fac2b2e9-86f2-4b30-9913-8b6fc1728419", 7 | "function_id": "09f74752-4f98-4706-b7a7-10e3af844ace", 8 | "level": "info", 9 | "project_ref": "default", 10 | "region": "aws-eu-central-1", 11 | "timestamp": "2023-03-23T14:34:17.643993277+00:00", 12 | "version": "773" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /priv/supabase/ingest_samples/pgbouncer.logs.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "event_message": "S-0xaaab05948260: postgres/postgres@127.0.0.1:5432 new connection to server (from 127.0.0.1:42762)", 3 | "metadata": { 4 | "host": "db-default" 5 | }, 6 | "project": "default" 7 | } 8 | -------------------------------------------------------------------------------- /priv/supabase/ingest_samples/postgREST.logs.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "event_message": "Attempting to connect to the database...", 3 | "metadata": { 4 | "host": "default" 5 | }, 6 | "project": "default" 7 | } 8 | -------------------------------------------------------------------------------- /priv/supabase/ingest_samples/storage.logs.prod.2.json: -------------------------------------------------------------------------------- 1 | { 2 | "event_message": "content-type is text/plain;charset=UTF-8", 3 | "metadata": { 4 | "context": { 5 | "host": "ip-10-105-2-212.eu-central-1.compute.internal", 6 | "pid": 1 7 | }, 8 | "level": "info", 9 | "project": "default", 10 | "reqId": "7ac76cc396049558-DUB", 11 | "tenantId": "default" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # load secrets conditionally 4 | if [ -f /tmp/.secrets.env ] 5 | then 6 | echo '/tmp/.secrets.env file present, loading secrets...'; 7 | export $(grep -v '^#' /tmp/.secrets.env | xargs); 8 | fi 9 | 10 | # maybe run a startup script 11 | if [ -f ./startup.sh ] 12 | then 13 | echo 'startup.sh file present, sourcing...'; 14 | sleep .5; 15 | . ./startup.sh; 16 | fi 17 | 18 | echo "LOGFLARE_NODE_HOST is: $LOGFLARE_NODE_HOST" 19 | 20 | ./logflare eval Logflare.Release.migrate 21 | ./logflare start --sname logflare -------------------------------------------------------------------------------- /test/.formatter.exs: -------------------------------------------------------------------------------- 1 | [ 2 | inputs: ["./**/*.{ex,exs}"], 3 | import_deps: [ 4 | :ecto_sql, 5 | :ecto, 6 | :phoenix_live_view, 7 | :stream_data 8 | ] 9 | ] 10 | -------------------------------------------------------------------------------- /test/filebeat.yml: -------------------------------------------------------------------------------- 1 | 2 | filebeat.inputs: 3 | - type: http_endpoint 4 | enabled: true 5 | listen_address: 0.0.0.0 6 | content_type: "" 7 | 8 | output.console: 9 | pretty: true 10 | 11 | -------------------------------------------------------------------------------- /test/logflare/system_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.SystemTest do 2 | @moduledoc false 3 | use ExUnit.Case, async: false 4 | import Logflare.System 5 | 6 | doctest Logflare.System 7 | end 8 | -------------------------------------------------------------------------------- /test/logflare/team_users_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.TeamUsersTest do 2 | @moduledoc false 3 | use Logflare.DataCase 4 | alias Logflare.TeamUsers 5 | 6 | test "list_team_users_by_and_preload/1" do 7 | insert_list(2, :team_user, email: "some email") 8 | insert(:team_user, email: "other email") 9 | assert [%{team: %_{}}] = TeamUsers.list_team_users_by_and_preload(email: "other email") 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /test/logflare/utils/guards_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.Utils.GuardsTest do 2 | use ExUnit.Case, async: true 3 | 4 | doctest Logflare.Utils.Guards 5 | end 6 | -------------------------------------------------------------------------------- /test/logflare/utils_test.exs: -------------------------------------------------------------------------------- 1 | defmodule Logflare.UtilsTest do 2 | @moduledoc false 3 | use ExUnit.Case, async: true 4 | import Logflare.Utils 5 | import Logflare.EnumDeepUpdate 6 | doctest Logflare.EnumDeepUpdate 7 | doctest Logflare.Utils 8 | doctest Logflare.Utils.Map 9 | end 10 | -------------------------------------------------------------------------------- /test/logflare_web/admin/cluster_live_test.exs: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.ClusterLiveTest do 2 | @moduledoc false 3 | use LogflareWeb.ConnCase 4 | import Phoenix.LiveViewTest 5 | 6 | setup do 7 | insert(:plan) 8 | {:ok, user: insert(:user, admin: true)} 9 | end 10 | 11 | test "successfully for admin", %{conn: conn, user: user} do 12 | assert {:ok, view, html} = 13 | conn 14 | |> assign(:user, user) 15 | |> live(~p"/admin/cluster") 16 | 17 | assert html =~ "#{Node.self()}" 18 | html = render(view) 19 | assert html =~ "#{Node.self()}" 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /test/logflare_web/live/alert_component_test.exs: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.AlertComponentTest do 2 | use ExUnit.Case 3 | alias LogflareWeb.AlertComponent 4 | import Phoenix.LiveViewTest 5 | 6 | test "renders alert component" do 7 | assert render_component(AlertComponent, %{ 8 | key: "test", 9 | alert_class: "alert_class", 10 | id: "alert_test" 11 | }) =~ "div" 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/logflare_web/plugs/ndjson_parser_test.exs: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.NdjsonParserTest do 2 | @moduledoc false 3 | use LogflareWeb.ConnCase 4 | 5 | alias LogflareWeb.NdjsonParser 6 | alias Logflare.TestUtils 7 | 8 | test "decodes a non-gzipped ndjson log batch post request", %{conn: conn} do 9 | body = TestUtils.cloudflare_log_push_body(decoded: false) |> :zlib.gunzip() 10 | 11 | data = TestUtils.cloudflare_log_push_body(decoded: true) 12 | 13 | assert NdjsonParser.decode({:ok, body, conn}) == {:ok, data, conn} 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /test/logflare_web/utils_test.exs: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.UtilsTest do 2 | @moduledoc false 3 | use LogflareWeb.ConnCase 4 | import LogflareWeb.Utils 5 | 6 | doctest LogflareWeb.Utils 7 | end 8 | -------------------------------------------------------------------------------- /test/logflare_web/views/docs_view_test.exs: -------------------------------------------------------------------------------- 1 | defmodule LogflareWeb.DocsViewTest do 2 | use LogflareWeb.ConnCase, async: true 3 | import LogflareWeb.DocsView 4 | doctest LogflareWeb.DocsView 5 | end 6 | -------------------------------------------------------------------------------- /test/profiling/buffer_producer.exs: -------------------------------------------------------------------------------- 1 | alias Logflare.Sources 2 | 3 | Mimic.copy(Broadway) 4 | 5 | Mimic.stub(Broadway, :push_messages, fn _, _ -> :ok end) 6 | 7 | arg1 = System.argv() |> Enum.at(0) 8 | source = Sources.get(:"f74e843a-e09d-42e1-b2bc-1915e75b53c5") 9 | 10 | :timer.sleep(100) 11 | 12 | # add 1k batches of 100 13 | batch = 14 | for _ <- 1..100 do 15 | %Logflare.LogEvent{id: "123", message: :something} 16 | end 17 | 18 | Logflare.Backends.IngestEventQueue.upsert_tid({source, nil}) 19 | 20 | for _ <- 1..1000 do 21 | :ok = Logflare.Backends.IngestEventQueue.add_to_table({source, nil}, batch) 22 | end 23 | 24 | # 2024-07-05 after 25 | # CNT ACC (ms) OWN (ms) 26 | # 214,375 434.933 325.246 27 | --------------------------------------------------------------------------------