Skip to content

Commit 50f99c0

Browse files
committed
get and pass traceparent to osbs tasks
This is to enable OpenTelemetry tracing in `osbs` Signed-off-by: Harsh Modi <hmodi@redhat.com>
1 parent 30499d1 commit 50f99c0

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

koji_containerbuild/plugins/builder_containerbuild.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,10 @@ def osbs(self):
316316
conf_section = DEFAULT_CONF_BINARY_SECTION
317317
elif self.method in BuildSourceContainerTask.Methods:
318318
conf_section = DEFAULT_CONF_SOURCE_SECTION
319-
320319
os_conf = Configuration(conf_section=conf_section)
321-
self._osbs = OSBS(os_conf)
320+
# figure out where to get this from brew otel
321+
traceparent = ''
322+
self._osbs = OSBS(os_conf, traceparent=traceparent)
322323
if not self._osbs:
323324
msg = 'Could not successfully instantiate `osbs`'
324325
raise ContainerError(msg)
@@ -1011,6 +1012,13 @@ def handler(self, src, target, opts=None):
10111012
userdata=opts.get('userdata', None),
10121013
)
10131014

1015+
# need brew instrumentation to be completed to know where we will get this from
1016+
traceparent = ''
1017+
if traceparent:
1018+
kwargs.update({
1019+
'traceparent': traceparent,
1020+
})
1021+
10141022
result = self.createContainer(**kwargs)
10151023

10161024
self.logger.debug("Result: %r", result)
@@ -1190,6 +1198,13 @@ def handler(self, target, opts=None):
11901198
userdata=opts.get('userdata', None),
11911199
)
11921200

1201+
# need brew instrumentation to be completed to know where we will get this from
1202+
traceparent = ''
1203+
if traceparent:
1204+
kwargs.update({
1205+
'traceparent': traceparent,
1206+
})
1207+
11931208
result = self.createSourceContainer(**kwargs)
11941209

11951210
self.logger.debug("Result: %r", result)

test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ function setup_kojic() {
7171
# from specified git source (default: upstream master)
7272
$RUN rm -rf /tmp/osbs-client
7373
$RUN git clone --depth 1 --single-branch \
74-
https://github.com/projectatomic/osbs-client --branch master /tmp/osbs-client
74+
https://github.com/hjmodi/osbs-client --branch master /tmp/osbs-client
7575
# RPM install build dependencies for osbs-client
7676
$RUN "${BUILDDEP[@]}" --define "with_python3 ${WITH_PY3}" -y /tmp/osbs-client/osbs-client.spec
7777

7878
# Run pip install with '--no-deps' to avoid compilation.
7979
# This will also ensure all the deps are specified in the spec
8080
# Pip install osbs-client from git master
8181
$RUN "${PIP_INST[@]}" --upgrade --no-deps --force-reinstall \
82-
git+https://github.com/projectatomic/osbs-client
82+
git+https://github.com/hjmodi/osbs-client
8383
# Pip install dockerfile-parse from git master
8484
$RUN "${PIP_INST[@]}" --upgrade --force-reinstall \
8585
git+https://github.com/containerbuildsystem/dockerfile-parse

0 commit comments

Comments
 (0)