Skip to content

Commit 7f987fd

Browse files
committed
Allow casting of string env variables
1 parent 8c31be4 commit 7f987fd

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

src/Resources/config/services.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
parameters:
22
service_name: app
33
env(JAEGER_HOST): localhost
4-
env(JAEGER_PORT): 6832
5-
env(JAEGER_BUFFER_SIZE): 16384
4+
env(JAEGER_PORT): '6832'
5+
env(JAEGER_BUFFER_SIZE): '32768'
66
env(JAEGER_SAMPLER_TYPE): adaptive
7-
env(JAEGER_SAMPLER_PARAM): 0.001
7+
env(JAEGER_SAMPLER_PARAM): '0.001'
88
env(JAEGER_CONTEXT_FORMAT): 'text'
99
env(JAEGER_CONTEXT_ENV): 'UBER_TRACE_ID'
1010
env(JAEGER_CONTEXT_HEADER): 'uber-trace-id'
@@ -86,10 +86,10 @@ services:
8686
arguments: ['@thrift.transport']
8787
thrift.protocol: '@thrift.protocol.binary'
8888
thrift.transport.udp:
89-
class: Jaeger\Transport\TUDPTransport
89+
class: Jaeger\Symfony\Transport\SymfonyUDPTransport
9090
arguments: ['%env(JAEGER_HOST)%', '%env(JAEGER_PORT)%']
9191
thrift.transport.buffered:
92-
class: Thrift\Transport\TBufferedTransport
92+
class: Jaeger\Symfony\Transport\SymfonyBufferedTransport
9393
arguments: ['@thrift.transport.udp', '%env(JAEGER_BUFFER_SIZE)%', '%env(JAEGER_BUFFER_SIZE)%']
9494
calls:
9595
-
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Jaeger\Symfony\Transport;
5+
6+
use Thrift\Transport\TBufferedTransport;
7+
8+
class SymfonyBufferedTransport extends TBufferedTransport
9+
{
10+
public function __construct($transport = null, $rBufSize = 512, $wBufSize = 512)
11+
{
12+
parent::__construct($transport, (int)$rBufSize, (int)$wBufSize);
13+
}
14+
}

src/Transport/SymfonyUDPTransport.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Jaeger\Symfony\Transport;
5+
6+
use Jaeger\Transport\TUDPTransport;
7+
8+
class SymfonyUDPTransport extends TUDPTransport
9+
{
10+
public function __construct($host, $port)
11+
{
12+
parent::__construct((string)$host, (int)$port);
13+
}
14+
}

0 commit comments

Comments
 (0)