-
Notifications
You must be signed in to change notification settings - Fork 75
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
[ROB-837] Pagerduty + JSM ticket support #334
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
Left some comments, nothing is considered a blocker IMO
""" | ||
Extracts and formats the issue description. | ||
""" | ||
description_blocks = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this logic the same for both Jira and JSM?
description = self.extract_description(jira_issue) | ||
return self.convert_to_issue(jira_issue, description) | ||
except requests.RequestException as e: | ||
raise ConnectionError(f"Failed to fetch Jira ticket {id}") from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be jsm ticket?
headers={"Accept": "application/json"}, | ||
) | ||
response.raise_for_status() | ||
jira_issue = response.json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jsm_issue?
import logging | ||
|
||
|
||
class ListAndBuildGrafanaDashboardURLs(Tool): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @aantn also implemented this
Are you two synced on this?
label_key = "pod" if resource_type == "pod" else "app" | ||
|
||
# Correct JSON structure to match the expected URL format | ||
expected_query_params = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not for the POC, but do you think we can make it completely generic?
i.e., let the llm build the loki query on it's own, to get link to logs on any resource.
This worked very well with OpenSearch, but I'm not familiar enough with Loki
return | ||
output_instructions = [] | ||
# Validate Jira details if source is Jira Service Management | ||
if source == SupportedTicketSources.JIRA_SERVICE_MANAGEMENT: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider moving the creation if/else to another place, to prevent a huge if/else here
So this code doesn't have any source-specific code. (Just a thought)
So, it would be something like:
source_handler = SourceFactory.create_source(type, params)
try:
issue_to_investigate = source_handler.fetch_issue(id=ticket_id)
if issue_to_investigate is None:
raise Exception(f"Issue {ticket_id} Not found")
except Exception as e:
...
Enhanced Investigation Links for PagerDuty & Jira Service Management
Holmes now supports adding investigation links directly into PagerDuty and Jira Service Management tickets. This includes tools for generating Loki log links and Grafana dashboard links automatically.
Jira Service Management Example
To initiate an investigation and automatically post a comment with relevant links in a Jira Service Management ticket, run:
This will:
Example Output in Jira Service Management
PagerDuty Example
To run an investigation for a PagerDuty incident and add the results as a note:
This will:
Example Output in PagerDuty