In order to track deployments, you need to create an instrumentation attribute that Lightstep can use to understand when versions of your service changes. Any time the value of that attribute changes, Lightstep adds a deployment marker to the charts on the deployment page. Here’s an example showing a deployment marker.

You create your version attribute from the Project Settings page (these markers are project-specific).

  1. In the instrumentation for your service, add a attribute named service.version. This will be used to collect version information for the service. Adding attributes to instrumentation is language-specific, so check out the Quick Start topics for how to do that in your service’s language.

Using GitLab or GitHub?

If you’re using GitLab or GitHub for your project, you can use a Git SHA provided by the CI system as the service.version attribute so you can easily connect your traces with specific commits of code. Here’s an example from a Skaffold configuration file used to build services for a Docker container:

1
2
3
4
5
- image: productcatalogservice
  context: src/productcatalogservice
  docker:
    buildArgs:
      SERVICE_VERSION:  "{{.CI_COMMIT_SHORT_SHA}}"

For GitHub, here’s a similar Skaffold configuration file that builds a Docker container using the GITHUB_SHA environment variable:

1
2
3
4
5
- image: productcatalogservice
  context: src/productcatalogservice
  docker:
    buildArgs:
      SERVICE_VERSION: "{{.GITHUB_SHA}}"

Expandable end

  1. Click Settings to open your project’s settings page.Project Settings
  2. On the Project Settings page, scroll down to Deployment Settings.
  3. Click the + icon. A dropdown shows all attributes found in your instrumentation. Select the attribute from the list.

The attribute now displays as the Version Attribute. You can use multiple attributes to collect deployment information. As long as they are all registered, Lightstep creates markers when a change in value is detected.


What Did We Learn?

  • You can create a attribute to hold the value of a service’s version.
  • When the attribute’s value changes, Lightstep creates a deployment marker on the charts in the Service Health view.