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

Support mirror traffic pipelines #474

Merged
merged 9 commits into from
Mar 30, 2021

Conversation

mapno
Copy link
Member

@mapno mapno commented Mar 18, 2021

PR Description

Adds support for multiple backends in a tracing pipeline. push_config is deprecated in favor of remote_write and batch, which configure the multiple exporters.

remote_write still uses PushConfig, but the idea is to rename it and remove the Batch field once the push_config is removed from the config.

Which issue(s) this PR fixes

Closes #466

Notes to the Reviewer

PR Checklist

  • CHANGELOG updated
  • Documentation added
  • Tests updated

* introduce `remote_write` blocks and `batch` in Tempo config

* deprecate `push_config` in Tempo config

* support multiple backends for a single tracing pipeline
@mapno
Copy link
Member Author

mapno commented Mar 18, 2021

Wasn't really sure how to proceed with all the changes needed in /docs and /production. Also didn't want to go too far updating things before checking that the approach is valid. Let me know what you think.

@mapno mapno requested a review from rfratto March 18, 2021 12:47
Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

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

I think this is pretty reasonable but I'm going to tag @joe-elliott for a review.

Does batch need to be applied across all the exporters or is it possible to have (or want) per-endpoint batch settings?

pkg/tempo/config.go Outdated Show resolved Hide resolved
pkg/tempo/config.go Outdated Show resolved Hide resolved
pkg/tempo/config.go Outdated Show resolved Hide resolved
pkg/tempo/config.go Show resolved Hide resolved
pkg/tempo/config.go Show resolved Hide resolved
* move Batch field down for clarity regarding its deprecation

* remove unnecessary pointer receiver in exporter function

* remove redundant check for {remote_write/push_config}.endpoint
@mapno mapno force-pushed the support-mirror-traffic-pipelines branch from b68aa01 to fca5b8b Compare March 18, 2021 19:34
@mapno mapno force-pushed the support-mirror-traffic-pipelines branch from 203101e to 266d2ad Compare March 22, 2021 13:01
Changes config examples to use remote_write/batch instead of push_config
* Sort config pipelines' exporters to make them comparable

Maps in Go are not sorted, so the exporters can end up in any order,
making the pipeline's exporter slice sorted in that order.
If the order is different for actualConfig and expectedConfig,
the assertion will fail while both being essentially the same config.
@mapno
Copy link
Member Author

mapno commented Mar 23, 2021

Applied the suggested changes and updated the config examples, as well as the config in /production.

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

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

One final thought about backwards compat.

pkg/tempo/config.go Outdated Show resolved Hide resolved
Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

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

Thanks for changing the Tanka stuff too, great work :)

I think my open question from last time got missed. What are the odds someone is going to watch different batch settings per remote_write? Prometheus does this with its queue_config settings. If the same thing doesn't make as much sense for traces, then I think this PR is fine as-is. Otherwise, I think we might want to consider setting up one pipeline per exporter, maybe in a follow-up PR.

(I'm not sure if that actually works though, i.e., if OTel lets you re-use receivers across multiple pipelines.)

pkg/tempo/config.go Show resolved Hide resolved
return exporters, nil
}

func (c *InstanceConfig) otelConfig() (*configmodels.Config, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we log a warning somewhere here if push_config is configured to note that it's deprecated in favor of remote_write?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added in 53d7f96

@mapno
Copy link
Member Author

mapno commented Mar 25, 2021

Thanks for changing the Tanka stuff too, great work :)

I think my open question from last time got missed. What are the odds someone is going to watch different batch settings per remote_write? Prometheus does this with its queue_config settings. If the same thing doesn't make as much sense for traces, then I think this PR is fine as-is. Otherwise, I think we might want to consider setting up one pipeline per exporter, maybe in a follow-up PR.

(I'm not sure if that actually works though, i.e., if OTel lets you re-use receivers across multiple pipelines.)

Yes, sorry I totally missed it before. I'm not sure how often people are going to want per-exporter batch configs, but is something doable. The OTel collector lets you set up pipelines re-using components (i.e. receivers, processors, exporters) as much as you'd like.

I think that different batch configs is most interesting when the exporters are different, which for the agent is not the case (we're always using the otlp exporter). But maybe @joe-elliott can give a better answer since he has more experience operating it.

@mapno mapno force-pushed the support-mirror-traffic-pipelines branch from ca6cfcf to 53d7f96 Compare March 25, 2021 16:21
@joe-elliott
Copy link
Member

The PR as is covers the necessary cases. The OTEL collector does not allow a batch processor per exporter in a mirrored setup. There can be only one batch exporter for the pipeline that is then mirrored to the two exporters.

Independent pipelines can (and should) have independent batch processors but this is already covered at the []InstanceConfig level.

@rfratto
Copy link
Member

rfratto commented Mar 30, 2021

Thanks for the input! Merging. Thanks again @mapno!

@rfratto rfratto merged commit d3c10d9 into grafana:main Mar 30, 2021
@mapno mapno deleted the support-mirror-traffic-pipelines branch September 6, 2021 14:47
@mattdurham mattdurham mentioned this pull request Sep 7, 2021
3 tasks
mattdurham pushed a commit that referenced this pull request Nov 11, 2021
* Support mirroring a trace pipeline to multiple backends

* introduce `remote_write` blocks and `batch` in Tempo config

* deprecate `push_config` in Tempo config

* support multiple backends for a single tracing pipeline

* Update CHANGELOG

* Apply some review suggestions

* move Batch field down for clarity regarding its deprecation

* remove unnecessary pointer receiver in exporter function

* remove redundant check for {remote_write/push_config}.endpoint

* Remove Batch from RemoteWrite config

* Update config examples

Changes config examples to use remote_write/batch instead of push_config

* Fix flaky config test

* Sort config pipelines' exporters to make them comparable

Maps in Go are not sorted, so the exporters can end up in any order,
making the pipeline's exporter slice sorted in that order.
If the order is different for actualConfig and expectedConfig,
the assertion will fail while both being essentially the same config.

* Update /production config to use RemoteWrite

* Undeprecate Batch from PushConfig

* Add warning log when using push_config
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Apr 9, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tempo: Support Mirroring a traffic pipeline
3 participants