# Quick Start


Integrating with Baselime and getting deep insights into your production serverless systems takes less than 5 minutes.

All you need is:

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


# Step 1: Install the Baselime CLI

curl -s https://get.baselime.io | bash

# Step 2: Sign up for Baselime

Baselime has a free usage tier.

You can sign up using the Baselime CLI.

baselime auth

You will get a window in your browser to create an account.

Follow the onboarding process:

  1. Create a workspace. Typically this will be the name of your organisation.
  2. Invite your team. Baselime works best when collaborating with team mates.

# Step 3: 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 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 usage 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 Web UI or with the CLI:

baselime aws create-template \
  --account <AWS_ACCOUNT_ID> \
  --region <AWS_REGION> \
  --alias <INTEGRATION_ALIAS>

Once you've generated and downloaded the template, you must deploy it to your AWS Account.

aws cloudformation create-stack \
  --stack-name baselime-integration \
  --template-body file://<FULL_PATH_TO_FILE> \
  --capabilities CAPABILITY_NAMED_IAM

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 log messages 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 UI within seconds.


# Step 4: Query your data

The power of Baselime is in it's query engine.

You can create queries in the Baselime UI or using the CLI.

# Query in the Web UI

In the UI:

  1. Navigate to Queries in the left navigation bar. Click on New Query.
  2. Select a time frame. By default it's the past hour.
  3. Select the namespaces you want to query. These are the Lambda functions in your account and region. By default, queries run across all namespaces.
  4. Select the fields you want to retrieve, or the function you want to run. COUNT is a good start.
  5. Add filters and group-bys to your query.
  6. Click Run Query

Now you should you see all the data gathered from your Lambda functions matching the criteria of your query.

You can save the query and share it with your team.

# Query with the CLI

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

baselime init

This will create a .baselime.yml file.

.baselime.yml
version: 0.0.0.1

application: sample-application
description: Sample Description

Add a query to your .baselime.yml file.

.baselime.yml
version: 0.0.0.1

application: sample-application
description: Sample Description

queries:
  - ref: test-query
    name: A Test Query
    namespaces:
      - type: lambda
        value: <lambda_function_name>
    calculations:
      - operator: COUNT
    filters:
      - key: "error.code"
        type: string
        operation: "="
        value: "ValidationException"
    groupBy:
      - type: string
        key: "status"

Apply the changes to the .baselime.yml file to Baselime

baselime apply

# Outputs
# Created queries:
#   - test-query: <created_query_id>

To visualise the results of the query run in the Web UI:

baselime query-run <created_query_id> \
  --from <start_time_unix_in_ms> \
  --to <end_time_unix_in_ms> \
  --ui

This command will open the Baselime Web UI with the results for the given query run.

To save the query results in a file instead:

baselime query-run <created_query_id> \
  --from <start_time_unix_in_ms> \
  --to <end_time_unix_in_ms> \
  >> data.json

# Next Steps

After the previous steps, Baselime collects logs and metrics from your Lambda functions. This is a good start, but it can be improved with traces.

Baselime support OpenTelemetry to instrument your Lambda functions.