Menu
Grafana Cloud

Configure segments

Segmentation allows you to override drop rates on patterns on a per team, service, department, or system basis. This team-centric approach allows you to manage Adaptive Logs considering each team’s specific data and requirements.

You can create and manage segments using the UI.

Note

This feature in public preview, and is enabled by default on Cloud instances. If it is not enabled on your instance, contact your administrator.

Segments

Think of a segment as a container for a specific grouping of log streams. You define this grouping based on a label and values, or selectors.

Each segment has a:

  • Name:

    Represents a human-readable name for this label values grouping.

  • Selector or label, and values:

    Tells Adaptive Logs which log streams belong to the segment.

    Note

    • Only one label matcher is allowed. For example, ({team=“billing”}).

    • All segments must reference the same label name. Creating a segment with a different label name results in an error.

    • Only equality matchers, for example, ({team=“billing”}), or multi-literal regular expression matchers, for example, ({team=~(alerting|alerting-dev)}), are allowed.

  • Fallback to default:

    A setting that decides if a pattern’s default drop rate should apply to the log streams in this segment if no segment drop rate is specified for them.

Segmentation workflow

  1. Using the UI, create segments, give them descriptive names, and add labels and values. Grafana uses these to identify which log streams belong to this segment, effectively grouping log streams into separate segment-specific containers.

  2. Specify drop rates per segment.

Within the Grafana UI, when you view a pattern you can specify a drop rate for a specific segment within the pattern. This allows each team to specify their own drop rate for a pattern without affecting other teams.

Create segments using the UI

Create, update, and manage segments through the Grafana user interface.

To create a new segment, complete the following steps.

  1. Navigate to Administration > Cost Management > Logs cost management > Adaptive Logs > Configuration.

  2. Click Add new segment.

  3. Enter a name.

    Give your segment a descriptive name that clearly identifies the team it applies to.

  4. Enter a label.

    Specify the log stream label that distinguishes the metrics belonging to a particular team. In the context of Kubernetes, this is often namespace.

  5. Enter a value.

    Define the criteria for matching the label you specified. This is where you tell Grafana which values of that label correspond to the current team’s log streams. In the UI, you can select values using a dropdown. Enter the exact name of the Kubernetes namespaces or label values for the team (for example, web-frontend, web-backend). If a team owns multiple namespaces, you can enter multiple values.

    Note

    Each value can only be used once. Therefore, once a value is added to a segment, it cannot be used in another.

  6. (Optional): Select Fallback to default pattern configuration checkbox.

    Select this checkbox to apply the pattern’s default drop rate to any log streams that do not belong to a specific team segment. When unchecked, unmatched log streams have a drop rate of 0%.

  7. Click Add.

Set a per-segment drop rate for multiple patterns

Use per-segment drop rate overrides to apply drop rates to patterns for specific segments.

To set a per-segment drop rate override for multiple patterns, complete the following steps.

  1. Select the segment you want to set drop rates for.

  2. Select all the patterns for that particular segment or pick and choose which patterns to select.

  3. Click Bulk edit service drop rates.

  4. Enter the percentage drop rate you want to set for the segment.

    The projected savings after you apply changes is displayed.

  5. Click Apply.

Set per-segment drop rates within a specific pattern

To create drop rates for multiple segments producing logs with the same pattern, complete the following steps.

  1. On the Pattern tab, expand a pattern.

  2. Review which services are producing logs with that pattern.

  3. Click the Edit icon to edit drop rates.

  4. Enter the percentage drop rate you want to add for each service.

    The projected savings after you apply changes is displayed.

  5. Click Apply.