Skip to main content
Every organization starts with two environments, Prod and Dev. Each is a source in the sidebar that holds its own logs, metrics, and traces. Data goes to one or the other based on one resource attribute on the sender, the env label. This page covers what to set, which values count, and how Sherlock resolves the label when a sender carries more than one.

The two environments

Click the ⓘ next to a source in the sidebar to see its values under Env match and whether it is the default under Default for org. You can read these values but not change them.

Send data to an environment

Set the env resource attribute on every exporter, once per deployment of a service:
The setup pages show where this goes for each sender: the Node.js quickstart, the Go setup, and the collector and SDK examples on OpenTelemetry SDKs and collectors. A collector can set it for every service it forwards; the resource processor on that page shows how. Matching is exact and case-sensitive. prod and production reach Prod. Prod, PROD, production with a trailing space, and staging match nothing.

How Sherlock picks the label

A sender can carry several environment attributes, because some libraries set one of their own. Sherlock copies the first of these that is present into sherlock.env and routes on that: Why env ranks above the OpenTelemetry names: some libraries add deployment.environment on their own, often with the value production. When env is set, Sherlock ignores that value and the data goes where env says. When env is not set, the library’s value decides, and production sends the data to Prod. If a library in your stack sets env itself, set sherlock.env on the exporter; it ranks above everything.

What happens when nothing matches

A value that matches no environment, or a sender with no environment attribute at all, lands in Prod, the default. There is no warning. If a service is missing from Dev, look in Prod first.

Troubleshooting

One of three things: the value is not one of Dev’s accepted values, the case differs, or that sender has no env attribute. Check the ⓘ dialog on the Dev source for its values, then the sender’s OTEL_RESOURCE_ATTRIBUTES.
No sender sets an environment attribute, so all data falls to the default. Add env to each exporter.
Set env; it takes precedence over deployment.environment.name and deployment.environment. If the library sets env itself, set sherlock.env, which always wins.
Environments and their accepted values are not editable from the app or the API. Contact Sherlock to add one.

Get started

Choose the env value as part of first setup.

OpenTelemetry SDKs and collectors

Set the attribute on any SDK or in a collector.