Giter Club home page Giter Club logo

Comments (10)

hayk96 avatar hayk96 commented on August 26, 2024 1

Actually no, the number that I want is editable on PagerDuty and you can apply any value there. Seems PD does not provide that value via API. 😐
I think we can close this issue as PD does not support that.

from incubator-devlake.

klesh avatar klesh commented on August 26, 2024 1

I see.
I am closing the issue for now, feel free to reopen it if things have changed.

from incubator-devlake.

klesh avatar klesh commented on August 26, 2024 1

It sounds good to me, we are open to PRs that implement the feature.

from incubator-devlake.

klesh avatar klesh commented on August 26, 2024

Hi, are you referring to a Grafana dashboard? If so, you are free to do so, just copy the dashboard and change the SQL you are good to go.
You can also submit a PR for the change if you'd like it.

from incubator-devlake.

hayk96 avatar hayk96 commented on August 26, 2024

Hi @klesh,
I have checked and seems this API https://api.pagerduty.com/incidents/{id} does not return that field 😞

example response

{
  "incident": {
    "id": "PT4KHLK",
    "type": "incident",
    "summary": "[#1234] The server is on fire.",
    "self": "https://api.pagerduty.com/incidents/PT4KHLK",
    "html_url": "https://subdomain.pagerduty.com/incidents/PT4KHLK",
    "incident_number": 1234,
    "title": "The server is on fire.",
    "created_at": "2015-10-06T21:30:42Z",
    "updated_at": "2015-10-06T21:40:23Z",
    "status": "acknowledged",
    "incident_key": "baf7cf21b1da41b4b0221008339ff357",
    "service": {
      "id": "PIJ90N7",
      "type": "service_reference",
      "summary": "My Mail Service",
      "self": "https://api.pagerduty.com/services/PIJ90N7",
      "html_url": "https://subdomain.pagerduty.com/service-directory/PIJ90N7"
    },
    "assignments": [
      {
        "at": "2015-11-10T00:31:52Z",
        "assignee": {
          "id": "PXPGF42",
          "type": "user_reference",
          "summary": "Earline Greenholt",
          "self": "https://api.pagerduty.com/users/PXPGF42",
          "html_url": "https://subdomain.pagerduty.com/users/PXPGF42"
        }
      }
    ],
    "assigned_via": "escalation_policy",
    "last_status_change_at": "2015-10-06T21:38:23Z",
    "resolved_at": null,
    "first_trigger_log_entry": {
      "id": "Q02JTSNZWHSEKV",
      "type": "trigger_log_entry_reference",
      "summary": "Triggered through the API",
      "self": "https://api.pagerduty.com/log_entries/Q02JTSNZWHSEKV?incident_id=PT4KHLK",
      "html_url": "https://subdomain.pagerduty.com/incidents/PT4KHLK/log_entries/Q02JTSNZWHSEKV"
    },
    "alert_counts": {
      "all": 2,
      "triggered": 1,
      "resolved": 1
    },
    "is_mergeable": true,
    "escalation_policy": {
      "id": "PT20YPA",
      "type": "escalation_policy_reference",
      "summary": "Another Escalation Policy",
      "self": "https://api.pagerduty.com/escalation_policies/PT20YPA",
      "html_url": "https://subdomain.pagerduty.com/escalation_policies/PT20YPA"
    },
    "teams": [
      {
        "id": "PQ9K7I8",
        "type": "team_reference",
        "summary": "Engineering",
        "self": "https://api.pagerduty.com/teams/PQ9K7I8",
        "html_url": "https://subdomain.pagerduty.com/teams/PQ9K7I8"
      }
    ],
    "pending_actions": [
      {
        "type": "unacknowledge",
        "at": "2015-11-10T01:02:52Z"
      },
      {
        "type": "resolve",
        "at": "2015-11-10T04:31:52Z"
      }
    ],
    "acknowledgements": [
      {
        "at": "2015-11-10T00:32:52Z",
        "acknowledger": {
          "id": "PXPGF42",
          "type": "user_reference",
          "summary": "Earline Greenholt",
          "self": "https://api.pagerduty.com/users/PXPGF42",
          "html_url": "https://subdomain.pagerduty.com/users/PXPGF42"
        }
      }
    ],
    "alert_grouping": {
      "grouping_type": "advanced",
      "started_at": "2015-10-06T21:30:42Z",
      "ended_at": null,
      "alert_grouping_active": true
    },
    "last_status_change_by": {
      "id": "PXPGF42",
      "type": "user_reference",
      "summary": "Earline Greenholt",
      "self": "https://api.pagerduty.com/users/PXPGF42",
      "html_url": "https://subdomain.pagerduty.com/users/PXPGF42"
    },
    "priority": {
      "id": "P53ZZH5",
      "type": "priority_reference",
      "summary": "P2",
      "self": "https://api.pagerduty.com/priorities/P53ZZH5"
    },
    "resolve_reason": null,
    "conference_bridge": {
      "conference_number": "+1-415-555-1212,,,,1234#",
      "conference_url": "https://example.com/acb-123"
    },
    "incidents_responders": [
      {
        "state": "pending",
        "user": {
          "id": "PL7A2O4",
          "type": "user_reference",
          "summary": "Lee Turner",
          "self": "https://api.pagerduty.com/users/PL7A2O4",
          "html_url": "https://subdomain.pagerduty.com/users/PL7A2O4",
          "avatar_url": "https://secure.gravatar.com/avatar/51c673f51f6b483b24c889bbafbd2a67.png?d=mm&r=PG"
        },
        "incident": {
          "id": "PXP12GZ",
          "type": "incident_reference",
          "summary": "Ongoing Incident in Mailroom",
          "self": "https://api.pagerduty.com/incidents/PXP12GZ",
          "html_url": "https://subdomain.pagerduty.com/incidents/PXP12GZ"
        },
        "updated_at": "2018-08-09T14:40:48-07:00",
        "message": "Please help with issue - join bridge at +1(234)-567-8910",
        "requester": {
          "id": "P09TT3C",
          "type": "user_reference",
          "summary": "Jane Doe",
          "self": "https://api.pagerduty.com/users/P09TT3C",
          "html_url": "https://subdomain.pagerduty.com/users/P09TT3C",
          "avatar_url": "https://secure.gravatar.com/avatar/1c747247b75acc1f724e2784c838b3f8.png?d=mm&r=PG"
        },
        "requested_at": "2018-08-09T21:40:49Z"
      }
    ],
    "responder_requests": [
      {
        "incident": {
          "id": "PXP12GZ",
          "type": "incident_reference",
          "summary": "Ongoing Incident in Mailroom",
          "self": "https://api.pagerduty.com/incidents/PXP12GZ",
          "html_url": "https://subdomain.pagerduty.com/incidents/PXP12GZ"
        },
        "requester": {
          "id": "P09TT3C",
          "type": "user_reference",
          "summary": "Jane Doe",
          "self": "https://api.pagerduty.com/users/P09TT3C",
          "html_url": "https://subdomain.pagerduty.com/users/P09TT3C"
        },
        "requested_at": "2018-08-16T14:55:17-07:00",
        "message": "Please help with issue - join bridge at +1(234)-567-8910",
        "responder_request_targets": [
          {
            "responder_request_target": {
              "type": "user",
              "id": "PL7A2O4",
              "incidents_responders": [
                {
                  "state": "pending",
                  "user": {
                    "id": "PL7A2O4",
                    "type": "user_reference",
                    "summary": "Lee Turner",
                    "self": "https://api.pagerduty.com/users/PL7A2O4",
                    "html_url": "https://subdomain.pagerduty.com/users/PL7A2O4",
                    "avatar_url": "https://secure.gravatar.com/avatar/51c673f51f6b483b24c889bbafbd2a67.png?d=mm&r=PG"
                  },
                  "incident": {
                    "id": "PXP12GZ",
                    "type": "incident_reference",
                    "summary": "Ongoing Incident in Mailroom",
                    "self": "https://api.pagerduty.com/incidents/PXP12GZ",
                    "html_url": "https://subdomain.pagerduty.com/incidents/PXP12GZ"
                  },
                  "updated_at": "2018-08-09T14:40:48-07:00",
                  "message": "Please help with issue - join bridge at +1(234)-567-8910",
                  "requester": {
                    "id": "P09TT3C",
                    "type": "user_reference",
                    "summary": "Jane Doe",
                    "self": "https://api.pagerduty.com/users/P09TT3C",
                    "html_url": "https://subdomain.pagerduty.com/users/P09TT3C",
                    "avatar_url": "https://secure.gravatar.com/avatar/1c747247b75acc1f724e2784c838b3f8.png?d=mm&r=PG"
                  },
                  "requested_at": "2018-08-09T21:40:49Z"
                }
              ]
            }
          }
        ]
      }
    ],
    "urgency": "high",
    "custom_fields": [
      {
        "id": "PT4KHEE",
        "type": "field_value",
        "name": "environment",
        "display_name": "Runtime Environment",
        "description": "environment where incident occurred",
        "data_type": "string",
        "field_type": "single_value_fixed",
        "value": "production"
      }
    ]
  }
}

from incubator-devlake.

klesh avatar klesh commented on August 26, 2024

I think it could be calculated by subtracting created_at from resolve_at, no? Assuming resolved_at is not null.

from incubator-devlake.

richard-fletcher avatar richard-fletcher commented on August 26, 2024

@klesh @hayk96 I think this data is available from the analytics endpoint https://developer.pagerduty.com/api-reference/328d94baeaa0e-get-raw-data-single-incident as the field user_defined_effort_seconds

from incubator-devlake.

hayk96 avatar hayk96 commented on August 26, 2024

Thank you @richard-fletcher,
I have checked the API you shared, and seems the user_defined_effort_seconds field shows something else. In my case it was null ("user_defined_effort_seconds": null)

from incubator-devlake.

richard-fletcher avatar richard-fletcher commented on August 26, 2024

It may only have a value when the field has been set by the user, did you test this?

from incubator-devlake.

hayk96 avatar hayk96 commented on August 26, 2024

Hmm, it seems that the value is not updating in real-time. Yesterday, I made some changes and tried calling this API several times but received null. I just double-checked, and now I see that the value has been updated 😄
Thanks again @richard-fletcher it was really helpful!

@klesh, what are the plans regarding this? Can we add this feature in DevLake for calculating PD incident times?

I guess these two fields, seconds_to_resolve and user_defined_effort_seconds, can tell us how much time an incident took. For example, the seconds_to_resolve field shows the incident duration in seconds (resolved_at - created_at). The user_defined_effort_seconds field has a null value by default. What do you think about calculating incident time via this API? If the user_defined_effort_seconds is not null, the incident time can be the same as the seconds_to_resolve field. Otherwise, we can take the value of the user_defined_effort_seconds field.

from incubator-devlake.

Related Issues (20)

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.