Skip to content

Latest commit

 

History

History
46 lines (38 loc) · 1.24 KB

who-is-on-call-on-component-page.md

File metadata and controls

46 lines (38 loc) · 1.24 KB

Display Who Is On-Call on a component page

Adding the EntityOpsgenieOnCallListCard component to an entity's page will display a list of on call people related to that entity.

// packages/app/src/components/catalog/EntityPage.tsx

import {
  EntityOpsgenieOnCallListCard,
  isOpsgenieOnCallListAvailable
} from '@k-phoen/backstage-plugin-opsgenie';

// ...

const overviewContent = (
  <Grid container spacing={3} alignItems="stretch">
    <Grid item md={6}>
      <EntityAboutCard variant="gridItem" />
    </Grid>
    <Grid item md={6}>
      {/* OpsGenie alert card start */}
      <EntitySwitch>
        <EntitySwitch.Case if={isOpsgenieOnCallListAvailable}>
          <EntityOpsgenieOnCallListCard title="OpsGenie Who Is On-Call"/>
        </EntitySwitch.Case>
      </EntitySwitch>
      {/* OpsGenie alert card end */}
    </Grid>
    <Grid item md={4} xs={12}>
      <EntityLinksCard />
    </Grid>
    <Grid item md={8} xs={12}>
      <EntityHasSubcomponentsCard variant="gridItem" />
    </Grid>
  </Grid>
);

Opsgenie team is correlated to Backstage entities using an annotation added in the entity's catalog-info.yaml file:

annotations:
  opsgenie.com/team: 'Awesome Team'

This annotation accepts any valid OpsGenie team name.