Git Product home page Git Product logo

turbot / steampipe-plugin-pagerduty Goto Github PK

View Code? Open in Web Editor NEW
4.0 12.0 3.0 346 KB

Use SQL to instantly query resources from PagerDuty. Open source CLI. No DB required.

Home Page: https://hub.steampipe.io/plugins/turbot/pagerduty

License: Apache License 2.0

Makefile 0.15% PLSQL 0.22% Go 99.63%
postgresql steampipe steampipe-plugin sql postgresql-fdw pagerduty-api hacktoberfest backup etl sqlite zero-etl

steampipe-plugin-pagerduty's Issues

Fix `title` column reference in `pagerduty_incident` and `pagerduty_incident_log` table

Describe the bug
In table pagerduty_incident and pagerduty_incident_log, the reference used for title column seems incorrect. Hence, the value comes as null.

Steampipe version (steampipe -v)
Example: v0.16.0

Plugin version (steampipe plugin list)
Example: v0.1.0

To reproduce
Run any query against the above-mentioned tables, and check the title column value.

Expected behavior
title should contain the value, i.e. ID or Summary.

Additional context
Add any other context about the problem here.

Allow filtering for service_ids or team_ids in table pagerduty_incident

Is your feature request related to a problem? Please describe.
When querying longer time ranges (e.g. last 14 days) in a PagerDuty account with a lot of services and high amount of total incidents, the query takes a lot of time (last 30 days = 25 minutes).

Describe the solution you'd like
The PagerDuty API allows additional filter parameters like service ids or team ids which could limit the requested amount of data and therefore the query runtime significantly. I would like to implement the additional filter parameters so they are used when the user adds a where clause for team id and / or service id to the query

Additional context
I would be happy to also implement the options to filter by service id or team id, but not sure how this could be achieved with the current table structure, since service and team infos are json objects in the results without a dedicated team_id or service_id column.

Add table pagerduty_service_integration

References
Add any related links that will help us understand the resource, including vendor documentation, related GitHub issues, and Go SDK documentation.

Recompile plugin with steampipe-plugin-sdk v4.1.4 and Go version 1.19

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Simple query to pagerduty_incident table fails

Describe the bug

Query:

SELECT id, summary FROM pagerduty_incident WHERE created_at >= '2022-09-28' ORDER BY created_at DESC
Error: HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002) (SQLSTATE HV000)

Plugin Logs:

2022-09-29 16:35:52.100 UTC [ERROR] steampipe-plugin-pagerduty.plugin: [ERROR] 1664469241413: pagerduty_incident.listPagerDutyIncidents: query_error="HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)"
2022-09-29 16:35:52.100 UTC [WARN]  steampipe-plugin-pagerduty.plugin: [WARN]  1664469241413: doList callHydrateWithRetries (pagerduty-1664469241413) returned err HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)
2022-09-29 16:35:52.100 UTC [WARN]  steampipe-plugin-pagerduty.plugin: [WARN]  1664469241413: QueryData StreamError HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002) (pagerduty-1664469241413)
2022-09-29 16:35:52.100 UTC [WARN]  steampipe-plugin-pagerduty.plugin: [WARN]  1664469241413: streamRows for pagerduty-1664469241413 - execution has failed (HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)) - calling queryCache.AbortSet
2022-09-29 16:35:52.100 UTC [WARN]  steampipe-plugin-pagerduty.plugin: [WARN]  1664469241413: executeForConnection pagerduty returned error HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)
2022-09-29 16:35:52.100 UTC [WARN]  steampipe-plugin-pagerduty.plugin: [WARN]  1664469241413: error channel received HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)

Database Logs:

2022-09-29 16:35:52.100 UTC [WARN]  hub: stream receive error rpc error: code = Unknown desc = HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002) (0xc0004f81a0)
2022-09-29 16:35:52.101 UTC [5657] ERROR:  rpc error: code = Unknown desc = HTTP response failed with status code 400, message: Arguments Caused Error (code: 2002)
2022-09-29 16:35:52.101 UTC [5657] STATEMENT:  select id, summary FROM pagerduty_incident WHERE created_at >= '2022-09-28' ORDER BY created_at DESC

Steampipe version (steampipe -v)

steampipe version 0.16.0

Plugin version (steampipe plugin list)

+--------------------------------------------------+---------+-------------+
| Name                                             | Version | Connections |
+--------------------------------------------------+---------+-------------+
| hub.steampipe.io/plugins/turbot/aws@latest       | 0.78.0  | aws         |
| hub.steampipe.io/plugins/turbot/jira@latest      | 0.6.0   | jira        |
| hub.steampipe.io/plugins/turbot/okta@latest      | 0.8.0   | okta        |
| hub.steampipe.io/plugins/turbot/pagerduty@latest | 0.2.1   | pagerduty   |
| hub.steampipe.io/plugins/turbot/steampipe@latest | 0.6.0   | steampipe   |
| local/battlestar                                 | local   | battlestar  |
+--------------------------------------------------+---------+-------------+

To reproduce
Steps to reproduce the behavior (please include relevant code and/or commands).

Expected behavior
List of incidents is returned.

Additional context
It takes a minute or so for query to fails.

Add table pagerduty_vendor

References
Add any related links that will help us understand the resource, including vendor documentation, related GitHub issues, and Go SDK documentation.

Add table pagerduty_incident_log

References
Add any related links that will help us understand the resource, including vendor documentation, related GitHub issues, and Go SDK documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.