-
Notifications
You must be signed in to change notification settings - Fork 9
doc: improve documentation #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f12bd2a
doc: add tour sections
StewartJingga 081c6e0
Merge remote-tracking branch 'origin/main' into update-docs
StewartJingga ebd8580
feat: add Tour section
StewartJingga a57fc52
doc: update docs
StewartJingga 33a0650
doc: update docs
StewartJingga 5acdb87
doc: update docs
StewartJingga c6d29fa
doc: update docs
StewartJingga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Overview | ||
|
|
||
| Compass has three major concept when it comes to data ingestion: Asset, Type, and Service. | ||
|
|
||
| Asset is the main model that represents a metadata of a specific service with a specific type. | ||
|
|
||
| Type defines a ‘type’ of an asset and it is pre-defined. Compass currently supports the following types: | ||
| 1. `table` | ||
| 2. `job` | ||
| 3. `dashboard` | ||
| 4. `topic` | ||
| 5. `feature_table` | ||
| 6. `model` (under development) | ||
| 7. `application` (under development) | ||
|
|
||
| Service defines the application or source that maintains or generates the asset. Examples would be `biquery`, `postgres`, etc. | ||
|
|
||
| Some features that compass has: | ||
| * [Discovery](../tour/2-querying-assets.mdx) | ||
| * [Lineage](../tour/3-asset-lineage.mdx) | ||
| * [Asset Tagging](./asset#tagging-an-asset) | ||
| * [User](./user.md) | ||
| * [Discussion](../guides/discussion.md) | ||
| * [Starring](../guides/starring.md) | ||
|
|
||
| ## Discussion | ||
| Compass supports discussion feature. User could drop comments in each discussion. Currently, there are three types of discussions `issues`, `open ended`, and `question and answer`. Depending on the type, the discussion could have multiple possible states. In the current version, all types only have two states: `open` and `closed`. A newly created discussion will always be assign an `open` state. More detail about [Discussion](../guides/discussion.md). | ||
|
|
||
| ## Starring | ||
| Compass allows a user to stars an asset. This bookmarking functionality is introduced to increase the speed of a user to get information. There is also an API to see which users star an asset (stargazers). More detail about [Starring](../guides/starring.md). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Type | ||
|
|
||
| Each Asset will have a `Type` to represent the kind of metadata it represents. It is currently pre-defined by Compass, so no arbitrary types will be supported. | ||
|
|
||
| Compass currently supports the following types: | ||
| 1. `table` | ||
| 2. `job` | ||
| 3. `dashboard` | ||
| 4. `topic` | ||
| 5. `feature_table` | ||
| 6. `model` (under development) | ||
StewartJingga marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 7. `application` (under development) | ||
|
|
||
| Type will be extremely useful for categorizing your assets and it will be really helpful during discovery. | ||
| Check [this section on querying assets](../guides/querying#using-the-get-assets-api) on how to leverage `type` for your discovery. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # 1. My First Asset | ||
|
|
||
| Before starting the tour, make sure you have a running Compass instance. You can refer this [installation guide](../installation). | ||
|
|
||
| ## 1.1 Introduction | ||
|
|
||
| In Compass, we call every metadata that you input as an [Asset](../concepts/asset). All your tables, dashboards, topics, jobs are an example of assets. | ||
|
|
||
| In this section, we will help you to build your first Asset and hopefully it will give your clear idea about what an Asset is in Compass. | ||
|
|
||
| ## 1.2 Hello, ~~World~~ Asset! | ||
|
|
||
| Let's imagine we have a `postgres` instance that we keep referring to as our `main-postgres`. Inside it there is a database called `my-database` that has plenty of tables. One of the tables is named `orders`, and below is how you represent that `table` as an Compass' Asset. | ||
|
|
||
| ```json | ||
| { | ||
| "urn": "main-postgres:my-database.orders", | ||
| "type": "table", | ||
| "service": "postgres", | ||
| "name": "orders", | ||
| "data": { | ||
| "database": "my-database", | ||
| "namespace": "main-postgres" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| - **urn** is a unique name you assign to an asset. You need to make sure you don't have a duplicate urns across all of your assets because Compass treats `urn` as an identifier of your asset. For this example, we use the following format to make sure our urn is unique, `{NAMESPACE}:{DB_NAME}.{TABLE_NAME}`. (more info about URN generation can be found [here](../guides/urn-generation)) | ||
|
|
||
| - **type** is your Asset's type. The value for type has to be recognizable by Compass. More info about Asset's Type can be found [here](../concepts/type). | ||
|
|
||
| - **service** can be seen as the source of your asset. `service` can be anything, in this case since our `orders` table resides in `postgres`, we can just put `postgres` as the service. | ||
|
|
||
| - **name** is the name of your asset, it does not have to be unique. We don't need to worry to get mixed up if there are other tables with the same name, `urn` will be the main identifier for your asset, that is why we need to make it unique across all of your assets. | ||
|
|
||
| - **data** can hold your asset's extra details if there is any. In the example, we use it to store information of the **database name** and the **alias/namespace** that we use when referring the postgres instance. | ||
|
|
||
| ## 1.3 Sending your first asset to Compass | ||
|
|
||
| Here is the asset that we built on previous section. | ||
|
|
||
| ```json | ||
| { | ||
| "urn": "main-postgres:my-database.orders", | ||
| "type": "table", | ||
| "service": "postgres", | ||
| "name": "orders", | ||
| "data": { | ||
| "database": "my-database", | ||
| "namespace": "main-postgres" | ||
| } | ||
| } | ||
| ``` | ||
| Let's send this into Compass so that it would be discoverable. | ||
|
|
||
| As of now, Compass supports ingesting assets via `gRPC` and `http`. In this example, we will use `http` to send your first asset to Compass. | ||
| Compass exposes an API `[PATCH] /v1beta1/assets` to upload your asset. | ||
|
|
||
| ```bash | ||
| curl --location --request PATCH 'http://localhost:8080/v1beta1/assets' \ | ||
| --header 'Content-Type: application/json' \ | ||
| --header 'Compass-User-UUID: [email protected]' \ | ||
| --data-raw '{ | ||
| "asset": { | ||
| "urn": "main-postgres:my-database.orders", | ||
| "type": "table", | ||
| "service": "postgres", | ||
| "name": "orders", | ||
| "data": { | ||
| "database": "my-database", | ||
| "namespace": "main-postgres" | ||
| } | ||
| } | ||
| }' | ||
| ``` | ||
|
|
||
| There are a few things to notice here: | ||
| 1. The HTTP method used is `PATCH`. This is because Compass does not have a dedicated `Create` API, it uses a single API to `Patch / Create` an asset instead. So when updating or patching your asset, you can use the same API. | ||
|
|
||
| 2. Compass requires `Compass-User-UUID` header to be in the request. More information about the identity header can be found [here](../concepts/user). To simplify this tour, let's just use `[email protected]`. | ||
|
|
||
| 3. When sending our asset to Compass, we need to put our asset object inside an `asset` field as shown in the sample curl above. | ||
|
|
||
| On a success insertion, your will receive below response: | ||
|
|
||
| ```json | ||
| { "id": "cebeb793-8933-434c-b38f-beb6dbad91a5" } | ||
| ``` | ||
|
|
||
| **id** is an identifier of your asset. Unlike `urn` which is provided by you, `id` is auto generated by Compass if there was no asset found with the given URN. | ||
|
|
||
| ## Conclusion | ||
|
|
||
| Now that you have successfully ingested your asset to Compass, we can now search and find it via Compass. | ||
|
|
||
| In the next section, we will see how Compass can help you in searching and discovering your assets. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.