You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2014/12/09 23:13:47 UTC
[02/12] trafficserver git commit: TS-3229: filter unsupported epic
plugin metric names
TS-3229: filter unsupported epic plugin metric names
Epic can't deal with all our metric names, so just drop metrics
that don't match it's naming conventions.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9acf2806
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9acf2806
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9acf2806
Branch: refs/heads/master
Commit: 9acf2806f03438d2727a55d2ca54e785722442fc
Parents: 2857d53
Author: James Peach <jp...@apache.org>
Authored: Tue Nov 18 11:48:53 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Tue Dec 9 13:46:39 2014 -0800
----------------------------------------------------------------------
plugins/experimental/epic/epic.cc | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9acf2806/plugins/experimental/epic/epic.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/epic/epic.cc b/plugins/experimental/epic/epic.cc
index a05e64e..abaa014 100644
--- a/plugins/experimental/epic/epic.cc
+++ b/plugins/experimental/epic/epic.cc
@@ -358,6 +358,16 @@ struct epic_sample_context
char sample_host[TS_MAX_HOST_NAME_LEN]; /* sysconf(_SC_HOST_NAME_MAX) */
};
+// Valid epic metric names contain only [A-Z] [a-z] [0-9] _ - . = >
+static bool
+epic_name_is_valid(const char * name)
+{
+ // In practice the only metrics we have that are not OK are the
+ // proxy.process.cache.frags_per_doc.3+ set. Let's just check for
+ // that rather than regexing everything all the time.
+ return strchr(name, '+') == NULL;
+}
+
static void
epic_write_stats(
TSRecordType /* rtype */,
@@ -373,6 +383,10 @@ epic_write_stats(
TSReleaseAssert(sample != NULL);
TSReleaseAssert(sample->sample_fp != NULL);
+ if (!epic_name_is_valid(name)) {
+ return;
+ }
+
/*
* O:varName:itime:value:node:type:step
*
@@ -392,7 +406,7 @@ epic_write_stats(
* not sending
*/
- /* Traffic server metrics don't tell is their semantics, only their data
+ /* Traffic server metrics don't tell us their semantics, only their data
* type. Mostly, metrics are counters, though a few are really gauges. This
* sucks, but there's no workaround right now ...
*/