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

[couchbase] Modified service_check_tags in couchbase.py to include user-specified tags. #3079

Merged
merged 1 commit into from
Feb 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion checks.d/couchbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,12 @@ def get_data(self, server, instance):
url = '%s%s' % (server, COUCHBASE_STATS_PATH)

# Fetch initial stats and capture a service check based on response.
service_check_tags = ['instance:%s' % server]
service_check_tags = instance.get('tags', [])
if service_check_tags is None:
service_check_tags = []
else:
service_check_tags = list(set(service_check_tags))
Copy link
Member

Choose a reason for hiding this comment

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

i think you can replace all that with service_check_tags = list(set(instance.get('tags') or []))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hkaj I made the changes in this way to keep service tag collection consistent with how tags are collected elsewhere in this check. See:

https://github.com/arzarif/dd-agent/blob/b5932ebabf73765e25c2a330ae41a9bf932fc789/checks.d/couchbase.py#L152-L159

Copy link
Contributor

Choose a reason for hiding this comment

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

@hkaj, @arzarif is correct. I'm going to approve and merge this.

service_check_tags.append('instance:%s' % server)
try:
overall_stats = self._get_stats(url, instance)
# No overall stats? bail out now
Expand Down