{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/6520","repository_url":"https://api.github.com/repos/influxdata/influxdb","labels_url":"https://api.github.com/repos/influxdata/influxdb/issues/6520/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/influxdb/issues/6520/comments","events_url":"https://api.github.com/repos/influxdata/influxdb/issues/6520/events","html_url":"https://github.com/influxdata/influxdb/issues/6520","id":151977534,"number":6520,"title":"Graphite template to handle ip-address and hostname","user":{"login":"ucrkarthik","id":3776926,"avatar_url":"https://avatars.githubusercontent.com/u/3776926?v=3","gravatar_id":"","url":"https://api.github.com/users/ucrkarthik","html_url":"https://github.com/ucrkarthik","followers_url":"https://api.github.com/users/ucrkarthik/followers","following_url":"https://api.github.com/users/ucrkarthik/following{/other_user}","gists_url":"https://api.github.com/users/ucrkarthik/gists{/gist_id}","starred_url":"https://api.github.com/users/ucrkarthik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ucrkarthik/subscriptions","organizations_url":"https://api.github.com/users/ucrkarthik/orgs","repos_url":"https://api.github.com/users/ucrkarthik/repos","events_url":"https://api.github.com/users/ucrkarthik/events{/privacy}","received_events_url":"https://api.github.com/users/ucrkarthik/received_events","type":"User","site_admin":false},"labels":[{"id":389744484,"url":"https://api.github.com/repos/influxdata/influxdb/labels/area/graphite","name":"area/graphite","color":"fbca04","default":false},{"id":431719211,"url":"https://api.github.com/repos/influxdata/influxdb/labels/kind/enhancement","name":"kind/enhancement","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-04-29T22:00:24Z","updated_at":"2016-12-02T14:49:37Z","closed_at":null,"body":"Are there any plans to improve the graphite template logic? We are sending graphite data that contains IP address and hostname (hr.abc.com, ops.pentagon.dod.gov, etc ), since those values have dot's in them, it makes it difficult to identify tags for those graphite values. One other issue we are having is identifying multiple tags in the middle of the graphite string to create a measurement.\n"},"comment":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/comments/264470587","html_url":"https://github.com/influxdata/influxdb/issues/6520#issuecomment-264470587","issue_url":"https://api.github.com/repos/influxdata/influxdb/issues/6520","id":264470587,"user":{"login":"mre","id":175809,"avatar_url":"https://avatars.githubusercontent.com/u/175809?v=3","gravatar_id":"","url":"https://api.github.com/users/mre","html_url":"https://github.com/mre","followers_url":"https://api.github.com/users/mre/followers","following_url":"https://api.github.com/users/mre/following{/other_user}","gists_url":"https://api.github.com/users/mre/gists{/gist_id}","starred_url":"https://api.github.com/users/mre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mre/subscriptions","organizations_url":"https://api.github.com/users/mre/orgs","repos_url":"https://api.github.com/users/mre/repos","events_url":"https://api.github.com/users/mre/events{/privacy}","received_events_url":"https://api.github.com/users/mre/received_events","type":"User","site_admin":false},"created_at":"2016-12-02T14:49:37Z","updated_at":"2016-12-02T14:49:37Z","body":"We have the same issue.\r\n\r\nI think this can be resolved adding support for multiple separators.\r\n\r\nHere's the example from above:\r\n\r\nMetric:\r\n```\r\ngraphite.hadoop.yarn.NodeManagerMetrics.Context=yarn.Hostname=nid00035.cray.com.AllocatedContainers\r\n```\r\n\r\nGraphite config:\r\n\r\n```\r\n[[graphite]]\r\n  separator = \".\"\r\n  separator = \"=\"\r\n  templates = [ \".service.component.type.=context.=hostname.hostname.hostname.measurement\" ]\r\n```\r\n\r\nResult:\r\n\r\n```\r\nAllocatedContainers,service=hadoop,component=yarn,type=NodeManagerMetrics,context=yarn,hostname=nid00035.cray.com\r\n```\r\n\r\nThis way we can strip `Context=` and `Hostname=` from the metric.\r\n\r\n\r\nAdditionally it supports cases like the following:\r\n\r\nMetric:\r\n```\r\ntwemproxy-redis_mypool.gauge-1.2.3.4.6380-server_connections 123\r\n```\r\n\r\nGraphite config:\r\n\r\n```\r\n[[graphite]]\r\n  separator = \".\"\r\n  separator = \"-\"\r\n  separator = \"_\"\r\n  templates = [ \"service-database_pool.field-host-measurement*\" ]\r\n```\r\n\r\nResult:\r\n\r\n```\r\nserver_connections,service=twemproxy,database=redis,pool=mypool,host=1.2.3.4.6380 gauge=123\r\n```\r\n\r\nThis would be backwards-compatible. In addition it would be quicker and easier than full regex support.\r\nThe algorithm would be O(n) because we simply iterate over the graphite metric once, splitting at the position of the next *matching* separator in the template.\r\n\r\nI could try to create a pull request for that if you think this change will be accepted.·"}}
{"actor":{"display_login":"mre"}}