-
Notifications
You must be signed in to change notification settings - Fork 488
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
otelcolconvert: support converting loki exporter #6505
Conversation
) | ||
diags.Add( | ||
diag.SeverityLevelInfo, | ||
fmt.Sprintf("Created a loki.write block with a best-effort conversion of the lokiexporter's confighttp, retry and queue configuration settings. You may want to double check the converted configuration as most fields do not have a 1:1 match"), |
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.
Should this be a warning instead?
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.
👍 definitely a warning at minimum
res := &write.Arguments{} | ||
|
||
if cfg.Endpoint != "" { | ||
// TODO(@tpaschalis) Wire in auth from auth extension. |
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.
Not sure if there's a great way to do this yet.
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.
This is sick! I love seeing a converter which takes an interpretation of the upstream OpenTelemetry Collector components and tries to convert them best-effort into the native equivalents. This is exactly the kind of stuff I thought we'd do to make migrating to Flow easy, and I think we should have this.
That being said, I'm wondering if we should put this on hold until after the more literal components converters are finished (e.g., converters for otelcol components where we have 1:1 equivalents). Especially considering my comment about what will be necessary to handle with auth, it's not clear to me how much remaining dev time it would take to fully finish this, and whether the literal components have a higher priority.
It's up to you what you want to do; I just wanted to raise the idea that maybe this type of converter falls into a different category that may have a different priority.
if err != nil { | ||
diags.Add( | ||
diag.SeverityLevelError, | ||
fmt.Sprintf("could not build loki.write block: %s", err), | ||
) | ||
} | ||
block2 := common.NewBlockWithOverride([]string{"loki", "write"}, label, args2) |
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'm pretty sure common.NewBlockWithOverride
will panic if err != nil here, since args2 == nil
if err != nil
.
args1 := toOtelcolExporterLoki(lokiWriteComponentID) | ||
block1 := common.NewBlockWithOverride([]string{"otelcol", "exporter", "loki"}, label, args1) |
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.
naming nit: can we give thiese more descriptive names than args1/block1/args2/block2 please? 😛
) | ||
diags.Add( | ||
diag.SeverityLevelInfo, | ||
fmt.Sprintf("Created a loki.write block with a best-effort conversion of the lokiexporter's confighttp, retry and queue configuration settings. You may want to double check the converted configuration as most fields do not have a 1:1 match"), |
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.
nit: This makes it sound like a different event from the above diagnostic; can we use diags.AddWithDetail
on the first one and add the best-effort notice as the detail line?
res := &write.Arguments{} | ||
|
||
if cfg.Endpoint != "" { | ||
// TODO(@tpaschalis) Wire in auth from auth extension. |
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 a note)
😬 Handling auth here will be tricky, because we can't pass otelcol.auth.basic
to loki.write
; we'll have to actually probe the auth extension that lokiexporter was using and copy settings from the definition of the auth extension into loki.write
.
Signed-off-by: Paschalis Tsilias <[email protected]>
Signed-off-by: Paschalis Tsilias <[email protected]>
092cb20
to
9616a53
Compare
This PR has not had any activity in the past 30 days, so the |
I'm going to close this for now. We can listen to feedback to see if this is still needed and if so, port this to Alloy with feedback addressed. |
Fixes grafana/alloy#243