-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contributors: @mmross
- Loading branch information
Showing
6 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
# auxmoney OpentracingBundle - Jaeger | ||
|
||
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/auxmoney/OpentracingBundle-Jaeger) | ||
![Travis (.org)](https://img.shields.io/travis/auxmoney/OpentracingBundle-Jaeger) | ||
![Coveralls github](https://img.shields.io/coveralls/github/auxmoney/OpentracingBundle-Jaeger) | ||
![Codacy Badge](https://api.codacy.com/project/badge/Grade/dd11fb9bdbe54affb1946a03af5f432a) | ||
![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/auxmoney/OpentracingBundle-Jaeger) | ||
![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/auxmoney/OpentracingBundle-Jaeger) | ||
![GitHub](https://img.shields.io/github/license/auxmoney/OpentracingBundle-Jaeger) | ||
|
||
This symfony bundle provides a tracer implementation for [Jaeger](https://www.jaegertracing.io/) for the [auxmoney OpentracingBundle](https://github.com/auxmoney/OpentracingBundle-core). | ||
|
||
Please have a look at [the central documentation](https://github.com/auxmoney/OpentracingBundle-core) for installation and usage instructions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Auxmoney\OpentracingBundle\Tests\Functional; | ||
|
||
use Symfony\Component\Process\Process; | ||
|
||
class FunctionalTest extends JaegerFunctionalTest | ||
{ | ||
public function testSuccessfulTracing(): void | ||
{ | ||
$this->setUpTestProject('default'); | ||
|
||
$p = new Process(['symfony', 'console', 'test:jaeger'], 'build/testproject'); | ||
$p->mustRun(); | ||
$output = $p->getOutput(); | ||
$traceId = substr($output, 0, strpos($output, ':')); | ||
self::assertNotEmpty($traceId); | ||
|
||
$spans = $this->getSpansFromTrace($this->getTraceFromJaegerAPI($traceId)); | ||
self::assertCount(1, $spans); | ||
self::assertSame('test:jaeger', $spans[0]['operationName']); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
Tests/Functional/TestProjectFiles/default/src/Command/TestCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Command; | ||
|
||
use Auxmoney\OpentracingBundle\Internal\Opentracing; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use const OpenTracing\Formats\TEXT_MAP; | ||
|
||
class TestCommand extends Command | ||
{ | ||
private $opentracing; | ||
|
||
public function __construct(Opentracing $opentracing) | ||
{ | ||
parent::__construct('test:jaeger'); | ||
$this->setDescription('some fancy command description'); | ||
$this->opentracing = $opentracing; | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$carrier = []; | ||
$this->opentracing->getTracerInstance()->inject($this->opentracing->getTracerInstance()->getActiveSpan()->getContext(), TEXT_MAP, $carrier); | ||
$output->writeln(current($carrier)); | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters