Retain queries with Streams

Streams are span queries that retain their data beyond the default three-day Microsatellites retention window. They allow you to proactively monitor parts of your system that are crucial to business health. Cloud Observability continuously receives data from your Microsatellites that match the query and stores statistics and example traces to ensure you always have data for latency, error rate, and operation rate for as long as your Data Retention policy allows.

Queries for alerts are automatically saved as Streams.

The Streams list shows all Streams that currently exist for the project and where those Streams are used. Seeing where they are used allows you to confidently delete ones that aren’t in use. Stream list

Create a Stream

You create a Stream based on queries to your span data. Cloud Observability continuously monitors for span data that matches that query and saves it as a Stream. You can create a Stream:

Use our public API to list, retrieve, update, and create Streams. You can also retrieve a specific time series for a Stream.

Create a Stream from the Query Builder

If a query doesn’t match an existing Stream, you can choose to save it as a Stream by clicking Edit. Edit to retain a query

Span queries that use a group-by can’t be retained.

If you choose to retain a query and later want it to use only what is in the retention window, you can delete the associated Stream.

When a chart uses multiple queries, each query is retained as a separate Stream.

Create a Stream from the Service directory

You can create a Stream for a service/operation pair from the Operations tab of the Service Directory.

  1. From the Service Directory, click the Operations tab and choose a service on the left.

  2. To create a Stream for an operation on a service, click Create Stream for that operation (if the button says View Stream then a stream has already been created for this operation).

    By default, the Stream’s name is the query. You can rename it

  3. Click View Stream to add a Stream to a dashboard or notebook. View Stream

    When you add a Stream to a notebook or dashboard, three charts are created (latency, error rate, and operation rate) using the query for the operation on the service. You can edit the queries as needed and view exemplar traces. By default, the charts take the name of the query. You can change that to be more descriptive by clicking into the title and entering a name of your choice.

Create a Stream from Explorer

We will be introducing new workflows to replace Explorer, and as a result, it will soon no longer be supported. Instead, use notebooks for your investigation where you can run ad-hoc queries, view data over a longer time period, and run Cloud Observability’s correlation feature. In your notebooks and dashboards, you can use the traces list panel to view a list of spans from a query and dependency maps to view a service diagram.

  1. Open Explorer from the navigation bar and run any query.

    Learn how to run a query

    To run a query using the Query Builder:
    Click into the search bar to open the Query Builder. You can build queries for services, operations, and attributes. Use IN or NOT IN to build the query. When you click into the Service or Operation field, the builder displays valid values.
    When you add multiple values to the Operation field, spans that match either value (OR operation) are returned.
    Learn more about running queries
    Supported query keys
    Query multiple keys and values

    Expandable end

  2. Once the query is run, click Create Stream. Create Stream

    If the button is grayed out, then a Stream already exists for that query.

  3. To view the Stream, click View Stream.

  4. By default, the Stream takes the name of the query. You can change that to be more descriptive by clicking the More ( ⋮ ) icon and selecting Rename. Rename Stream

View all Streams

You can view all Streams created for your Organization from the Streams view. Click Streams from the navigation bar. The Streams list shows all Streams that currently exist for the project and where those Streams are used. Streams view

Streams are listed in alphabetical order. Use the search bar or sort on a column to find Streams quickly. You can sort the usage columns to see your most popular Streams or find ones that aren’t currently in use, and then delete them.

To view the Stream in a notebook or dashboard, click View stream. Add Stream to a dashboard or notebook

Rename a Stream

By default, Streams are given the query parameters as the name. You can change that to be more descriptive by clicking the More ( ⋮ ) icon and choosing Rename. Rename Stream

Delete a Stream

You can delete a Stream by clicking the More ( ⋮ ) icon for the Stream on the list view and choosing Delete.

Deleting a Stream also deletes all historical data persisted for that Stream and can’t be undone, so be sure you want to delete it!

You can bulk delete streams by selecting them and clicking Delete selected Streams.Bulk delete Streams

See also

Create and manage dashboards

Understand data retention in Cloud Observability

Service health

Updated Feb 10, 2023