PagerDuty / backstage-plugin

PagerDuty plugin for Backstage
https://pagerduty.github.io/backstage-plugin-docs/index.html
Apache License 2.0
22 stars 5 forks source link

Add support for multiple project ids/service ids per component #45

Open rocha-bruno opened 7 months ago

rocha-bruno commented 7 months ago

Is your feature request related to a problem? Please describe. Each component we manage in our company is represented by multiple services in Pagerduty, one by environment and cluster/group of machines. The current annotation only work for 1:1 relation between a component and a service_id

Describe the solution you'd like Be able to add multiple service ids in the pagerduty annotation and adapt the plugin to render an aggregated view of those service ids.

Describe alternatives you've considered Return the current widget for each service id could be a quick win, but this will lead to potentially a lot of widgets displayed and will be messy for end users. The solution found for a squad view expressed in another issue could be used there as well, based on the multiple values of the annotation instead of the owner relationship ?

t1agob commented 7 months ago

Hi @rocha-bruno! Congratulations on your first issue on our repo and thanks for helping out.

Just to double-check, your component in Backstage maps to a group of services in PagerDuty? For example web, api, database services that belong to the same application. Which ultimately belong to a team. Is that it?

We are considering building a team component as you already mention (https://github.com/PagerDuty/backstage-plugin/issues/34) but I was wondering if your use case is slightly different and you mapped all your services as components and not as APIs, resources, ... that ultimately belong to component and a system.

If you can share more details I would appreciate. We can take it offline as well if you prefer.

rocha-bruno commented 7 months ago

Hello @t1agob, thank you for your reply.

I will try to summarize our complex inventory in one example to make my request clearer, hopefully it helps understand our need.

We have a component ABC in backstage, that has for example the type = website. For more context, I work for a bank. This component is deployed in multiple places, some of these places are internal for continuous integration and business tests, others are exposed to the bank external end-users clients, others are exposed to external clients of partner to which we provide a banking platform.

On Pagerduty, these different locations are represented by different services. For the website above, we will have for example A_internalenv_ci, A_internalenv_tests, A_externalenv_ourbank, A_externalenv_partnerA.

It would be interesting for us to be able to present these X Pagerduty services in the view of the component ABC in Backstage. Using the current annotation with the possibilitiy to add multiple service ids make the more sense to me unless you have a better idea. Something like:

metadata:
  annotations:
    pagerduty.com/service-id: PABCHD1, PABCHD2, PABCHD3, PABCHD4

The length of annotations is limited, but still enough to contain a lot of services.

The backend logic to get the service ids is quite different from the team aggregation view (that we also need btw :) ), but the frontend could be the same I guess.

Tell me if you need more information or you have more questions.

t1agob commented 7 months ago

Got it! Thanks for the detailed explanation.

I'll be taking this into consideration. I've been working on a new design for the plugin and having different versions of the plugin that can support this and other more advanced scenarios. From a UI perspective it is not that different from a team card because it is an aggregated view that needs to clearly allow users to identify the relation between information and service, but the backend logic can be optimised for sure.

mdb commented 1 month ago

@t1agob My team would be interested in the ability to associate a single Backstage entity with multiple PagerDuty services, as well. In our case, we have separate ${NAME} and ${NAME}_low_urgency services; it'd be nice to show data from both.

While it's not perfectly analogous, anecdotally, the splunk on-call plugin displays distinct info cards for each of the teams associated with a splunk.com/on-call-routing-key.

For whatever it's worth, similar to @rocha-bruno 's suggestion, I was imagining the PagerDuty plugin displaying distinct info cards (or perhaps a single, tabbed info card?) for each of the services associated with a annotations.pagerduty.com/service-ids comma-separated list.