Skip to content

Commit

Permalink
Merge pull request #165 from rudderlabs/develop
Browse files Browse the repository at this point in the history
chore: release v2.3.0
  • Loading branch information
itsmihir authored Aug 8, 2024
2 parents d62d5f1 + 7710cb2 commit a7a4d14
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-onto-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# tagFormat: v${version}
# failBuild: true
- run: |
docker login --username rudderlabs --password '${{ secrets.DOCKER_HUB_PASSWORD }}'
docker login --username rudderlabs --password '${{ secrets.DOCKERHUB_TOKEN }}'
export VERSION=${{ steps.branch-name.outputs.current_branch }}
rm -rf rudder-alerta-enrichment-plugin
git config --global url."https://${{secrets.PAT}}:x-oauth-basic@github.com/rudderlabs".insteadOf "https://github.com/rudderlabs"
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/pr-onto-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,3 @@ jobs:
file: package.json
tagFormat: v${version}
failBuild: true
# - run: |
# docker login --username rudderlabs --password '${{ secrets.DOCKER_HUB_PASSWORD }}'
# export VERSION=${{ steps.branch-name.outputs.current_branch }}
# rm -rf rudder-alerta-enrichment-plugin
# git clone -b "$(cat RUDDER_ENRICH_PLUGIN_BRANCH_NAME)" git@github.com:rudderlabs/rudder-alerta-enrichment-plugin.git
# docker build --no-cache --build-arg=COMMIT_ID_VALUE="$(git log --format="%H" -n 1)" -t rudderlabs/alerta:$VERSION .
# docker push rudderlabs/alerta:$VERSION
# rm -rf rudder-alerta-enrichment-plugin
# name: Docker build and push
2 changes: 1 addition & 1 deletion .github/workflows/push-onto-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
failBuild: true
id: version_check_staging
- run: |
docker login --username rudderlabs --password '${{ secrets.DOCKER_HUB_PASSWORD }}'
docker login --username rudderlabs --password '${{ secrets.DOCKERHUB_TOKEN }}'
export VERSION=${{steps.version_check_staging.outputs.releaseVersion}}
rm -rf rudder-alerta-enrichment-plugin
git config --global url."https://${{secrets.PAT}}:x-oauth-basic@github.com/rudderlabs".insteadOf "https://github.com/rudderlabs"
Expand Down
8 changes: 8 additions & 0 deletions alerta/models/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@

sources_search_words = ['sourceID=', 'sourceId=', 'source-id=', 'source=', 'source_id=']
destinations_search_words = ['destID=', 'destinationId=', 'destinationID=', 'destination-id=', 'destId=', 'destination_id=']
profiles_search_words = ['profile_id=']
transformation_search_words = ['transformationId=', 'transformation_id=']

resourceTypeToSearchWordsMap = {
"destination": destinations_search_words,
"source": sources_search_words,
"profile": profiles_search_words,
"transformation": transformation_search_words
}

Expand All @@ -49,6 +51,12 @@ def get_rudder_resource_from_tags(tags):
break
return rudder_resource_type, rudder_resource_id

def add_custom_labels(labels: JSON):
# for profiles alerts, add profile_id as a label
if labels.get('category') == 'wht' and 'job_id' in labels:
labels['profile_id'] = labels.get('job_id')
return labels;

class Alert:

def __init__(self, resource: str, event: str, **kwargs) -> None:
Expand Down
3 changes: 2 additions & 1 deletion alerta/webhooks/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from alerta.models.alert import Alert

from . import WebhookBase
from alerta.models.alert import get_rudder_resource_from_tags
from alerta.models.alert import get_rudder_resource_from_tags, add_custom_labels
import json
from alerta.utils.config import get_alert_mode

Expand All @@ -25,6 +25,7 @@ def parse_prometheus(alert: JSON, external_url: str) -> Alert:
# See https://github.com/prometheus/prometheus/issues/2818

labels = {}
alert['labels'] = add_custom_labels(alert['labels'])
for k, v in alert['labels'].items():
try:
labels[k] = v.format(**alert['labels'])
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "2.2.2"
"version": "2.3.0"
}

0 comments on commit a7a4d14

Please sign in to comment.