-
Notifications
You must be signed in to change notification settings - Fork 487
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
Create shared server for loki.source.+
network targets
#3581
Conversation
@tpaschalis still have some docs to add, and some cleanup, but let me know if this goes in the right direction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're heading to the right direction. Looking forward to seeing how this progresses!
ea4fa3a
to
60f287f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT, though I'm pretty new to this codebase.
I'm looking forward to this merging so I can incorporate the changes to my PR #3648
component/loki/source/gcplog/internal/gcplogtarget/push_target.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got a few more questions as I was working on docs for a new component.
@tpaschalis @thampiotr added all settings to the config model as discussed above, and added some tests covering the river unmarshalling. Will add the docs tomorrow |
@tpaschalis @thampiotr added the docs, leaving some Qs on how to best organize them |
7a17b64
to
83db4f5
Compare
@thampiotr @tpaschalis should be good now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few documentation-related nits and we're good to go!
component/common/loki/net/config.go
Outdated
// If set, override. Don't allow a zero-value since it configure a context.WithTimeout, so the user should at least | ||
// give a >0 value to it | ||
if c.GracefulShutdownTimeout != 0 { | ||
cfg.ServerGracefulShutdownTimeout = c.GracefulShutdownTimeout | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure, what happens when the user does not set this? Is the "30s"
default applied? I'm not sure where exactly this happened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
Name | Type | Description | Default | Required | ||
------------------------|------------|----------------------------------------------------------------------------------------------------------------------|----------|---------- | ||
`listen_address` | `string` | Network address on which the server will listen for new connections. Defaults to accepting all incoming connections. | `""` | no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the default here 0.0.0.0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nop, is empty string which has the same effect of listening to tcp conns from every incoming ip. Explained here. Either way we could display it as 0.0.0.0
on the docs, but it's explained also in the description column
|
||
Name | Type | Description | Default | Required | ||
---------------------------------|------------|----------------------------------------------------------------------------------------------------------------------|--------------|---------- | ||
`listen_address` | `string` | Network address on which the server will listen for new connections. Defaults to accepting all incoming connections. | `""` | no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, does the description mean that the default is 0.0.0.0
? Or is it implied to be 0.0.0.0 by the weaveworks.Server code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one rename suggestion, happy for this to merge :)
Co-authored-by: Paschalis Tsilias <[email protected]>
Co-authored-by: Paschalis Tsilias <[email protected]>
Co-authored-by: Paschalis Tsilias <[email protected]>
@thampiotr @tpaschalis should be good to go now 😃 |
Great work @thepalbi 🙌 thanks for making writing Loki components a lot easier! |
(cherry picked from commit 4a3c4a7)
PR Description
This PR is a port of this Promtail PR: grafana/loki#9181.
Flow supports many
loki.source
that expose a network server, which underneath uses weaveworks commons server. When configuring this server, there's usually some boilerplate code to apply some defaults, scope the metrics under a namespace to avoid collisions, etc.This PR creates an abstraction that we can re-use on these kind of sources.
Which issue(s) this PR fixes
Notes to the Reviewer
PR Checklist