Learn about adding source tags from the UI, API, or CLI.

You can use source tags to group sources, for example, to examine only production hosts but not development hosts.

Watch the following video for an introduction to point tags and source tags:

tagging

Source Tag Overview

This page explains how to add source tags explicitly from the UI, CLI, or API.

Here’s some background info:

  • Any Wavefront metric includes a source name. If source names change frequently or if you want to filter sources, a source tag can help.
  • Point tags are key-value pairs, in contrast, source tags are just strings – you can only choose the value.
  • Your use case determines how to use source tags:
    • Use a source tag hierarchy, that is, have source tags dot-delimited, for example env.cluster.role.role1. In that case, your query might include ... and tag=env.cluster.role.*
    • Use source tags as intersection sets, that is, use multiple tags (e.g. env, cluster, role, etc). In that case, your query might include... and tag=env and tag=cluster.

Adding Source Tags from the API

You can add source tags using the Wavefront REST API. The API supports getting and setting source tag values.

For details about the APIs, click the gear icon in your Wavefront instance and select API Documentation.

Adding Source Tags from the UI

To add a source tag from the UI:

  1. Click Browse>Sources.
  2. Select one or more sources and click +Tag or click the + icon below the source. You can add an existing source tag or create a new source tag.

Adding Source Tags and Source Descriptions

You can use the SourceTag and SourceDescription properties to add source tags and source descriptions before the metrics reach Wavefront. Starting with proxy version 4.24, you send these properties to the same listening port as regular metrics (pushListenerPort setting, 2878 by default).

To send a source tag or source description to a proxy, you can include commands like a following:

@SourceTag action=save source=app-1 highPriority
Property Purpose Example
SourceTag Save or delete a source tag. For example, you use this property to inject a source tag into a database on a host. Use SourceTag with action= and source= arguments. NOTE: Use quotes if any of the values includes spaces or special characters.
  • action is either save or delete.
  • source takes the source name as the first value, followed by a source tag to save or delete.
Ex: @SourceTag action=save source=host_42 db1
Ex: @SourceTag action=delete source=host_42 sourceTag1
SourceDescription Save or delete a description on the specified source. You can use this property to add a description or delete an existing description. Use `SourceDescription` with action=, source=, and description= arguments. NOTE: Use quotes if any of the values includes spaces or special characters.
  • action is either save or delete.
  • source takes the source as the first value, followed by a descriptor.
  • description allows you to specify a description for the tag.
Ex:@SourceDescription action=save source="sourceId" description=A Description
Ex:@SourceDescription action=delete source="sourceId"