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

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 62.74%. Comparing base (0c4f704) to head (3bac933).

Files with missing lines Patch % Lines
cmd/docker-driver/config.go 0.00% 3 Missing ⚠️
Additional details and impacted files

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              
Files with missing lines Coverage Δ
cmd/docker-driver/config.go 9.84% <0.00%> (-0.11%) ⬇️

... and 3 files with indirect coverage changes

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