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

[yarn] Add configurable application tags #2489

Closed
wants to merge 1 commit into from
Closed

[yarn] Add configurable application tags #2489

wants to merge 1 commit into from

Conversation

alanbover
Copy link

Added application tags in the configuration file,
allowing set extra tags for app metrics like queue,
user, etc.

Also, added the tags functionality merged in
#2473
on tests

@alanbover
Copy link
Author

@olivielpeau this should improve the recently merged PR #2473

@remh remh added this to the 5.8.0 milestone May 11, 2016
@remh remh self-assigned this May 11, 2016
@degemer degemer assigned degemer and unassigned remh May 13, 2016
for tag in app_tags:
key, value = tag.split(':')
tags.append("{tag}:{value}".format(
tag=value, value=str(app_json[key])
Copy link
Member

Choose a reason for hiding this comment

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

If app_json[key] doesn't exist, this will raise a KeyError, failing the check.

I think it would be better to either test the existence of the value before appending it or try/catch it. (and emit a log.warning without failing if there is an issue)

@degemer
Copy link
Member

degemer commented May 13, 2016

@alanbover Thanks for the PR, I added a few comments, looks good otherwise !

@alanbover
Copy link
Author

@degemer I've pushed again after some fix after your comments. Much appreciated!

try:
key, value = tag.split(':')
except ValueError:
self.log.error("Invalid value {0} for application_tag").format()
Copy link
Member

Choose a reason for hiding this comment

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

Typo ? Should probably be something like:
self.log.error("Invalid value {0} for application_tag".format(tag)

@degemer
Copy link
Member

degemer commented May 18, 2016

Added a few comments, should be good after that.

@remh remh modified the milestones: 5.9.0, 5.8.0 May 18, 2016
Added application tags in the configuration file,
allowing set extra tags for app metrics like queue,
user, etc.

Also, added the tags functionality merged in
#2473
on tests
@alanbover
Copy link
Author

Hi,

Thanks for your comments, I've missed that! I've pushed the changes

tag=value, value=str(app_json[key])
))
except ValueError:
self.log.error("Invalid value {0} for application_tag").format(tag)
Copy link
Member

Choose a reason for hiding this comment

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

The parenthesis is still not correct 😉 .
Also could you use the logger interpolation instead of doing it with format ? https://www.simonmweber.com/2014/11/24/python-logging-traps.html
It should be self.log.error("Invalid value %s for application_tag", tag).

@degemer
Copy link
Member

degemer commented May 23, 2016

@alanbover There is still a small typo, 👍 after that.

@irabinovitch
Copy link
Contributor

@alanbover Were you by any chance able to review the typos @degemer mentioned?

@degemer
Copy link
Member

degemer commented Nov 22, 2016

Closed in favor of #3041

@degemer degemer closed this Nov 22, 2016
@masci masci removed this from the 5.11.0 milestone Jan 24, 2017
@masci masci modified the milestones: 5.12.0, 5.11.0 Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants