diff --git a/lightstep/b3_propagator.py b/lightstep/b3_propagator.py
index 940a86b..1d4568c 100644
--- a/lightstep/b3_propagator.py
+++ b/lightstep/b3_propagator.py
@@ -36,12 +36,12 @@ class B3Propagator(Propagator):
 
         flags = baggage.pop(_FLAGS, None)
         if flags is not None:
-            carrier[_FLAGS] = flags
+            carrier[_FLAGS] = str(flags)
 
         sampled = baggage.pop(_SAMPLED, None)
 
         if sampled is None:
-            carrier[_SAMPLED] = 1
+            carrier[_SAMPLED] = "1"
         else:
             if flags == 1:
                 _LOG.warning(
@@ -56,16 +56,17 @@ class B3Propagator(Propagator):
                             int(sampled), sampled
                         )
                     )
-                carrier[_SAMPLED] = sampled
+                carrier[_SAMPLED] = str(sampled)
 
         if sampled is flags is (traceid and spanid) is None:
             warn(
                 "If not propagating only the sampling state, traceid and "
                 "spanid must be defined, setting sampling state to 1."
             )
-            carrier[_SAMPLED] = 1
+            carrier[_SAMPLED] = "1"
 
-        carrier.update(baggage)
+        for key, value in baggage.items():
+            carrier[key] = str(value)
 
         if traceid is not None:
             carrier[_TRACEID] = format(traceid, "x")

B3 headers value not passed as str
We've instrumented our service with LightStep and OpenTracing but have run into a snag when using B3 propagation.

```python
    opentracing.tracer = lightstep.Tracer(
        component_name=c.SERVICE_NAME,
        access_token=OPEN_TRACE_ACCESS_TOKEN,
        tags=tags
    )
    opentracing.tracer.register_propagator(Format.TEXT_MAP, B3Propagator())
    opentracing.tracer.register_propagator(
        Format.HTTP_HEADERS, B3Propagator()
    )
```

this is the error I'm seeing in developer satellite:

```
error
     message:
     "Value for header {x-b3-sampled: 1} must be of type str or bytes, not <class 'int'>"
     error.object:
     "Value for header {x-b3-sampled: 1} must be of type str or bytes, not <class 'int'>"
     error.kind:
     "InvalidHeader"
```

stack trace:

```
"line 51, in get response = requests.get( File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 519, in request prep = self.prepare_request(req) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 452, in prepare_request p.prepare( File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 314, in prepare self.prepare_headers(headers) File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 448, in prepare_headers check_header_validity(header) File "/usr/local/lib/python3.8/site-packages/requests/utils.py", line 944, in check_header_validity raise InvalidHeader("Value for header {%s: %s} must be of type str or " "
```

Appears to be failing python requests library's [header validation](https://github.com/psf/requests/issues/3477)
diff --git a/tests/b3_propagator_test.py b/tests/b3_propagator_test.py
index 4728711..17ca55e 100644
--- a/tests/b3_propagator_test.py
+++ b/tests/b3_propagator_test.py
@@ -32,7 +32,7 @@ class B3PropagatorTest(TestCase):
             {
                 "x-b3-traceid": format(span.context.trace_id, "x"),
                 "x-b3-spanid": format(span.context.span_id, "x"),
-                "x-b3-sampled": 1,
+                "x-b3-sampled": "1",
                 "checked": "baggage"
             }
         )
@@ -47,7 +47,7 @@ class B3PropagatorTest(TestCase):
             {
                 "x-b3-traceid": format(span.context.trace_id, "x"),
                 "x-b3-spanid": format(span.context.span_id, "x"),
-                "x-b3-flags": 1,
+                "x-b3-flags": "1",
             }
         )
 
@@ -174,9 +174,7 @@ class B3PropagatorTest(TestCase):
             carrier = {}
             tracer.inject(inject_span.context, Format.HTTP_HEADERS, carrier)
 
-            self.assertTrue(
-                isinstance(carrier["x-b3-sampled"], type(sampled_value))
-            )
+            self.assertTrue(isinstance(carrier["x-b3-sampled"], str))
 
             extract_span_context = tracer.extract(Format.HTTP_HEADERS, carrier)
 
@@ -200,7 +198,7 @@ class B3PropagatorTest(TestCase):
 
         tracer.inject(inject_span.context, Format.HTTP_HEADERS, carrier)
 
-        self.assertEqual(carrier["x-b3-sampled"], 1)
+        self.assertEqual(carrier["x-b3-sampled"], "1")
 
         extract_span_context = tracer.extract(Format.HTTP_HEADERS, carrier)
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest mock ipdb
apt-get update apt-get install -y python3-dev
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
asttokens==3.0.0
basictracer==3.2.0
certifi==2025.1.31
charset-normalizer==3.4.1
decorator==5.2.1
exceptiongroup==1.2.2
executing==2.2.0
googleapis-common-protos==1.69.2
idna==3.10
iniconfig==2.1.0
ipdb==0.13.13
ipython==8.18.1
jedi==0.19.2
jsonpickle==4.0.5
-e git+https://github.com/lightstep/lightstep-tracer-python.git@d11a9435d0ff53aa05a706731a9f7522f66b3690#egg=lightstep
matplotlib-inline==0.1.7
mock==5.2.0
opentracing==2.4.0
packaging==24.2
parso==0.8.4
pexpect==4.9.0
pluggy==1.5.0
prompt_toolkit==3.0.50
protobuf==3.20.3
ptyprocess==0.7.0
pure_eval==0.2.3
Pygments==2.19.1
pytest==8.3.5
requests==2.32.3
six==1.17.0
stack-data==0.6.3
thrift==0.21.0
tomli==2.2.1
traitlets==5.14.3
typing_extensions==4.13.0
urllib3==2.3.0
wcwidth==0.2.13

name: lightstep-tracer-python
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - asttokens==3.0.0
      - basictracer==3.2.0
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - decorator==5.2.1
      - exceptiongroup==1.2.2
      - executing==2.2.0
      - googleapis-common-protos==1.69.2
      - idna==3.10
      - iniconfig==2.1.0
      - ipdb==0.13.13
      - ipython==8.18.1
      - jedi==0.19.2
      - jsonpickle==4.0.5
      - matplotlib-inline==0.1.7
      - mock==5.2.0
      - opentracing==2.4.0
      - packaging==24.2
      - parso==0.8.4
      - pexpect==4.9.0
      - pluggy==1.5.0
      - prompt-toolkit==3.0.50
      - protobuf==3.20.3
      - ptyprocess==0.7.0
      - pure-eval==0.2.3
      - pygments==2.19.1
      - pytest==8.3.5
      - requests==2.32.3
      - six==1.17.0
      - stack-data==0.6.3
      - thrift==0.21.0
      - tomli==2.2.1
      - traitlets==5.14.3
      - typing-extensions==4.13.0
      - urllib3==2.3.0
      - wcwidth==0.2.13
prefix: /opt/conda/envs/lightstep-tracer-python

tests/b3_propagator_test.py::B3PropagatorTest::test_inject tests/b3_propagator_test.py::B3PropagatorTest::test_propagation
tests/b3_propagator_test.py::B3PropagatorTest::test_extract_multiple_headers tests/b3_propagator_test.py::B3PropagatorTest::test_extract_single_header tests/b3_propagator_test.py::B3PropagatorTest::test_invalid_traceid_spanid
lightstep/b3_propagator.py
lightstep/b3_propagator.py