# Quick Start

Getting started with Baselime and starting discovering the benefits of Observability as Code (OaC) takes less than 5 minutes.

All you need is:

If you do not have a deployed application, you can use one of our example applications.

# Step 1: Sign up for Baselime

Baselime has a free usage tier.

Signup on the Baselime console.

Follow the onboarding process:

  1. Create a workspace. Typically this will be the name of your organisation.
  2. Connect your AWS Account

# Step 2: Connect your AWS Account

In order to ingest data from your serverless systems, Baselime needs to connect to your AWS account. This is done by deploying a CloudFormation template onto your AWS account.

The CloudFormation template will:

  • Create a role with read-only access to your account, plus permission to create a Lambda Function and add permissions to it
  • An S3 Bucket, to store CloudTrail data
  • An SNS Topic, used to signal new data in the aforementioned S3 Bucket
  • A CloudTrail Trail, used to register changes to your serverless architecture

We've open-sourced the CloudFormation template here.

You can generate and download this template through the Baselime Console.

Once you've generated and downloaded the template, you must deploy it to your AWS Account. Baselime automatically opens a new tab in your default browser with the link to deploy the downloaded CloudFormation template. Simply follow the step in CloudFormation without changing any of the provided values to deploy the stack on your AWS account.

Telemetry data (in the form of logs and metrics) should now be automatically ingested from your AWS account to Baselime and should be available through our various clients. Structured logs sent to stdout or stderr from your Lambda functions will be sent to Baselime as events.

Send a request to or invoke any deployed AWS Lambda function in your account and you should see data from it in the Baselime console within seconds. Moreover, you can stream all the events ingeste in Baselime directly in your terminal.

# Step 3: Install the Baselime CLI

# Using Homebrew

# Add Baselime brew repository
brew tap baselime/tap

# Install the CLI
brew install baselime

# Manual Install

# Install the Baselime CLI on MacOS manually
curl -s https://get.baselime.io | bash
# Download and install the Baselime CLI on every Linux distribution
curl -s https://get.baselime.io | bash

# Step 4: Log in the Baselime CLI

After creating an account, you should log in the Baselime CLI.

baselime auth login

# Step 5: Deploy your observability

The power of Baselime is in its Observability as Code (OaC) capabilities. Baselime empowers you and your team to manage observability resources as code.

In the root of your project folder, initialise a new Baselime config folder.

baselime init --application demo --template @baselime/basic-lambdas-logs

The Baselime CLI will initialise your working directory with a .baselime folder. It will automatically add sample observability resources (queries, alerts and alert channels) based on the template you selected in the previous command. This would help getting you started.

version: 0.0.3
application: demo
description: ""
  type: query
    name: Duration of lambda cold-starts
    description: How long do cold starts take on our API?
      dataset: logs
        - MAX(@initDuration)
        - MIN(@initDuration)
        - AVG(@initDuration)
        - P99(@initDuration)
        - COUNT
        - "@type := REPORT"
      filterCombination: AND
  type: alert
    name: Lambda cold-starts take more than 2 seconds
      query: !ref lambda-cold-start-durations
      frequency: 30
      duration: 30
      threshold: :> 2000
      - !ref developers
  type: channel
    type: email
      - your_email@email.com

Don't hesitate to tweak the query and the alert. The complete set of parameters for the .baselime folder can be found in the Observability as Code section.

Validate your .baselime configuration folder

baselime validate
✔ Valid configuration folder

Apply the changes to the .baselime folder to Baselime

baselime apply

To run a query in your command line:

baselime queries run --application demo --id lambda-cold-start-durations

This will output the results of the query in the command line, with a link that will redirect to the results in the web console.

# Next Steps

Now you can setup our Observability as Code (OaC). Next up is to send more telemetry data to Baselime.