Set up GitLab Connector

Use GitLab Connector GitLab for Workflows to integrate your Dynatrace environment with GitLab repositories. This integration enables you to use GitLab Connector actions in your workflow to manage issues and merge requests automatically based on your monitoring data and events.

Steps

Step 1 Install GitLab Connector

To use GitLab workflow actions, you need to install GitLab from Dynatrace Hub.

  1. In Dynatrace Hub Hub, select GitLab.
  2. Select Install.

Step 2 Add a New host pattern in External requests

External requests enable outbound network connections from your Dynatrace environment to external services. They allow you to control access to public endpoints from the AppEngine with app functions and functions in Dashboards, Notebooks, and Automations.

  1. Go to Settings and select General > Environment management, External Requests.

  2. Select New host pattern.

  3. Add the domain names.

  4. Select Add.

This way you can granularly control the web services your functions can connect to.

You need to add the *.gitlab.com domain name.

Step 3 Grant permissions to Workflows

Aside from permissions required by Workflows to run actions on your behalf, there are additional permissions required to use GitLab Connector actions.

To fine-tune permissions granted to Workflows

  1. Go to Workflows and select Settings > Authorization settings.
  2. Select the following permission besides the general Workflows permission:
  • app-settings:objects:read

To learn more about Workflows user permissions, see User permissions for workflows.

Step 4 Authorize connection to GitLab

You need a configured connection for each of your GitLab environments.

To configure a connection

  1. Go to Settings and select Connections > Connectors > GitLab.

  2. Select Add Connection.

  3. Define your GitLab connection.

    • Connection name: Provide a meaningful name for your connection.
    • GitLab URL: Add the URL of your GitLab environment.
    • GitLab token: Provide your GitLab API token.
  4. Select Create.

The GitLab token needs the scopes api, read_repository, read_user, and write_repository. Scopes can be skipped if related actions are not used. Refer to the GitLab documentation for details on which scope is needed for which action.