Customize the Segment source

The analytics-provider-segment plugin sends the collected web analytics data to Red Hat by default. However, you can configure a new Segment source that receives web analytics data based on your needs. For configuration, you need a unique Segment write key that points to the Segment source.

Note

Create your own web analytics data collection notice for your application users.

Override the Segment write key using the Operator

You can configure integration with your Segment source by using the Red Hat Developer Hub Operator.

Before you begin

  • You have logged in as an administrator in the OpenShift Container Platform web console.
  • You have installed Red Hat Developer Hub on OpenShift Container Platform using the Operator.

Procedure

  1. Add the following YAML code in your Backstage custom resource (CR):
    # ...
    spec:
      application:
        extraEnvs:
          envs:
            - name: SEGMENT_WRITE_KEY
              value: <segment_key>
    # ...

    Replace <segment_key> with a unique identifier for your Segment source.

  2. Save the configuration changes.

Customize Segment source using the Helm chart

You can configure integration with your Segment source by using the Red Hat Developer Hub Helm chart.

Before you begin

  • You have logged in as an administrator in the OpenShift Container Platform web console.
  • You have installed Red Hat Developer Hub on OpenShift Container Platform using the Helm chart.

Procedure

  1. In the Developer perspective of the OpenShift Container Platform web console, go to the Helm view to see the list of Helm releases.
  2. Click the overflow menu on the Helm release that you want to use and select Upgrade.
  3. Use either the Form view or YAML view to edit the Helm configuration:
    • Using Form view
      1. Expand Root Schema Extra environment variables.
      2. Click the Add extra environment variables link.
      3. Enter the name and value of the Segment key.
      4. Click Upgrade.
    • Using YAML view
      1. Add the following YAML code in your Helm configuration file:
        # ...
        extraEnv:
          - name: SEGMENT_WRITE_KEY
            value: <segment_key>
        # ...

        Replace <segment_key> with a unique identifier for your Segment source.

      2. Click Upgrade.