Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name generator #16

Merged
merged 42 commits into from
Jun 29, 2021
Merged

Name generator #16

merged 42 commits into from
Jun 29, 2021

Conversation

allflame
Copy link
Member

Name generation is a feature that aims to limit number of operation in case routes are generated dynamically and may result in thousands of different operation names, although are handled by the same controller::action

src/Bridge/BackgroundSpanHandler.php Outdated Show resolved Hide resolved
src/DependencyInjection/Configuration.php Outdated Show resolved Hide resolved
src/DependencyInjection/JaegerExtension.php Outdated Show resolved Hide resolved
src/DependencyInjection/JaegerExtension.php Outdated Show resolved Hide resolved
src/Name/Generator/CommandNameGenerator.php Outdated Show resolved Hide resolved
src/Name/Generator/ControllerNameGenerator.php Outdated Show resolved Hide resolved
src/Name/Generator/ControllerNameGenerator.php Outdated Show resolved Hide resolved
src/Name/Generator/RequestNameGenerator.php Show resolved Hide resolved
src/Name/Generator/ShortenGeneratorDecorator.php Outdated Show resolved Hide resolved
allflame and others added 2 commits April 22, 2021 12:53
Co-authored-by: Andrii Dembitskyi <andrew.dembitskiy@gmail.com>
Co-authored-by: Andrii Dembitskyi <andrew.dembitskiy@gmail.com>
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
src/DependencyInjection/JaegerExtension.php Outdated Show resolved Hide resolved
src/Name/Generator/NameGeneratorChain.php Outdated Show resolved Hide resolved
src/Name/Generator/RequestNameGenerator.php Show resolved Hide resolved
@@ -23,8 +23,8 @@ public function generate(): string
{
$queue = clone $this->queue;
while (false === $queue->isEmpty()) {
if ('' !== ($debugId = $queue->extract()->generate())) {
return $debugId;
if ('' !== ($name = $queue->extract()->generate())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it special behavior for name generators - if them return an empty string, then caller may think it is like a 'I cannot generate name, try another one'?

jaeger.name.generator.chain:
class: Jaeger\Symfony\Name\Generator\NameGeneratorChain
arguments:
- '@spl.priority.queue'
jaeger.name.generator:
alias: 'jaeger.name.generator.chain'
jaeger.name.generator.shorten:

This comment was marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ($config['name_generator']['max_length']) {
    $loader->load('shorten.yml');
    $container->setParameter('jaeger.name.max_length', $config['name_generator']['max_length']);
}

Added this to the configuration parser + separate shorten.yml

allflame and others added 6 commits April 26, 2021 14:51
Co-authored-by: Andrii Dembitskyi <andrew.dembitskiy@gmail.com>
Co-authored-by: Andrii Dembitskyi <andrew.dembitskiy@gmail.com>
Co-authored-by: Andrii Dembitskyi <andrew.dembitskiy@gmail.com>
Co-authored-by: Andrii Dembitskyi <andrew.dembitskiy@gmail.com>
@andrew-demb
Copy link
Contributor

andrew-demb commented Jun 3, 2021

Added some suggestions for PR - #17

UPD: fixed link to PR

@allflame allflame merged commit 4bbc15b into 3.0.x Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants