<commit_before># ironmq-error-pagerduty
Basic IronWorker to translate from IronMQ Errors to PagerDuty Incidents

# Usage
This tool is intended to serve the following use case: `subject_queue` -> `error_queue` (push) -> IronWorker (this) -> PagerDuty

Since IronWorkers do not have access to Header values, and the `name` field for Push Queue subscribers is not editable from the HUD, the best option seems to be having an IronWorker per PagerDuty "incident key".

So, if you want to distinguish your PD Incidents per subject queue, you'll need to have an IronWorker per subject, where you set the `pagerduty_incident_key` to be indicative of the subject queue.

If you are okay with aggregating errors from several subject queues into one PD Incident grouping, then you'll just set up one IronWorker with a `pagerduty_incident_key` indicating the aggregation.

# Config
This worker expects these values are configured for it, via the HUD Dashboard:
```yaml
pagerduty_api_key: EXAMPLE_KEY
pagerduty_service_key: ANOTHER_EXAMPLE_KEY
pagerduty_subdomain: EXAMPLE_SUBDOMAIN
pagerduty_incident_key: EXAMPLE_INCIDENT_KEY
```

# Payload
This worker expects the standard IronMQ Error message as payload:
```json
{
  "source_message_id": "6287988621459144854",
  "body": "Example contents of a queue message",
  "subscribers": [
    {
      "name": "",
      "url": "http://example.com/no-way/no-how",
      "code": 500,
      "msg": "Post http://example.com/no-way/no-how: dial tcp: lookup example.com on 127.0.0.1:80: no such host"
    }
  ]
}
```

# Result
This will create/update a PagerDuty Incident. The incident name look like
"Queue Error for example_incident_key".

# Testing

You can test the container locally with Docker by calling `make test`

# Deploying
<commit_msg>Update README for HUD config is expected to be JSON<commit_after># ironmq-error-pagerduty
Basic IronWorker to translate from IronMQ Errors to PagerDuty Incidents

# Usage
This tool is intended to serve the following use case: `subject_queue` -> `error_queue` (push) -> IronWorker (this) -> PagerDuty

Since IronWorkers do not have access to Header values, and the `name` field for Push Queue subscribers is not editable from the HUD, the best option seems to be having an IronWorker per PagerDuty "incident key".

So, if you want to distinguish your PD Incidents per subject queue, you'll need to have an IronWorker per subject, where you set the `pagerduty_incident_key` to be indicative of the subject queue.

If you are okay with aggregating errors from several subject queues into one PD Incident grouping, then you'll just set up one IronWorker with a `pagerduty_incident_key` indicating the aggregation.

# Config
This worker expects these values are configured for it, via the HUD Dashboard:
```json
{
    "pagerduty_api_key": "EXAMPLE_KEY",
    "pagerduty_service_key": "ANOTHER_EXAMPLE_KEY",
    "pagerduty_subdomain": "EXAMPLE_SUBDOMAIN",
    "pagerduty_incident_key": "EXAMPLE_INCIDENT_KEY"
}
```

# Payload
This worker expects the standard IronMQ Error message as payload:
```json
{
  "source_message_id": "6287988621459144854",
  "body": "Example contents of a queue message",
  "subscribers": [
    {
      "name": "",
      "url": "http://example.com/no-way/no-how",
      "code": 500,
      "msg": "Post http://example.com/no-way/no-how: dial tcp: lookup example.com on 127.0.0.1:80: no such host"
    }
  ]
}
```

# Result
This will create/update a PagerDuty Incident. The incident name look like
"Queue Error for example_incident_key".

# Testing

You can test the container locally with Docker by calling `make test`

# Deploying

{'fraction_non_alphanumeric': 0.0820215410107705, 'fraction_numerical': 0.016570008285004142, 'mean_word_length': 4.504559270516717, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3239585', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1089, 'n_words': 445}