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

otelcolconvert: support converting loki exporter #6505

Closed
wants to merge 2 commits into from

Conversation

tpaschalis
Copy link
Member

@rfratto rfratto self-assigned this Feb 23, 2024
)
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"),
Copy link
Member Author

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?

Copy link
Contributor

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.
Copy link
Member Author

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.

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.

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.

Comment on lines +52 to +58
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)
Copy link
Member

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.

Comment on lines +43 to +44
args1 := toOtelcolExporterLoki(lokiWriteComponentID)
block1 := common.NewBlockWithOverride([]string{"otelcol", "exporter", "loki"}, label, args1)
Copy link
Member

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"),
Copy link
Member

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.
Copy link
Member

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.

@rfratto rfratto added variant/flow Relatd to Grafana Agent Flow. enhancement New feature or request labels Apr 9, 2024
Copy link
Contributor

This PR has not had any activity in the past 30 days, so the needs-attention label has been added to it.
If you do not have enough time to follow up on this PR or you think it's no longer relevant, consider closing it.
The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your PR will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity.
Thank you for your contributions!

@github-actions github-actions bot added the needs-attention An issue or PR has been sitting around and needs attention. label May 13, 2024
@rfratto
Copy link
Member

rfratto commented Jun 14, 2024

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.

@rfratto rfratto closed this Jun 14, 2024
@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 Jul 15, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. needs-attention An issue or PR has been sitting around and needs attention. variant/flow Relatd to Grafana Agent Flow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support converting lokiexporter
3 participants