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

Docker logging driver: Add a keymod for the extra attributes from the Docker logging driver #2459

Merged
merged 3 commits into from
Sep 17, 2020

Conversation

RaitoBezarius
Copy link
Contributor

What this PR does / why we need it: Docker labelling best practices are to use labels with reverse DNS notation, but as Prometheus has a completely different view on this, it makes it very incompatible to collect custom labels which abide by Docker labelling practices, using the Docker logging driver.
Currently, the code has some special treatment for the Docker's labels, it should be possible to generalize this.

An easy way is to do a keymod when getting the extra attributes from Docker and replacing every . by _

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

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated

@CLAassistant
Copy link

CLAassistant commented Jul 31, 2020

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2020

Codecov Report

Merging #2459 into master will decrease coverage by 0.15%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2459      +/-   ##
==========================================
- Coverage   62.90%   62.74%   -0.16%     
==========================================
  Files         162      162              
  Lines       13964    13966       +2     
==========================================
- Hits         8784     8763      -21     
- Misses       4496     4519      +23     
  Partials      684      684              
Impacted Files Coverage Δ
cmd/docker-driver/config.go 9.84% <0.00%> (-0.11%) ⬇️
pkg/promtail/positions/positions.go 46.49% <0.00%> (-13.16%) ⬇️
pkg/promtail/targets/file/tailer.go 73.86% <0.00%> (-4.55%) ⬇️
pkg/querier/queryrange/downstreamer.go 95.87% <0.00%> (-2.07%) ⬇️

Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

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

Hey, thanks for the PR. I'm not very familiar with this part of the codebase but this looks sound. I'd really like to see some test additions to give confidence and help prevent regressions in the future.

Sorry for the wait and thanks for the well reasoned issue/pr :)

@stale
Copy link

stale bot commented Sep 10, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Sep 10, 2020
@stale stale bot closed this Sep 17, 2020
@cyriltovena cyriltovena reopened this Sep 17, 2020
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

sorry for the late reply.

@cyriltovena cyriltovena merged commit e9c9faf into grafana:master Sep 17, 2020
@stale stale bot removed the stale A stale issue or PR that will automatically be closed. label Sep 17, 2020
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.

No way to use Docker recommended naming in labels
5 participants