Commit Graph
255 Commits
Author SHA1 Message Date
HuaijinandHengfei Yang cacf46e480 feat: only enable tracing in search (#3230)
close #3215 
use follow to only enable tracing in search
```
ZO_TRACING_ENABLED=false
ZO_TRACING_SEARCH_ENABLED=true 
```

---------

Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2024-04-15 18:43:34 +08:00
Hengfei Yang a48326861f feat: complete super cluster (#3226) 2024-04-12 13:45:02 +08:00
HuaijinandHengfei Yang e7f17e0541 chore: rename search_job to query_manager (#3214)
rename cancel job related api
from 
```
#[delete("/search_job/{trace_id}")]
#[get("/search_job/status")]
```
to 
```
#[delete("/query_manager/{trace_id}")]
#[get("/query_manager/status")]
```

---------

Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2024-04-10 22:50:14 +08:00
Huaijin 35d42fe228 feat: replace sessiond_id to trace_id when enable tracing (#3204) 2024-04-10 13:38:22 +08:00
Huaijin b8e1790030 fix: modify cancel query status code to 429 (#3206) 2024-04-10 13:17:12 +08:00
Huaijin 951c55bd92 feat: make user can cancel query task by session_id (#3130) 2024-04-08 23:43:05 +08:00
Hengfei Yang b017352b11 fix: traces metadata write error (#3187) 2024-04-07 20:09:10 +08:00
Hengfei Yang 611b955b10 refactor: separate search structure to config crate (#3186)
- [x] Separate search structure into config crate
- [x] fixed #3084
2024-04-07 12:01:47 +08:00
Hengfei Yang 42cffffe31 fix: node cache status (#3170) 2024-04-05 19:04:45 +08:00
Hengfei Yang 0c33ee62d7 perf: node cache status (#3169) 2024-04-05 16:29:49 +08:00
Hengfei Yang aba980714f feat: add auth cookie max age to 30 days (#3165) 2024-04-05 15:23:34 +08:00
Ashish Kolhe 82eb6e6e15 fix: cookie settings as env variable (#3152) 2024-04-03 15:24:21 +05:30
Ashish Kolhe 00fdce8c83 chore: cookies for authentication (#3144)
This will break openobserve cloud , DON'T deploy UI changes until we
accommodate cookies for cloud
2024-04-03 05:35:54 +05:30
Hengfei Yang 6d0fbdd91d refactor: separate proto to a new crate (#3146) 2024-04-02 23:15:14 +08:00
Hengfei Yang 7d502419f1 feat: use database lock replace etcd lock (#3107) 2024-04-02 21:09:16 +08:00
Ashish Kolhe 91f02d1e6b chore: update native login & openapi specs (#3132) 2024-04-01 16:05:25 +05:30
Subhra264andomkark06 62b79416e3 feat: add custom hide menu field in the /config (#3125)
config settings for hiding menu items

---------

Co-authored-by: omkark06 <omkar@zinclabs.io>
2024-03-28 23:34:20 +05:30
Subhra264 f4a5150895 feat: add query start_time and end_time for reporting a search query usage (#3097)
Reports `query.start_time` and `query.end_time` as `min_ts` and `max_ts`
respectively for the "Search" event in `usage` stream.
2024-03-26 13:05:46 +05:30
Subhra264 08d12f8571 feat: introduce reports in backend and replace TRIGGERS with infra::scheduler (#3086)
## Reports
Both `ZO_CHROME_ENABLED` and `ZO_SMTP_ENABLED` ENV variables need to be
`true` for reports to work.

**Report APIs -**
```
POST /api/{org_id}/reports
PUT /api/{org_id}/reports/{report_name}
GET /api/{org_id}/reports
GET /api/{org_id}/reports/{report_name}
DELETE /api/{org_id}/reports/{report_name}
PUT /api/{org_id}/reports/{report_name}/enable?value=<true|false>
```

**Report body**
```
{
  "createdAt": "2024-03-23T09:46:32.913574782Z",
  "dashboards": [
    {
      "dashboard": "7177215109754781699",
      "folder": "default",
      "tabs": [
        "default"
      ],
      "timerange": {
        "from": 0,
        "period": "1h",
        "to": 0,
        "type": "relative"
      },
      "variables": []
    }
  ],
  "description": "Report description",
  "destinations": [
    {
      "email": "mail@gmail.com"
    }
  ],
  "enabled": false,
  "frequency": {
    "cron": "",
    "interval": 1,
    "type": "weeks"
  },
  "lastEditedBy": "root@example.com",
  "mediaType": "pdf",
  "message": "Email message",
  "name": "report_name",
  "orgId": "default",
  "owner": "root@example.com",
  "password": "ComplexPass#123",
  "start": 1711187192913571,
  "timezone": "Asia/Calcutta",
  "timezoneOffset": 330,
  "title": "Email subject",
  "user": "root@example.com"
}
```

**ENVs**
| ENV |  Description | 
|------|---------------|
| `ZO_CHROME_ENABLED` | Must be `true` for reports, Default - `false` |
| `ZO_CHROME_PATH` | If chrome is enabled, custom `chrome` executable
path can be specified. If not specified, it looks for chrome executable
in default locations. If still not found, it automatically downloads a
good known version of `chromium`. |
| `ZO_CHROME_CHECK_DEFAULT_PATH` | If `false`, it does not look for
chromium in default locations, Default is `true`. |
| `ZO_CHROME_DOWNLOAD_PATH` | If chromium can not be found in default
locations and also `ZO_CHROME_PATH` is not specified, it downloads the
system specific chromium in the given path. Default is `./download`
(gitignored). `chromium` is downloaded for the first time only,
afterwords, `chromium` is fetched from the given path. If there is any
error regarding download of `chromium`, delete the download folder as it
might be in a bad state. |
| `ZO_CHROME_NO_SANDBOX` | If `true`, it launches chromium in
`no-sandbox` environment. Default is `false` |
| `ZO_CHROME_SLEEP_SECS` | Specify the number of seconds the
`service::dashboards::reports::generate_report()` will wait to load all
the data in the headless chromium dashboard. Default is `20` seconds. |
| `ZO_CHROME_WINDOW_WIDTH` | Specifies the width of the headless
chromium browser. Default is `1370` |
| `ZO_CHROME_WINDOW_HEIGHT` | Specifies the height of the headless
chromium browser. Default is `730` |

## Scheduler

Currently `Scheduler` is implemented for only `Sqlite`, `Postgres` and
`MySql`.
**API**
```rust
pub trait Scheduler: Sync + Send + 'static {
    async fn create_table(&self) -> Result<()>;
    async fn create_table_index(&self) -> Result<()>;
    async fn push(&self, trigger: Trigger) -> Result<()>;
    async fn delete(&self, org: &str, module: TriggerModule, key: &str) -> Result<()>;
    async fn update_status(
        &self,
        org: &str,
        module: TriggerModule,
        key: &str,
        status: TriggerStatus,
        retries: i32,
    ) -> Result<()>;
    async fn update_trigger(&self, trigger: Trigger) -> Result<()>;
    async fn pull(
        &self,
        concurrency: i64,
        alert_timeout: i64,
        report_timeout: i64,
    ) -> Result<Vec<Trigger>>;
    async fn clean_complete(&self, interval: u64);
    async fn watch_timeout(&self, interval: u64);
    async fn len_module(&self, module: TriggerModule) -> usize;
    async fn len(&self) -> usize;
    async fn is_empty(&self) -> bool;
    async fn clear(&self) -> Result<()>;
}
```

**ENVs**
| ENV |  Description | 
|------|---------------|
| `ZO_ALERT_SCHEDULE_CONCURRENCY` | The number of `scheduled_jobs` the
`alert_manager` can process at a time. Default is `5` |
| `ZO_ALERT_SCHEDULE_TIMEOUT` | Visibility timeout for alerts. Default
is `90` seconds |
| `ZO_REPORT_SCHEDULE_TIMEOUT` | Visibility timeout for reports. Default
is `300` seconds |
| `ZO_SCHEDULER_MAX_RETRIES` | Maximum number of retries that will be
made for a `scheduled_job`. Default is `3` |
| `ZO_SCHEDULER_CLEAN_INTERVAL` | Time interval after which the
`Scheduler` will clean up the queue. Default is `30` seconds |
| `ZO_SCHEDULER_WATCH_INTERVAL` | Time interval after which the
`Scheduler` will watch for timeout for `scheduled_jobs`. Default is `30`
seconds. |

**Workflow**

![openobserve_scheduler_workflow](https://github.com/openobserve/openobserve/assets/59690052/68beb43b-d04f-49dc-9006-a30942acd99b)
2024-03-25 18:24:14 +05:30
Hengfei Yang d4b0580205 feat: add new endpoint for health check (#3090) 2024-03-25 10:22:36 +08:00
Hengfei Yang fd49360f49 feat: add quick mode fields (#3068) 2024-03-22 15:54:39 +08:00
Subhra264 423c1a44ef feat: introduce enterprise api for uploading/deleting custom logo (#3034) 2024-03-21 11:36:29 +08:00
Ashish KolheandHengfei Yang 2e4515b4d3 fix: report user email for values & search around (#3036)
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2024-03-18 20:48:52 +05:30
Hengfei Yang f1a7ad0961 feat: update datafusion to 36 (#3035) 2024-03-18 22:50:26 +08:00
Hengfei Yang e33ae00ea1 feat: merge dev into main (#3016) 2024-03-17 22:38:07 +08:00
Hengfei Yangandomkark06 a8f3fbc402 fix: search field not found (#3007)
Co-authored-by: omkark06 <omkar@zinclabs.io>
2024-03-17 01:09:08 +08:00
Hengfei YangandBhargav 725e91c0e4 fix: cache latest file & cache stream fields (#2955)
Add a new ENV for it: `ZO_FAST_MODE_FILE_LIST_INTERVAL=300`, update
every 5 minutes.

Other new environments:
```
ZO_RUM_ENABLED=false
ZO_RUM_CLIENT_TOKEN=""
ZO_RUM_APPLICATION_ID=""
ZO_RUM_SITE=""
ZO_RUM_SERVICE=""
ZO_RUM_ENV=""
ZO_RUM_VERSION=""
ZO_RUM_ORGANIZATION_IDENTIFIER=""
ZO_RUM_API_VERSION=""
ZO_RUM_INSECURE_HTTP=false

O2_CUSTOM_SLACK_URL=""
O2_CUSTOM_DOCS_URL=""
```

- Doc URL and Slack URL will be custom configurable for enterprise
version
- RUM configuration can be enabled via environment variable.

---------

Co-authored-by: Bhargav <BJP232004@GMAIL.COM>
2024-03-13 20:29:16 +05:30
67078a0849 fix: debug quick mode (#2934)
Co-authored-by: oasisk <ashish.j.kolhe@gmail.com>
Co-authored-by: omkark06 <omkar@zinclabs.io>
Co-authored-by: Ashish Kolhe <35160958+oasisk@users.noreply.github.com>
2024-03-11 17:17:35 +05:30
Ashish Kolhe 61cca228e4 fix: config variables (#2898) 2024-03-07 20:20:56 +05:30
Bhargav ef2fd50709 fix: Custom logo text single line (#2895)
Logo text for enterprise version (two places: Login Page, Top left on
every page)
Renamed Fast Mode to Quick Mode
2024-03-07 19:27:41 +05:30
Hengfei Yang cccdadfea8 fix: generate index with array distinct (#2889) 2024-03-07 18:22:53 +08:00
Hengfei Yangandoasisk e1097f86e2 feat: add fast mode for query (#2876)
Use **Fast Mode** when dealing with thousands of fields. It retrieves
the first N fields for a quicker response.

Enable it through this configuration: 

```
ZO_FAST_MODE_NUM_FIELDS=50
ZO_FAST_MODE_STRATEGY=first/last/both
```

And use the search API:

```json
{
	"query": {
		"sql": "select * from default ",
		"start_time": 1709711116396000,
		"end_time": 1709712016396000,
		"from": 0,
		"size": 250,
		"sql_mode": "full",
		"fast_mode": true
	}
}
```

When the backend identifies a request:
- Using `fast_mode` 
- With an `SQL` prefix of `select *` 
- Where schema fields exceed `ZO_FAST_MODE_NUM_FIELDS` 

It will then rewrite the `SQL` to `select f1,f2,f3`, where 'fn'
represents the first 'n' fields from schema. The value of 'n' is
determined by `ZO_FAST_MODE_NUM_FIELDS`.

In the end you can set `ZO_FAST_MODE_STRATEGY=first/last/both` to
control the order for pickup fields from schema.

---------

Co-authored-by: oasisk <ashish.j.kolhe@gmail.com>
2024-03-06 19:50:30 +05:30
Subhra264 65cd8104f2 feat: introduce alert emails in backend (#2825)
Addresses #2601.

No breaking API changes. For destination and template, previous API
payloads work as "http" type destination/template payload. For "email"
destination/template -

**Email destination**
supports multiple emails. Example payload -
```
{
    "name": "email destination",
    "template": "my new template",
    "emails": ["example@hi.com", "hi@mail.com"],
    "type": "email"
}
```
The above payload creates the following Destination instance - 
```
{
    "name": "email destination",
    "url": "", //ignored
    "method": "post", //ignored
    "skip_tls_verify": false, //ignored
    "template": "my new template",
    "emails": [
      "subhradeepc461@gmail.com",
      "chakrabortyabhradeep79@gmail.com"
    ],
    "type": "email"
}
```

**Email template**
Example API payload. Supports all variables in "{}" as it does for the
"http" template -
```
{
    "name": "my new template",
    "body": "<b>Hello</b> {alert_name} <i>World!</i>",
    "isDefault": true,
    "type": "email"
}
```
2024-03-01 22:08:11 +05:30
Hengfei Yang 088c2e03f4 fix: can't create same name alerts (#2786)
- [x] Can't create same name alerts
- [x] Can't create same name destination
- [x] Can't create same name template
2024-02-27 07:30:15 +08:00
Ashish Kolhe 5bc9d93e23 fix: list should return only allowed objects (#2785) 2024-02-26 22:08:54 +05:30
Hengfei Yang 747279aaff fix: _value API with query_context (#2744) 2024-02-20 22:29:58 +08:00
Hengfei Yang 8bf0b87a23 fix: set node online again (#2741) 2024-02-20 19:21:49 +08:00
Ashish Kolhe e1bf4af0b6 fix: map group claim to role (#2732) 2024-02-19 11:12:18 -08:00
Hengfei Yang 326d3c4dd5 feat: add freqency for alert API (#2719) 2024-02-19 11:34:30 +08:00
Hengfei Yang 24919333d6 perf: improve traces ingestion (#2708) 2024-02-16 23:23:02 +08:00
Ashish Kolheandomkark06 763d31d9ea chore: role mapping issues (#2707)
Co-authored-by: omkark06 <omkar@zinclabs.io>
2024-02-16 18:43:53 +05:30
Hengfei Yang 8542dd0c2a fix: search around error when order by _timestamp asc (#2689) 2024-02-12 11:32:36 +08:00
Ashish Kolheandomkark06 2b8c5dc276 fix: disable internal login (#2686)
Co-authored-by: omkark06 <omkar@zinclabs.io>
2024-02-11 20:48:17 +05:30
Ashish Kolheandomkark06 d9e022bc04 fix: support native users in rbac (#2683)
Co-authored-by: omkark06 <omkar@zinclabs.io>
2024-02-11 10:43:01 +05:30
Hengfei Yang 644a475256 feat: compactor supports lock on stream level (#2664) 2024-02-09 09:26:18 +08:00
Ankur Srivastava cf31e297a0 fix: added the missing org_id before creating the sql (#2675) 2024-02-08 11:53:38 +01:00
Ashish Kolhe eed6625097 chore: refactor rbac code (#2668) 2024-02-07 17:18:11 +05:30
Hengfei Yang 59a9e4b060 fix: schema chk (#2661) 2024-02-06 20:20:29 +08:00
Ashish Kolhe 1947bca6d2 fix: ReBAC issues (#2659) 2024-02-06 07:24:45 +05:30
Ashish Kolheandomkark06 ead43c9873 fix: add delete for roles & groups (#2643)
Co-authored-by: omkark06 <omkar@zinclabs.io>
2024-02-03 19:28:37 +05:30