Honeycomb Beelines | Honeycomb

We use cookies or similar technologies to personalize your online experience & tailor marketing to you. Many of our product features require cookies to function properly.

Read our privacy policy I accept cookies from this site

Honeycomb Beelines

Honeycomb’s Beeline SDKs are a way to instrument your code. However, it is recommended that you start out OpenTelemetry if you’re starting to instrument your application or service. Beelines automatically instrument a wide range of standard packages in various ecosystems to send useful events to Honeycomb.

Set up the Beeline in a few steps, and later you can add custom instrumentation to capture your unique needs.

Get Started with Beelines  🔗

After you sign up for Honeycomb and get your API key, you can follow the quickstart guide for your language.

The Go Beeline has rich auto-instrumentation for HTTP applications.

To install the Go Beeline for your application:

  1. Fetch the beeline-go package:

    go mod init
    go get github.com/honeycombio/beeline-go
    
  2. In your code, import the beeline-go package and initialize it with your API key and dataset name:

    import beeline "github.com/honeycombio/beeline-go"
    
    func main() {
      beeline.Init(beeline.Config{
        // Get this via https://ui.honeycomb.io/account after signing up for Honeycomb
        WriteKey: "YOUR_API_KEY",
        // The name of your app is a good choice to start with
        Dataset: "MyGoApp",
      })
      defer beeline.Close()
      ...
    }
    
  3. Add a Beeline wrapper in your http.ListenAndServe call. This adds basic instrumentation for each request at the outermost layer of the call stack.

    import "github.com/honeycombio/beeline-go/wrappers/hnynethttp"
    ...
    http.ListenAndServe(":8080", hnynethttp.WrapHandler(muxer))
    

If you’ve got a NodeJS Express or Fastify app, you can get request-level instrumentation for those frameworks and other supported packages you use, automatically.

  1. Install the Node.js Beeline package using npm:

    npm install --save honeycomb-beeline
    
  2. Add the following code to the top of your app.js.

    Important: It must be before any require or import statements for other packages.

    require("honeycomb-beeline")({
      // Get this via https://ui.honeycomb.io/account after signing up for Honeycomb
      writeKey: "YOUR_API_KEY",
      // The name of your app is a good choice to start with
      dataset: "my-node-distributed-app",
      serviceName: "my-node-service"
    });
    

To install the Java Beeline for your Spring Boot application:

  1. The Java Beeline is available from Maven Central Repository. To get started, add this to your Maven build’s pom.xml:

    <dependency>
        <groupId>io.honeycomb.beeline</groupId>
        <artifactId>beeline-spring-boot-starter</artifactId>
        <version>1.4.0</version>
    </dependency>
    

    or in Gradle:

    implementation 'io.honeycomb.beeline:beeline-spring-boot-starter:1.1.0'
    
  2. In your Spring app, add the following configuration to your application.properties file in src/main/resources:

    // (Required) Give your application a name to identify the origin of your events
    honeycomb.beeline.service-name=<service_name>
    // (Required) Dataset to send your data to
    // The name of your app or your environment [development, production] are good choices to start with
    honeycomb.beeline.dataset=<dataset_name>
    // (Required) Your Honeycomb account API key
    // Get this via https://ui.honeycomb.io/account after signing up for Honeycomb
    honeycomb.beeline.write-key=<Honeycomb API key>
    

To install the Python Beeline for your application:

  1. Make sure your version of setuptools is up to date:

    pip install -U setuptools
    
  2. Install the Beeline package:

    pip install honeycomb-beeline
    
  3. Initialize the Beeline by including the following at the entry point to your application:

    import beeline
    beeline.init(
        # Get this via https://ui.honeycomb.io/account after signing up for Honeycomb
        writekey='YOUR_API_KEY',
        # The name of your app is a good choice to start with
        dataset='my-python-app',
        service_name='my-python-app',
        # debug=True, # defaults to False. if True, data doesn't get sent to Honeycomb
    )
    

With debug set to True you’ll see events being generated in your terminal output, but they won’t be sent to Honeycomb. Set debug=False to start sending events to Honeycomb.

To install the Ruby Beeline for your application:

  1. Add honeycomb-beeline to your Gemfile:

    gem 'honeycomb-beeline'
    
  2. If you have a Rails application, you can run the generator to create your configuration file:

    bundle exec rails generate honeycomb YOUR_API_KEY --dataset your-dataset-name
    

    Otherwise in your code, initialize the Beeline with your API key and dataset name:

    Honeycomb.configure do |config|
      # Get this via https://ui.honeycomb.io/account after signing up for Honeycomb
      config.write_key = 'YOUR_API_KEY'
      # The name of your app is a good choice to start with
      config.dataset = 'my-ruby-app'
    end
    

From here you can build and run your application. Hit an HTTP endpoint and you’ll see data arrive in Honeycomb in seconds!

Go to the Honeycomb UI

Now you’re ready to deploy to production and start observing real user behavior! Later, you can visit the documentation page for your language’s Beeline to start adding custom instrumentation.

Reference documentation  🔗

Learn more about configuration, what events you can expect to be emitted, interesting queries to explore, and the set of supported packages per Beeline.

Open Source  🔗

All Honeycomb integrations are open source and Beelines are no exception. The source code for each Beeline can be found on GitHub.