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

Add GELF support for Promtail. #4744

Merged
merged 8 commits into from
Nov 15, 2021
Merged

Add GELF support for Promtail. #4744

merged 8 commits into from
Nov 15, 2021

Conversation

cyriltovena
Copy link
Contributor

What this PR does / why we need it:

This PR adds support for GELF UDP protocol to listen and send GELF message to Loki.

Which issue(s) this PR fixes:
Fixes #4743

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated
  • Add an entry in the CHANGELOG.md about the changes.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@cyriltovena cyriltovena requested review from KMiller-Grafana and a team as code owners November 12, 2021 14:35
@cyriltovena cyriltovena changed the title Add Gelf support for Promtail. Add GELF support for Promtail. Nov 12, 2021
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
CHANGELOG.md Outdated Show resolved Hide resolved
cyriltovena and others added 4 commits November 12, 2021 15:42
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Copy link
Collaborator

@slim-bean slim-bean left a comment

Choose a reason for hiding this comment

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

LGTM!

@cyriltovena cyriltovena merged commit 81e67f8 into grafana:main Nov 15, 2021

```

**Available Labels:**
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm suprised you don't expose the extra fields as e.g. __gelf_message_extra_<name>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created an issue #4846

Comment on lines +116 to +119
// Add all labels from the config.
for k, v := range t.config.Labels {
lb.Set(string(k), string(v))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this the same for each message? Why is it done each time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To ensure label are clone and not mutated after. Might not be required.

Comment on lines +991 to +992
The `gelf` block configures a GELF UDP listener allowing users to push
logs to Promtail with the [GELF](https://docs.graylog.org/docs/gelf) protocol.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean Promtail has a continuous connection with a server? What's happening when it fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Promtail is the server.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And there's no connection in UDP.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, it's been a long time that I've looked at UDP 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GELF support in promtail
4 participants