Skip to main content

See what happened on a component

The Events tab of a component is its journal: every push, tag, release, pipeline, Argo CD sync and quality gate its tools reported, day by day, most recent first. When a push was caused by the release of another component, the line says so and leads you to it.

What it shows, and for whom​

  • The events of this component only, from the tools it is linked to by its catalog-info.yaml.
  • Anyone who can see the component in the catalog sees its tab. A link to another component appears only when you can see that component too.
  • A tool with a webhook shows from its first webhook received. A tool read every 5 minutes also brings its last 7 days (see Without a webhook).

Before you start​

  • You are an administrator to turn the tab on and to set up the webhooks.

  • The component carries the annotation of at least one tool in its catalog-info.yaml:

    apiVersion: backstage.io/v1alpha1
    kind: Component
    metadata:
    name: shop-app
    annotations:
    gitlab.com/project-slug: acme/shop-app # GitLab
    github.com/project-slug: acme/shop-app # GitHub
    argocd/app-name: shop-app # Argo CD
    sonarqube.org/project-key: acme-shop-app # SonarQube
    spec:
    type: service
    lifecycle: production
    owner: group:default/platform

    Keep only the lines of the tools you use.

1. πŸ”Œ Turn on Events​

  1. In the sidebar, at the bottom, click Administration.

  2. Under Platform, click Plugins.

  3. On the Events card (What happened on a component, day by day: pushes, pipelines, syncs.), click the Enable Events switch. The message Events is on appears.

Your component's page now has an Events tab, next to its other tabs.

2. πŸ”— Let GitLab send its events​

  1. In Administration, under Platform, click Company connections, then the Webhooks tab.

  2. On the GitLab card, click Configure.

  3. In the window Configure GitLab Secret, next to Webhook URL, click Copy address. The address ends in /api/orion-events/gitlab, for example https://astrolabe.example.com/api/orion-events/gitlab.

  4. In Webhook Secret, type a long random text, for example a-long-random-text, then click Save Secret.

  5. In your GitLab project, open Settings β€Ί Webhooks and add a webhook:

    • URL: the address you copied;
    • Secret token: the same secret;
    • Trigger: tick Push events, Tag push events, Releases events, Pipeline events and Job events.

    This step in GitLab was not checked on a live instance.

The GitLab card of the Webhooks tab now offers Manage. For more on this card, see Set the GitLab webhook secret.

3. πŸ”— Let GitHub send its events​

  1. In Administration β€Ί Company connections, click the Webhooks tab.

  2. On the GitHub card, click Configure.

  3. In the window Configure GitHub Secret, next to Webhook URL, click Copy address. The address ends in /api/orion-events/github.

  4. In Webhook Secret, type a long random text, then click Save Secret.

  5. In your GitHub repository, open Settings β€Ί Webhooks β€Ί Add webhook:

    • Payload URL: the address you copied, Content type application/json;
    • Secret: the same secret;
    • Let me select individual events: tick Pushes, Branch or tag creation, Releases, Workflow runs and Workflow jobs.

    This step in GitHub was not checked on a live instance.

4. πŸ”— Argo CD and SonarQube​

Argo CD syncs and SonarQube quality gates come from their connection in Administration β€Ί Company connections: Add the Argo CD integration, Add the SonarQube integration. Astrolabe reads them every 5 minutes (see below). This read and their webhook were not checked on a live instance.

⏳ Without a webhook​

A tool with a connection in Administration β€Ί Company connections and no webhook is read every 5 minutes. The first read brings back the last 7 days. The tab then says, for example, GitLab has no webhook: its API is read every 5 min.

For GitLab and GitHub, the component must be registered from its own repository: in Catalog β€Ί Register an existing component, give the address of the catalog-info.yaml in the repository named by its annotation, for example https://gitlab.example.com/acme/shop-app/-/blob/main/catalog-info.yaml for gitlab.com/project-slug: acme/shop-app.

5. πŸ“– Read the tab​

  1. In the sidebar, click Catalog, then the name of your component, for example shop-app.

  2. Click the Events tab.

  3. Each day has its title, for example Today β€” Friday, October 30. Each line gives the tool, what happened and the time:

    LineWhat it says
    PushRenovate Bot pushed the commit 9f8e7d6 on main β€” β€œchore: bump shop-lib to 1.4.2”, with the pipeline of that commit, for example #7101 Β· failed
    TagLib Maintainer created the tag v1.4.2 on the commit a1b2c3d
    PipelineThe workflow #7101 failed for the commit 9f8e7d6, with its duration, for example 1 min 15 s
  4. To narrow the list, click a source above it (All sources, GitLab…), or choose a branch in Branch. At the bottom, Show older events loads the previous days.

πŸ” See which release triggered a push​

Under a push, a line starting with ↳ says what caused it:

LineWhen it appears
↳ triggered by the release 1.4.2 of shop-lib (05:23:45)The commit message names a package and its version, for example chore: bump shop-lib to 1.4.2 (Renovate, Dependabot, Β« bump … to … Β»).
↳ pushed by shop-libThe commit was pushed by the bot of another component's GitLab project. Not checked on a live instance.
↳ triggered by pipeline #4512 of shop-libThe pipeline was started by a pipeline of another component. Not checked on a live instance.

On the component of the release, the tag says the other way round: ↳ pushed the commit 9f8e7d6 to shop-app.

The name of the other component is a link to its Events tab when Astrolabe knows that component: the child declares it in spec.dependsOn, under the name of the package, and Tech stack is on in Administration β€Ί Plugins. These conditions were not checked on a live instance.

spec:
dependsOn:
- component:default/shop-lib

Your commit message does not name the package? Add this line at the end of the message, after an empty line:

Triggered-By: shop-lib@1.4.2

The push then shows ↳ triggered by the release 1.4.2 of shop-lib.

βœ… That's it!

Next: Common problems with Events.