diff --git a/advanced/index.yml b/advanced/index.yml deleted file mode 100644 index fc16441df..000000000 --- a/advanced/index.yml +++ /dev/null @@ -1,4 +0,0 @@ -label: Advanced -order: -2000 -icon: gear -expanded: false \ No newline at end of file diff --git a/advanced/materialized-keys.md b/advanced/materialized-keys.md deleted file mode 100644 index 2a96da8dc..000000000 --- a/advanced/materialized-keys.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -label: Materialized Keys -order: -3 ---- - -# Materialized Keys in Baselime [Coming Soon] - -Materialized keys in Baselime allow you to calculate and create new keys from existing keys in your events. These new keys are based on calculations performed on one or multiple existing keys, which must be of type `number`. - -To create a materialized key, you can use the `baselime keys materialize` command and specify the key name and calculation you want to perform. For example - -```bash # :icon-terminal: terminal -baselime keys materialize --name "total_revenue" --calculation "event.price * event.quantity" --dataset lambda-logs -``` - -This will create a new materialized key called `total_revenue` which is the result of multiplying the `price` and `quantity` keys in your events in the dataset `lambda-logs`. - -Once you have created a materialized key, it will automatically be included in all your events going forward. You can view and manage your materialized keys in the [Baselime console](https://console.baselime.io). - -!!! -It's important to note that materialized keys are only recalculated when a new event is ingested, so any changes to the calculation or the underlying keys will not be reflected in historical data. -!!! - ---- - -## Syntax - -Materialized keys are calculated keys that are generated based on one or multiple existing keys in your events. Materialized keys can only be generated from existing keys of type number. - -!!!warning -Materialized keys can only take existing `key`s of type `number`. -!!! - - -In Baselime, you can create Materialized Keys through the following operations: - -### Basic arithmetic operations - -- Addition: `+` -- Subtraction: `-` -- Multiplication: `*` -- Division: `/` - -### Advanced operations - -- Modulo: `%` -- Exponentiation: `^` - -### Trigonometric operations - -- Sine: `sin` -- Cosine: `cos` -- Tangent: `tan` -- Inverse Sine: `asin` -- Inverse Cosine: `acos` -- Inverse Tangent: `atan` - ---- - -## Creating materialized keys - -To create a Materialized Key, you can use the `baselime keys materialize` command and specify the operation you want to perform on the existing keys. For example: - -```bash # :icon-terminal: terminal -baselime keys materialize --operation="key1 + key2" --name="materialized_key" --dataset lambda-logs -``` - -This command will create a Materialized Key called `materialized_key` in the dataset `lambda-logs` that is the result of adding `key1` and `key2`. - -You can also use multiple operations and keys to create more complex Materialized Keys. For example: - -```bash # :icon-terminal: terminal -baselime keys materialize --operation="(key1 + key2) * key3" --name="materialized_key" --dataset lambda-logs -``` - -This command will create a Materialized Key called `materialized_key` that is the result of adding `key1` and `key2`, and then multiplying that result with `key3`. - -Once you have created a Materialized Key, you can use it just like any other key in your queries and alert rules. - -## Examples - -Here are some examples of how you can use materialized keys in your events: - -- Calculate the average response time for an API by dividing the total response time by the number of requests -- Calculate the total revenue for an e-commerce store by multiplying the `price` and `quantity` keys for each order -- Calculate the conversion rate for a marketing campaign by dividing the number of conversions by the number of impressions - -You can use these materialized keys to set up alerts, create dashboards, and run queries to gain deeper insights into your data. - ---- - -## Troubleshooting - -If you encounter any issues with materialized keys, here are a few things you can try: - -- Check the syntax of your calculation to make sure it is correct -- Make sure that all the keys used in your calculation exist in your events and are of type `number` -- If you are using multiple keys, make sure they are all present in every event -- If you are still experiencing issues, you can contact the [Baselime support team](https://join.slack.com/t/baselimecommunity/shared_invite/zt-1eu7l0ag1-wxYXQV6Fr_aiB3ZPm3LhDQ) for help. - diff --git a/integrations/index.yml b/integrations/index.yml deleted file mode 100644 index 3fcd8e137..000000000 --- a/integrations/index.yml +++ /dev/null @@ -1,3 +0,0 @@ -label: Integrations -order: -4 -expanded: false diff --git a/integrations/slack/alerts.md b/integrations/slack/alerts.md deleted file mode 100644 index 030f10fea..000000000 --- a/integrations/slack/alerts.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -label: Automated Alerts -order: -2 ---- - -You can set one or multiple Slack channels to receive automated alerts. - -```yaml # :icon-code: .baselime/demo.yml -# Channel ID -developers: - type: channel - properties: - type: slack - targets: - - general - - engineering - - devs -``` -Please make sure that the channels defined either are public, or you have manually added the Baselime Slack app to those. - -Once configured, When an alert that is configured to send notifications to Slack is triggered, the Baselime Slack app will notify all the configured channels. - -![Slack alert](../../assets/images/illustrations/slack/alert.png) \ No newline at end of file diff --git a/integrations/slack/authentication.md b/integrations/slack/authentication.md deleted file mode 100644 index 58e8978ba..000000000 --- a/integrations/slack/authentication.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -label: Authentication -order: -1 ---- - -[Install the Baselime integration for Slack](https://slack.baselime.io/slack/install). - -Once you install the app in your Slack workspace, you can start interacting with Baselime app as a Personal app or access from channels. By default, the Baselime app is enabled in all the public channels. For private channels, you need to explicitly invite /invite @baselime - -At this point, your Slack and Baselime user accounts are not linked. You will be prompted to log in Baselime. This is a primary step required to access the app. - -![Slack welcome message](../../assets/images/illustrations/slack/welcome.png) - -The primary button will redirect you to the Baselime console where you can login and connect your Slack. - -Once this is completed, you will be greeted with a help message 🎉. - -![Successful login](../../assets/images/illustrations/slack/successful.png) \ No newline at end of file diff --git a/integrations/slack/commands.md b/integrations/slack/commands.md deleted file mode 100644 index f495649fa..000000000 --- a/integrations/slack/commands.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -label: Commands -order: -3 ---- - -You can use the `/baselime` command to interact with Baselime straight from Slack. - ---- - -## queries - -### run - -Run a query. - -```bash # :icon-terminal: slack -/baselime queries run --environment --application --ref --from 2days --to 1day -``` - -**Options** - -- `--application`: Name of the application -- `--ref`: Query reference -- `--from`: UTC start time - may also be relative eg: 1h, 20mins -- `--to`: UTC end time - may also be relative eg: 1h, 20mins, now -- `--id`: Query id - -**Result** - -![Slack queries run result](../../assets/images/illustrations/slack/queries.png) - -### list - -[Coming Soon] - ---- - -## help - -Displays help. - -```bash # :icon-terminal: slack -/baselime help -``` diff --git a/integrations/slack/index.yml b/integrations/slack/index.yml deleted file mode 100644 index 92d03e783..000000000 --- a/integrations/slack/index.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: Slack -order: 1 \ No newline at end of file diff --git a/integrations/slack/overview.md b/integrations/slack/overview.md deleted file mode 100644 index 2b2a676f0..000000000 --- a/integrations/slack/overview.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -label: Overview -order: 1 ---- - -# Baselime + Slack Integration - -The Baselime integration for Slack gives you and your team full visibility into your applications right in Slack channels, where you can get alerted, investigate incidents, and manage your observability, as a team. - -![](../../assets/images/illustrations/slack/integration.png) \ No newline at end of file diff --git a/integrations/webhooks/index.yml b/integrations/webhooks/index.yml deleted file mode 100644 index e3c8332d2..000000000 --- a/integrations/webhooks/index.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: Webhooks -order: 2 \ No newline at end of file diff --git a/integrations/webhooks/overview.md b/integrations/webhooks/overview.md deleted file mode 100644 index 5fe87996f..000000000 --- a/integrations/webhooks/overview.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -label: Overview -order: 1 ---- - -# Webhook Integration - -The Webhook integration enables you and your team to send POST requests to an http endpoint when an alert is triggered. - -To set this up, set ``[channel].properties.type`` to webhook and a valid URL in the targets array. - -```yaml # :icon-code: .baselime/demo.yml -internal-bot: - type: channel - properties: - type: webhook - targets: - - https://webhooks.acme.com/bot -``` - -When an alert triggers to a webhook channel, HTTP requests are made to the channel targets using the `/POST` method. Each request carries an event similar to the example outlines below. - - -```json # :icon-code: -{ - "workspace": { - "id": "acme", - "name": "Acme Inc" - }, - "environment": { - "id": "prod", - "alias": "prod" - }, - "application": "user-authentication", - "alert": { - "id": "high-latency", - "name": "Requests have a very high latency", - "description": "" - }, - "check": { - "id": "1661346772147", - "time": "2022-08-24T13:12:52+00:00", - "timeframe": { - "from": 1661343172147, - "to": 1661346772147 - }, - "key": "MAX(latency)", - "value": "118440", - "threshold": { - "operation": ">", - "value": 2000 - } - }, - "query": { - "id": "latency", - "name": "Computes the latency on the requests", - "description": "" - }, - "channel": { - "id": "internal-bot", - "type": "webhook" - }, - "url": "https://console.baselime.cc/acme/prod/user-authentication/alerts/high-latency/1661346772147" -} -``` \ No newline at end of file diff --git a/quick-start.md b/quick-start.md index 5aba48981..89475c6b1 100644 --- a/quick-start.md +++ b/quick-start.md @@ -54,7 +54,6 @@ Congratulations! Your first event should be available to query in Baselime. You - [Sending Data](./sending-data/): Learn how to ingest telemetry data from your cloud-native applications - [Analyzing Data](./analysing-data/overview.md): Discover how to use the various interfaces provided by Baselime to analyze and understand your data -- [Integrations](./): Find out how to connect Baselime with your favorite tools --- diff --git a/sending-data/index.md b/sending-data/index.md index 46f26a7ad..6e3e9c88a 100644 --- a/sending-data/index.md +++ b/sending-data/index.md @@ -12,6 +12,8 @@ Baselime supports a variety of data sources, including logs, metrics, traces, an ### OpenTelemetry [!ref icon="../assets/images/logos/logo_open_telemetry.png"](./opentelemetry/index.md) +### Vercel +[!ref icon="../assets/images/logos/vercel.png"](./vercel.md) ### AWS [!ref icon="../assets/images/logos/logo_aws_lambda.png"](./aws/lambda-logs.md) @@ -23,9 +25,6 @@ Baselime supports a variety of data sources, including logs, metrics, traces, an [!ref icon="../assets/images/logos/logo_cloudtrail.png"](./aws/cloudtrail.md) [!ref icon="../assets/images/logos/logo_cloudwatch.png"](./aws/cloudwatch-metrics.md) -### Vercel -[!ref icon="../assets/images/logos/vercel.png"](./vercel.md) - ### Other Sources [!ref icon="../assets/images/logos/http_flat@3x.png"](./events-api.md) [!ref icon="../assets/images/logos/s3_flat@3x.png"](./s3-rehydration.md) diff --git a/tutorials/cdk.md b/tutorials/cdk.md index 37d1037d9..b5640bb92 100644 --- a/tutorials/cdk.md +++ b/tutorials/cdk.md @@ -3,64 +3,19 @@ label: Baselime CDK order: -1 --- -# Baselime CDK +Baselime natively integrates with any AWS CDK application. This enables you to define your alerts and dashboards as code, alongside your application code. You can re-use your observability configurations, enforce consistency and share best practices with your team, in your codebase. -Baselime natively integrates with any CDK or SST application to let you set up your applications observability along side your existing infrastructure. By defining your Observability resources along side your application using the CDK you get some awesome productivity benefits like being able to reuse the types and resources created by your IAC directly in your observability code. - -```javascript -const api = new Api(stack, "api", { - routes: { - "GET /": "packages/functions/src/lambda.handler", - }, -}); - -new baselime.Query("api-get-resource-logs", {untill - parameters: { - datasets: ["lambda-logs"], - filters: [{ - key: "$baselime.namespace", - value: api.getFunction("GET /")?.functionName as string, - operation: "=", - }], - }, -}); -``` - -These queries can then be used within your alerts and dashboards to paint a complete picture of how your application is performing +--- ## Usage -### Setting up the Baselime CDK - -The `@baselime/cdk` package should be installed in the same folder as your cdk application. +Install the dependencies. ```bash -# Select your projects package manager -pnpm i --save-dev @baselime/cdk npm i --save-dev @baselime/cdk -yarn add -D @baselime/cdk -``` - -Next and store your api key in ssm. You can find your api key in CLI when running - -```bash -baselime iam ``` -or download it from [console.baselime.io](https://console.baselime.io/) - -![Get your API Key from the Console](../assets/images/illustrations/api-key.png) - -Then add the parameter to SSM - -```bash -aws ssm put-parameter --name "/baselime/api-key" --value "" --type "SecureString" -``` - -> If you deploy your application to multiple aws accounts and multiple Baselime environments make sure you add a baselime api key per environment and prefix with the correct stage variable - - -Finally you can initialise `@baselime/cdk` in your CDK stack. +Initialise `@baselime/cdk` in your CDK stack. ```javascript @@ -71,8 +26,7 @@ import { Baselime } from "@baselime/cdk"; export function API({ stack }: StackContext) { baselime.init(stack, { - // Remember to add a stage to your parameter if required - apiKey: ssm.StringParameter.valueForStringParameter(stack, `/baselime/api-key`), + apiKey: '', }); const api = new Api(stack, "api", { @@ -248,4 +202,4 @@ revenueQuery.addAlert({ ### Conclusion -Baselime CDK is a useful tool to test in prod. It can help catch issues as they happen so you can take effective corrective action, setting it up in your CDK stack is super effective because its now front of mind when designing the infrastructure for your service. \ No newline at end of file +Baselime CDK is a useful tool to test in prod. It can help catch issues as they happen so you can take effective corrective action, setting it up in your CDK stack is super effective because its now front of mind when designing the infrastructure for your service.