Env Remapping Rules

Join the Preview!

Env remapping is in Preview. To request access, fill out this form.

Request Access

Overview

Env remapping rules let you rename, merge, or split environments from Datadog. The rules update the env values of APM spans without changing tracer configuration or redeploying code.

Prerequisites

Creating, editing, or deleting env remapping rules requires the APM Service Remapping Write permission (apm_service_renaming_write). See Datadog role permissions.

Create an env remapping rule

  1. In Datadog, navigate to APM > Catalog > Manage > Service Tags Remapping.

  2. Click Add Env Rule.

  3. Use the search bar to select one or more environments to remap.

  4. Enter a unique environment name in the text box. A preview of the environment names appears as you type.

    To name environments based on their tags, use the {{tagName}} syntax. If tag values follow a pattern, apply a regular expression to extract the portion you want in the name.

    Note: When a tag has several values, the preview shows only those with the most spans.

  5. Optionally, enter a descriptive name for the remapping rule so you can identify it later.

  6. Review and save your remapping rule.

After you save the rule, it may take about a minute to take effect.

Env remapping rules behavior

Env remapping rules override the env tag at intake. Creating a rule does not change any preexisting configuration that specifies an environment name. Env remapping rules take precedence over all other environment name configurations.

  • Impacted data: Env remapping applies to APM spans only.
  • Historical data: Env remapping rules apply only to spans ingested while a rule is active. Past data is not updated retroactively. Deleting or modifying a rule stops it from applying to new spans, but does not update previously ingested data.
  • Rule processing order: Env remapping rules apply in the order in which they were created. Rules at the top of the env remapping list take precedence over rules below them. You can change the order of the rules.
  • Regular expressions: Use regular expressions to define new environment names. Greedy quantifiers are not allowed inside the capture group.
  • Interaction with service remapping rules: Env remapping rules apply after service remapping rules. If a service remapping rule modifies the service tag, env remapping uses the updated service name when applying an env remapping rule.

Further reading

Additional helpful documentation, links, and articles: