Compute@Edge log streaming: Honeycomb

Fastly's Real-Time Log Streaming feature for Compute@Edge services can send logs in JSON format to Honeycomb. Honeycomb is a tool that allows developers to explore the operations of complex systems, microservices, and databases.

Prerequisites

Before adding Honeycomb as a logging endpoint for Fastly Compute@Edge services, you'll need to perform the following steps:

  • Sign up for a Honeycomb account if you don't already have one.
  • Obtain the Write Key for your team on the Honeycomb Account page.
  • Choose a Dataset name. If you plan to collect data from multiple environments (like production, development, staging), Honeycomb recommends creating a Dataset for each environment and naming your Datasets accordingly (e.g., prod.queries, dev.queries, and staging.queries). If a Dataset doesn't exist, Honeycomb will create one automatically.

Adding Honeycomb as a logging endpoint

  1. Review the information in our Setting Up Remote Log Streaming guide.

  2. Click the Honeycomb Create endpoint button. The Create a Honeycomb endpoint page appears.
  3. Fill out the Create a Honeycomb endpoint fields as follows:
    • In the Name field, enter the name you specified in your Compute@Edge code. For example, in our Rust code example, the name is my_endpoint_name.
    • In the Write Key field, enter the write key for your Honeycomb team. This is available on the Honeycomb Account page.
    • In the Dataset field, enter the name of the Honeycomb Dataset (e.g., myDataset).
  4. Click the Create button to create the new logging endpoint.
  5. Click the Activate button to deploy your configuration changes.

Data sent to Honeycomb must be serialized in a way conforming to Honeycomb's expectations. If your logs are not formatted properly, attempts at processing your logs by your Honeycomb endpoint may fail. Here's an example format string for sending data to Honeycomb:

1
2
3
4
5
6
7
{
    "time": "2022-05-11T23:35:30.384Z",
    "data": {
        "message": "Something happened",
        "severity": "INFO"
    }
}

You can follow the general JSON structure above regardless of the chosen language for your Compute@Edge service and include the specific details inside the nested data structure. Consult the Honeycomb documentation for other available options for Honeycomb log messages. The emitted logs must be formatted as valid JSON.

Back to Top