Skip to main content

Getting Started with Beakpoint Insights

Beakpoint Insights helps you understand and optimize your cloud infrastructure costs through advanced telemetry analysis. By integrating OpenTelemetry with your applications and providing the right metadata, you can gain deep insights into your infrastructure costs across different cloud services.

This guide will walk you through the process of integrating your applications with Beakpoint Insights.

Prerequisites

Before you begin, make sure you have:

  • A Beakpoint Insights account
  • A Beakpoint Insights API key
  • An application you want to monitor

Integration Overview

Integrating with Beakpoint Insights involves three main steps:

  1. Setting up OpenTelemetry in your application
  2. Adding required cost calculation tags to your traces
  3. Adding cost attribution tags to your traces

Let's go through each step in detail.

Step 1: Setting Up OpenTelemetry

OpenTelemetry is a collection of tools, APIs, and SDKs used to instrument, generate, collect, and export telemetry data. Beakpoint Insights uses OpenTelemetry's tracing capabilities to collect and analyze your infrastructure costs. The exact setup process varies depending on your programming language. We provide detailed guides for two popular languages:

Regardless of your language choice, the basic steps remain similar:

  1. Install the OpenTelemetry packages for your language
  2. Configure a TracerProvider. We support both HTTP/JSON and HTTP/Protobuf protocols for exporting data to Beakpoint Insights.
  3. Set up the OTLP exporter with your Beakpoint Insights endpoint and API key
  4. Initialize OpenTelemetry in your application

Here's a generic example of what the configuration typically looks like:

var tracerProvider = Sdk.CreateTracerProviderBuilder()
// Add your application as a source of telemetry
.AddSource("YourApplicationName")

// Add instrumentation for your framework (example: ASP.NET Core)
.AddAspNetCoreInstrumentation(options => {
options.RecordException = true;
})

// Configure the OTLP exporter to send data to Beakpoint Insights
.AddOtlpExporter(options => {
options.Endpoint = new Uri("https://otel.beakpointinsights.com/api/traces");
options.Headers = "x-bkpt-key=your_api_key_here";
options.Protocol = OtlpExportProtocol.HttpProtobuf;
options.ExportProcessorType = ExportProcessorType.Simple;
})
.Build();

Step 2: Adding Cost Calculation Tags

Understanding infrastructure costs requires context about where and how your application is running. Beakpoint Insights uses specific span attributes (tags) to accurately calculate costs based on the part of your infrastructure the application is running on. The required attributes depend on which cloud services you're using. Below are links to detailed requirements for each supported service:

For example, if you're running in AWS Lambda, you'll need to add tags like this to your spans:

activity?.SetTag("aws.lambda.arn", context.InvokedFunctionArn)
.SetTag("aws.lambda.architecture",
Environment.GetEnvironmentVariable("AWS_EXECUTION_ENV")?.Contains("arm64") == true
? "arm64"
: "x86_64")
.SetTag("aws.lambda.memory_size", context.MemoryLimitInMB)
.SetTag("aws.region", Environment.GetEnvironmentVariable("AWS_REGION"));

Step 3: Adding Cost Attribution Tags

Beakpoint Insights' power is truly unleashed when you add cost attribution tags to your spans. These tags help you understand what is truly driving your infrastructure costs. You can learn how much of your cost is coming from each service, each user, organization, cloud provider, and more.

Beakpoint Insights supports the following cost attribution tags:

CategoryNameDescriptionExample
Resource / Deploymentdeployment.environment.nameName of the deployment tier.staging
Resource / FaaScloud.resource_idCloud-provider specific native identifer of the monitored cloud resource (e.g. an ARN on AWS)arn:aws:lambda:REGION:ACCOUNT:function:foo
Resource / Cloud Providercloud.providerName of the cloud provider (e.g. AWS, Azure, GCP)aws
Resource / Cloud Providercloud.regionName of the cloud provider region (e.g. us-east-1)us-east-1
Codecode.function.nameThe method or function fully-qualified name without arguments.com.example.MyHttpService.serveRequest
Resource / Serviceservice.nameLogical name of the service.Shoppingcart
Resource / Serviceservice.namespaceA namespace for service.nameShop
Resource / Serviceservice.versionThe version string of the service API or implementation.2.0.0
Userapp.user.idThe user id of the user who made the request3032
Userapp.user.org.idThe organization id of the user who made the request1234

For example, if you had a .NET application and you wanted to add cost attribution tags for the user and organization, you could do it like this:

activity?.SetTag("app.user.id", User.Id)
.SetTag("app.user.org.id", User.Organziation.Id);

Best Practices

To get the most out of Beakpoint Insights:

  1. Consistent Service Names: Use consistent service names across your infrastructure to make cost attribution more accurate.
  2. Granular Spans: Create spans for significant operations that might have different cost implications. This helps in understanding which parts of your application are driving costs.
  3. Complete Metadata: Always include all required attributes for your infrastructure type. Missing attributes can lead to incomplete cost analysis.
  4. Regular Validation: Periodically verify that your spans include all required attributes, especially after deploying new services or making infrastructure changes.

Getting Help

If you run into any issues or have questions, contact our support team at support@beakpointinsights.com