Adding external documentation
Last updated
Last updated
Cortex is your source of truth to external docs. Instead of digging through wikis and other resources, you can aggregate docs on the relevant entities in Cortex in the following ways:
If you have configured the , you can use Slack Bot commands to .
Links appear on an entity details page in the Links & docs section:
On entities, you can add links to docs, runbooks, tech specs, dashboards, and more.
In Cortex, navigate to an entity.
In the upper right corner of the entity details page, click Configure entity.
Click the Links tab.
Click +Add.
Configure the link:
To create a new type, enter the type name then click the name in the dropdown.
Name: Enter a name for the link.
URL: Enter the URL.
Description: Add a description of the link.
Click Add.
Cortex automatically embeds markdown files from the docs
folder of your repo or from the root directory. If Cortex detects relevant files, these docs show up under the Links & docs page in an entity's sidebar.
If you have specs checked into your git repository, you can embed it by adding it as a relative URL with type openapi
. For example:
In addition to providing the ability to link to specs within the service repo, Cortex also allows for links that reference other git repositories that aren't necessarily associated with your entity but still within your organization.
Power users can also specify a branch
parameter between the second and the third colon separated group, in the form github:org/repo:branch:path/to/file
. If this parameter is omitted, we will use the repository's default branch.
The request body is the following, in JSON format. See API Docs for authentication details.
spec
string
The json or yaml as a string
Converting YAML or JSON to string You can use a lightweight utility like jq to take your yaml/json and generate a string that can be used for your request:
e.g. $(cat my_file.yaml | jq -Rsa)
If you have specs checked into your Git repository, you can embed it by adding it as a relative URL with type async_api
. For example:
The type
field is an optional enum of three types: datadog
, grafana
, or newrelic
.
The url
field is the src
value for the iframe
embed generated by your dashboard tool.
You must use your tool's embed URL for individual charts.
It is possible to display content from a source other than Datadog, Grafana, or New Relic. To do this, do not specify an option for the type
field. The URL you add must be publicly accessible or provide cross-platform authentication for Cortex to view and display the iframe. For example, if the content is accessible via VPN, then you should be able to view it in Cortex while on the VPN.
/slack links <tag-or-id>
to list all documentation links for an entity
/slack links [type] <tag-or-id>
to list specific types of documentation links for an entity
For example:
To list all documentation links for an entity with ID en29f044598b112345
, you could run the following command in Slack:
/cortex links en29f044598b112345
To list the OpenAPI specs for an entity with tag plugin-extension
, you could run the following command in Slack:
/cortex links openapi plugin-extension
Before editing an entity via the UI, make sure that UI editing is enabled under .
Type: Select the .
Learn more about , , and types below.
The value of type
can be defined based on your organization's preferences. Common examples include dashboard, documentation, healthcheck, logs, metrics, and runbook. See the sections below on this page describing , , and .
You can quickly look up links using the .
Cortex uses the for rendering the documents.
When , Cortex supports embedding OpenAPI or AsyncAPI specs, embedding specs from your repository, adding relative links to a repository that isn't associated with the entity, and embedding charts (from Datadog, Grafana, New Relic, or other sources). You can also create a custom type while .
Cortex supports displaying Swagger/OpenAPI or AsyncAPI specs for each entity in the API explorer on an . You can also authorize your API and run queries directly in the API explorer.
You can use your file as an OpenAPI spec file. As mentioned in the , the entity descriptor file extends the OpenAPI spec, so you can implement the spec directly in this file.
You may have existing or external specs you want to display in the API explorer from sources such as Swagger Hub or GitHub Raw URL. Add these to the JSON or YAML spec file under the block, with the type openapi
.
Using your , you can also send your OpenAPI JSON or YAML file to the public /api/v1/catalog/documentation/openapi
for each of your entities. One API doc per entity can be uploaded and it will automatically show up as an API Doc
entry in the dropdown in the API explorer.
You may have existing or external specs you want to display in the API explorer from sources such as Swagger Hub or GitHub Raw URL. Add these to the JSON or YAML spec file under the block, with the type async_api
.
Cortex supports embedding charts from , , or directly into an entity for quick access. To view embedded charts, click the Dashboard page in the .
If you're using Grafana and seeing errors in your Grafana embeds, make sure your Grafana instance .
If you have configured the , you can use commands to list documentation directly in Slack:
The type
corresponds to the type of documentation (e.g., openapi
, documentation
, etc.). Replace <tag-or-id>
with the .
The Slack Bot links
command works for any docs links listed under x-cortex-links
. Note that it does not list the listed under x-cortex-dashboards
.