Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support all event fields in the Pagerduty action. #63933

Closed
tobio opened this issue Apr 20, 2020 · 15 comments
Closed

Support all event fields in the Pagerduty action. #63933

tobio opened this issue Apr 20, 2020 · 15 comments
Labels
enhancement New value added to drive a business result estimate:small Small Estimated Level of Effort Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@tobio
Copy link
Member

tobio commented Apr 20, 2020

Currently the Pagerduty action doesn't support setting the custom_details, images or links event fields. These fields should be configurable and templated.

cc: @pmuellr

@tobio tobio added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Apr 20, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@alexfrancoeur
Copy link

@mikecote @arisonl I've been on a call recently where custom_details would provide a lot of additional value to the PagerDuty integration. I realize the that there is a PR linked to this issue that was stalled last year. While fully understanding the large amount of competing priorities on the alerting team, what would the work effort be to enhance this action to include the custom_details field? Is it relatively small? As I understand it, summary can only provide so much information and is limited to 1024 characters.

With a PR already in place, it looked like there were some unanswered questions and a need for tests. Looking at some of the comments, there are questions around static and dynamic content. I do think we'd probably want to include context variables in this field in particular.

@pmuellr
Copy link
Member

pmuellr commented Feb 19, 2021

I don't think there's a huge problem with the custom_details field, beyond the UI for it. I think it would be like the headers field in the webhook connector.

links doesn't look bad, as the data it is, but it's not clear how it would be used, since it has both the URL and link text. Maybe that's a PagerDuty thing? I would have expected just urls, not link text.

images is the one which is probably the most challenging, because I think what we'd want to do is to somehow have Kibana generate images, and then populate those fields with urls to those images Kibana generated, that got uploaded ... somewhere. We've looked into how this would work with Slack - we can upload the images separately, and then get links back to them from the submission responses. If PagerDuty has something similar - a way to upload images for later reference in PagerDuty events, then it would follow the same flow (whatever that may be, since we haven't done it yet).

I did add a comment to the PR that the schema definition for the params needs some slight tweaking.

I do think we'd probably want to include context variables in this field in particular.

The parameters are always available as a mustache template variable, alertParams. The question will be, how easy will it be to get the data out. Eg, if custom_details is {a: b, c: d}, you'd access the values via alertParams.custom_details.a - and of course every alert could have different properties, so every mustache template for every alert may end up referencing different properties. I suspect there are some "common" values here, like description or such, so maybe that's not a big deal.

@alexfrancoeur
Copy link

++ I think custom_details and links as optional fields would only make our integration more useful. I completely agree that images is a much larger and complex issue. If the team agrees, maybe we augment the PD action with custom_details and links and open a separate issue for images?

I also agree that there are probably some challenges to getting the data out, but is that any different than other context variables? I feel like most of them are rather alert type specific with some common values. Not that that's ideal, and as we unify rules, maybe that gets better.

@pmuellr
Copy link
Member

pmuellr commented Feb 23, 2021

I also agree that there are probably some challenges to getting the data out, but is that any different than other context variables? I feel like most of them are rather alert type specific with some common values. Not that that's ideal, and as we unify rules, maybe that gets better.

Ya, sorry, I misunderstood the original question, shouldn't be a problem adding context variables to the custom details properties - or we need to make that possible anyway, since this function would likely be worthless without it.

I completely agree that images is a much larger and complex issue. If the team agrees, maybe we augment the PD action with custom_details and links and open a separate issue for images?

Ya, makes sense to split custom_details and links from images.

@gmmorris gmmorris added the loe:medium Medium Level of Effort label Jul 14, 2021
@gmmorris gmmorris added enhancement New value added to drive a business result Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework estimate:small Small Estimated Level of Effort and removed Feature:Alerting labels Aug 13, 2021
@gmmorris gmmorris removed the loe:medium Medium Level of Effort label Sep 2, 2021
@arisonl
Copy link
Contributor

arisonl commented Oct 21, 2021

Please note that the inclusion of custom_details has come up again in conversations with users, as an incremental improvement that will add a great lot of value in very important use cases cc @gmmorris @mikecote @pmuellr @paulewing @cnasikas @tobio

@kobelb kobelb added the needs-team Issues missing a team label label Jan 31, 2022
@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 31, 2022
@sparrowt
Copy link

sparrowt commented Oct 11, 2022

EDIT: I realised since posting this that, being on the Kibana repo, perhaps this issue is actually referring to the Kibana Alerts connector 'PagerDuty' functionality (https://www.elastic.co/guide/en/kibana/current/pagerduty-action-type.html) rather than the Elastic watcher pagerduty action (https://www.elastic.co/guide/en/elasticsearch/reference/8.4/actions-pagerduty.html)?

If so apologies for barking up the wrong tree!


Original comment:

It's worth noting that you can currently send images and links however to do so you have to use the contexts attribute on your watcher action (https://www.elastic.co/guide/en/elasticsearch/reference/8.4/actions-pagerduty.html#pagerduty-action-attributes).

The confusion lies in the fact that:

So to set images and links, simply supply something like this:

"contexts": [
  {
    "type": "link",
    "href": "..."
  },
  {
    "type": "image",
    "src": "..."
  }
]

Then of the three v2 API fields mentioned in this ticket originally, only custom_details remains - however if you set the pagerduty watcher action attribute attach_payload to True, then custom_details gets filled in with the payload from your watcher, which you can control to some extent as you define your watcher.

In other words, all 3 of these fields can be set, just not using the same strings for the watcher attributes, as are used in the underlying PagerDuty API.

sparrowt added a commit to sparrowt/elasticsearch that referenced this issue Oct 11, 2022
Specify which PagerDuty integration to select (given there isn't one called simply "API" any more).

Also add a note to help avoid the confusion stemming from the fact that the watcher attributes
still have names which seem to match the PagerDuty Events API v1 despite the fact that Elastic
is actually now using v2 of that API.

For reference: a ticket which I replied to, with a classic example of such confusion:
elastic/kibana#63933 (comment)
@ymao1
Copy link
Contributor

ymao1 commented Jan 5, 2023

cc @shanisagiv1

@mikecote
Copy link
Contributor

mikecote commented Mar 2, 2023

cc @elastic/response-ops-cases in case this is still a request for cases

@lucasmoore
Copy link

Is there something we can do to help get this prioritized? We (Platform SRE), along with other teams working on Serverless, are making heavy use of Kibana Alerting Rules and PagerDuty actions. We would greatly benefit from being able to include things like links to runbooks and dashboards in a PagerDuty action field. It's a significant improvement to the on-call experience for engineers to have links to the relevant information present in the alert rather than having to look for it separately.

cc @rbrunan @elkargig

@cnasikas
Copy link
Member

Hey @lucasmoore! It is a high-priority issue for us and we will start working on it soon. As images are complicated we can reduce the scope and start with supporting custom_details and links. Is that ok with you?

@lucasmoore
Copy link

Hey @lucasmoore! It is a high-priority issue for us and we will start working on it soon. As images are complicated we can reduce the scope and start with supporting custom_details and links. Is that ok with you?

Yes, that sounds good to me. Thanks!

@cnasikas
Copy link
Member

Related: #76910

@cnasikas
Copy link
Member

cnasikas commented Nov 9, 2023

PR #170459 added support for links and custom_details in the connector's PagerDuty API. Issue for the UI: #170048.

@cnasikas
Copy link
Member

cnasikas commented Dec 11, 2023

PR #171748 added support for the UI. If needed I think is better to open a separate issue for images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result estimate:small Small Estimated Level of Effort Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

Successfully merging a pull request may close this issue.