Skip to content

Implement generic forwarder#1775

Merged
mapno merged 12 commits intografana:mainfrom
Blinkuu:implement_generic_forwarder
Oct 19, 2022
Merged

Implement generic forwarder#1775
mapno merged 12 commits intografana:mainfrom
Blinkuu:implement_generic_forwarder

Conversation

@Blinkuu
Copy link
Copy Markdown
Contributor

@Blinkuu Blinkuu commented Oct 3, 2022

What this PR does:

This PR introduces a new subcomponent to distributor named forwarder. This generic forwarder serves as a facade for forwarding batches of spans in "fire-and-forget" way. The feature is designed in such a way that it's configurable on per-tenant basis.

Example configuration:

# config.yaml
distributor:
  forwarders:
    - name: "otel-forwarder"
      backend: "otlpgrpc"
      otlpgrpc:
        endpoints: ['otelcol:4317']
        tls:
          insecure: true

# overrides.yaml
overrides:
  "example-tenant-1":
    forwarders: ['otel-forwarder']
  "example-tenant-2":
    forwarders: ['otel-forwarder']

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 3, 2022

CLA assistant check
All committers have signed the CLA.

@Blinkuu Blinkuu changed the title Implement generic forwarder WIP: Implement generic forwarder Oct 3, 2022
@Blinkuu Blinkuu self-assigned this Oct 5, 2022
@Blinkuu Blinkuu added the enhancement New feature or request label Oct 5, 2022
@Blinkuu Blinkuu marked this pull request as ready for review October 6, 2022 13:39
Copy link
Copy Markdown
Contributor

@mapno mapno left a comment

Choose a reason for hiding this comment

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

Gave it a quick review. I will come back to it later, it's a big PR. Overall I like the direction of the PR.

Comment thread modules/distributor/queue/queue.go Outdated
Comment thread modules/distributor/queue/queue.go Outdated
@Blinkuu Blinkuu changed the title WIP: Implement generic forwarder Implement generic forwarder Oct 7, 2022
Copy link
Copy Markdown
Contributor

@mapno mapno left a comment

Choose a reason for hiding this comment

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

Overall, looks very good to me. I only find the manager logic to be complicated and difficult to follow. Left a comment.

Will wait to see if anyone else wants to chip in.

Comment thread modules/distributor/forwarder/otlpgrpc/forwarder.go
Copy link
Copy Markdown
Collaborator

@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.

This is a large PR that will require several hours to give a proper review to. Is there anyway to break the refactor up from the functionality addition?

Comment thread modules/distributor/distributor.go
Comment thread modules/distributor/distributor.go
Comment thread modules/distributor/forwarder.go
@Blinkuu
Copy link
Copy Markdown
Contributor Author

Blinkuu commented Oct 12, 2022

This PR is now rebased on top of #1796. That PR must be merged before this one.

Copy link
Copy Markdown
Collaborator

@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.

I think we can reduce the complexity of this PR significantly. Let me know if some of these comments are unclear.

Comment thread modules/distributor/distributor.go Outdated
Comment thread modules/distributor/distributor.go
Comment thread modules/distributor/forwarder/config.go Outdated
Comment thread modules/distributor/forwarder/config.go Outdated
Comment thread modules/distributor/forwarder/otlpgrpc/config.go Outdated
Comment thread modules/distributor/forwarder/manager.go Outdated
Comment thread modules/distributor/forwarder/manager.go Outdated
Comment thread modules/distributor/forwarder/manager.go Outdated
Comment thread modules/distributor/forwarder/otlpgrpc/forwarder.go Outdated
Comment thread modules/distributor/forwarder/otlpgrpc/forwarder.go Outdated
@Blinkuu Blinkuu requested a review from joe-elliott October 17, 2022 10:00
Comment thread modules/distributor/forwarder/otlpgrpc/forwarder.go Outdated
@joe-elliott joe-elliott self-assigned this Oct 17, 2022
Comment thread modules/distributor/forwarder/otlpgrpc/forwarder.go
@Blinkuu Blinkuu requested review from joe-elliott and mapno October 18, 2022 11:36
Copy link
Copy Markdown
Contributor

@mapno mapno 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 it's almost there. Great work 👏

Comment thread modules/distributor/forwarder/manager.go Outdated
Copy link
Copy Markdown
Collaborator

@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 question and then I'm good.

Comment thread modules/distributor/distributor.go
Comment thread modules/distributor/forwarder/otlpgrpc/forwarder.go
Copy link
Copy Markdown
Contributor

@mapno mapno left a comment

Choose a reason for hiding this comment

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

LGTM

@mapno mapno merged commit c673a60 into grafana:main Oct 19, 2022
@Blinkuu Blinkuu deleted the implement_generic_forwarder branch October 19, 2022 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants