# 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

terminal
# Add Baselime brew repository
brew tap baselime/tap

# Install the CLI
brew install baselime

# Manual Install

terminal
# Install the Baselime CLI on MacOS manually
curl -s https://get.baselime.io | bash
terminal
# 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.

terminal
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.

terminal
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.

.baselime/index.yml
version: 0.0.3
application: demo
description: ""
.baselime/demo.yml
lambda-cold-start-durations:
  type: query
  properties:
    name: Duration of lambda cold-starts
    description: How long do cold starts take on our API?
    parameters:
      dataset: logs
      calculations:
        - MAX(@initDuration)
        - MIN(@initDuration)
        - AVG(@initDuration)
        - P99(@initDuration)
        - COUNT
      filters:
        - "@type := REPORT"
      filterCombination: AND
critical-cold-start-duration:
  type: alert
  properties:
    name: Lambda cold-starts take more than 2 seconds
    parameters:
      query: !ref lambda-cold-start-durations
      frequency: 30
      duration: 30
      threshold: :> 2000
    channels:
      - !ref developers
developers:
  type: channel
  properties:
    type: email
    targets:
      - 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

terminal
baselime validate
✔ Valid configuration folder

Apply the changes to the .baselime folder to Baselime

terminal
baselime apply

To run a query in your command line:

terminal
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.