Skip to content

Commit

Permalink
builder: Explicitly log task id to track SLI
Browse files Browse the repository at this point in the history
Each 'Task id' corresponds to a 'Compose id' in case everything works as
expected. In order to be able to track both in Splunk to measure our
first service level indicator (SLI) we need to explicitly log the 'Task
id' when it is received by the plugin.
  • Loading branch information
ochosi committed Nov 16, 2022
1 parent 741be47 commit 30dd283
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/builder/osbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import json
import sys
import time
import logging
import urllib.parse

from string import Template
Expand All @@ -32,7 +33,6 @@
from koji.daemon import fast_incremental_upload
from koji.tasks import BaseTaskHandler


DEFAULT_COMPOSER_URL = "https://localhost"
DEFAULT_KOJIHUB_URL = "https://localhost/kojihub"
DEFAULT_CONFIG_FILES = [
Expand Down Expand Up @@ -508,6 +508,7 @@ def __init__(self, task_id, method, params, session, options):
self.composer_url = cfg["composer"]["server"]
self.koji_url = cfg["koji"]["server"]
self.client = Client(self.composer_url)
self.logger = logging.getLogger('koji.plugin.osbuild')

self.logger.debug("composer: %s", self.composer_url)
self.logger.debug("koji: %s", self.composer_url)
Expand Down Expand Up @@ -650,7 +651,7 @@ def handler(self, name, version, distro, image_type, target, arches, opts):
self.logger.debug("Building image via osbuild %s, %s, %s, %s",
name, str(arches), str(target), str(opts))

self.logger.debug("Task id: %s", str(self.id))
self.logger.info("Task id: %s", str(self.id))

target_info = self.session.getBuildTarget(target, strict=True)
if not target_info:
Expand Down

0 comments on commit 30dd283

Please sign in to comment.