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

Tag Filtering #14

Closed
prsf1233 opened this issue Aug 11, 2017 · 12 comments
Closed

Tag Filtering #14

prsf1233 opened this issue Aug 11, 2017 · 12 comments

Comments

@prsf1233
Copy link

Hi Jan, as discussed I would like to implement tag filtering on the AWS-EC2 dashboard. My end users do not know the InstanceId of their environment but I do tag each instance with a friendly name. I would like to be able to use the Name Tag for selecting the graphs rather than the InstanceId but so far have not been able to make it work. I can see the Tags but not been able to get the correct syntax.

image

image

Any suggestion on whether this is possible?

@jangaraj
Copy link
Member

Thank you for idea and example. Tag filtering will be useful definitely. Let me investigate and test it.

@jangaraj
Copy link
Member

jangaraj commented Aug 11, 2017

There will be visualization problem with ec2_instance_attribute($region, Tags, {}) if EC2 instance has more than 1 tag, example:
image

I would like to have 1st variable (query) which will return all tags keys and then 2nd variable (query), which will return tags values based on selected tag key (1st variable). Is it possible?

Probably we need to wait for grafana/grafana#8307

@prsf1233
Copy link
Author

Cool, for my use case only one Tag exists but yes I am sure others would need to filter on multple.

@paco3346
Copy link

@prsf1233 Check out my comment on that PR: grafana/grafana#8307 (comment)

This is how I handle the 'friendly name' issue internally.

@jangaraj
Copy link
Member

jangaraj commented Sep 7, 2017

https://github.com/monitoringartist/grafana-aws-cloudwatch-dashboards/blob/ec2-tag-filtering/aws-ec2/aws-ec2-tag-filtering.json - EC2 dashboard with tag name filtering for Grafana 4.5.beta1+. Feel free to improve this dashboard.

@pax-awitt
Copy link

hi @jangaraj, i wanted to submit a branch and pr for this issue, but i obviously get a 403. how can i do this?

@jangaraj
Copy link
Member

Hi @pax-awitt, that's correct. You can push the code only to the repos, where you have write permission. Please fork this repo first and then create the pull request based on your forked and modified repo. Github help can be the useful doc for you.

@tomislater
Copy link

tomislater commented Oct 27, 2017

What about something like that: ec2_instance_attribute($region, Tags.Name, {}). I have checked it on 4.6.0 version.

@jangaraj
Copy link
Member

@tomislater That's filtering is by one tag key (Name). It's OK for simple tagging. But it can be more complicated. For example, if you have blue/green deployment. Then the Name tag value is not unique and you need to filter by additional key (Colour) as well. The best general solution for the dashboard is to have ad-hoc filters similar to Elasticsearch ad-hoc filters:
elk-adhoc-filter
Feel free to open feature/pull request for CloudWatch plugin. Some function, which will return all available tag keys and tag values in the selected AWS "space" (ec2, ebs, emr, ...) must be implemented.

@jangaraj
Copy link
Member

Grafana 5 EC2 dashboard with name tag filtering b925924:

image

If EC2 instances don't have a Name tags, then Tag Name: All and use classic Instance ID variable to select instance.

@saindia-TBA
Copy link

Hi,

We have imported latest change done by you but still not working.

image

@jangaraj
Copy link
Member

jangaraj commented May 26, 2018

It looks like a IAM problem in your case. Do you have:

"ec2:DescribeTags", "ec2:DescribeInstances"

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

No branches or pull requests

6 participants